I couldn’t find the error.
in mqtt the topic name is:
1-Wire-Gateway/Bus 2/Sensor 2
(I can’t customize it)
The MQTT-source is the following device called “WLAN /LAN Gateway Modbus TCP/IP für 1-Wire Temperatur Sensoren” (https://hoelldobler.net/Gateway/)
It worked formerly in another HomeAutomation-Software (FHEM) - So I think it’s either a non valid configuration in HomeAssistant by me or an error in the module. Maybe the spaces-character in the topic are not supported. But I can’t customize it, so I have to make it work with the spaces.
Hi Bernd - welcome to the Home Assistant forums. In order for people to help you with your issue, can you edit your post so the yaml is inside preformatted text tags? These are accessed by clicking on the </> symbol in the toolbar when editing. You’ll end up with text formatted like this:
Formatted:
- text
in here :)
Also please post the json data for your sensor from MQTT Explorer - again inside the correct tags. Since yaml is position sensitive it just assists people in reading and checking.
Change the following line in the MQTT Sensor’s configuration:
value_template: "{{value_json.temperature}}"
to this:
value_template: "{{ value[:-3] }}"
According to the screenshot of MQTT Explorer, the payload published to the topic 1-Wire-Gateway/Bus 2/Sensor 2 is not in JSON format. The payload is merely a string like this:
25.50 °C
What you want is just the numeric part of the value (25.50) so that’s why I suggest you use:
{{ value[:-3] }}
because it slices off the payload’s last 3 characters.