#2025.7 Broke my RESTful Integration

1 messages · Page 1 of 1 (latest)

versed atlas
#

I'm using a template sensor to display values from an XML file located on the HA server in www folder. This has been working for several years until 2025.7. Now I just get "unknown_sensor" instead of the template sensor value. I posted the issue in home-assistant/core on github but so far no helpful responses. Any ideas?

# Davis Weather Station main data
  - platform: rest
    name: Station Data
    resource: http://localhost:8123/local/XML_tags.xml
    json_attributes_path: "$.Davis-Weather-Tags"
    scan_interval: 60
    value_template: "OK"
    json_attributes:
      - "outsideTemp"
      - "outsideHumidity"
      - "barometer"
      - "windSpeed"
      - "windDirection"
      - "windDir"
      - "windAvg10"
      - "windHigh10"
      - "dailyRain"
      - "ForecastStr"
  - platform: template
    sensors:
        outside_temp_davis:
            unique_id: davis_outside_temperature
            friendly_name: Davis Outside Temp
            value_template: "{{ state_attr('sensor.station_data', 'outsideTemp') }}"
            unit_of_measurement: "°F"
            device_class: temperature```
unique elm
# versed atlas I'm using a template sensor to display values from an XML file located on the HA...

i had issue with a rest sensor too:

try adding a user agent header:
something like this:

sensor:
# Davis Weather Station main data
  - platform: rest
    name: Station Data
    resource: http://localhost:8123/local/XML_tags.xml
    json_attributes_path: "$.Davis-Weather-Tags"
    scan_interval: 60
    headers:
        User-Agent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36"
    value_template: "OK"
    json_attributes:
      - "outsideTemp"
      - "outsideHumidity"
      - "barometer"
      - "windSpeed"
      - "windDirection"
      - "windDir"
      - "windAvg10"
      - "windHigh10"
      - "dailyRain"
      - "ForecastStr"
  - platform: template
    sensors:
        outside_temp_davis:
            unique_id: davis_outside_temperature
            friendly_name: Davis Outside Temp
            value_template: "{{ state_attr('sensor.station_data', 'outsideTemp') }}"
            unit_of_measurement: "°F"
            device_class: temperature

as mentioned HERE and HERE

versed atlas
#

@unique elm I saw you commented that on github but it didn't seem like it was my issue. I restored back to 2025.6.3 because I have many dependencies on the REST data and couldn't have it broke. You'll notice in my REST resource that it is just a file on the HA server so the connection isn't too an external REST server that I thought would be dependent on the user agent(????). Is that the same you're doing?

unique elm
#

did you actually try it though?

versed atlas
#

However, I have put the user agent code in the config file and it didn't brake it in 2025.6.3

versed atlas
#

I added the user agent but no change. However, I did notice an error in the log. ```Logger: homeassistant.components.sensor
Source: helpers/entity_platform.py:382
integration: Sensor (documentation, issues)
First occurred: 10:39:50 AM (1 occurrence)
Last logged: 10:39:50 AM

Error while setting up rest platform for sensor: 'utf-8' codec can't decode byte 0xb0 in position 517: invalid start byte
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in _async_setup_platform
await asyncio.shield(awaitable)
File "/usr/src/homeassistant/homeassistant/components/rest/sensor.py", line 86, in async_setup_platform
await rest.async_update(log_errors=False)
File "/usr/src/homeassistant/homeassistant/components/rest/data.py", line 143, in async_update
self.data = await response.text(encoding=self._encoding)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/site-packages/aiohttp/client_reqrep.py", line 733, in text
return self._body.decode(encoding, errors=errors) # type: ignore[union-attr]
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 517: invalid start byte```

unique elm
versed atlas
#

This is the start of the XML file, <?xml version="1.0" encoding="ISO-8859-1" ?>

unique elm
#

try adding:
encoding: ISO-8859-1
or it might need quotes like this:
encoding: "ISO-8859-1"
I am not sure

versed atlas
#

Theur is one B0 in the xml file, <stationLatitude> 35� 14' 35" N</stationLatitude>

versed atlas