Can anyone help. I have a sensor in my config.yaml file that parses the device’s JSON out string for the value I want. Unfortunately it only appears briefly, then disappears. You can only then see it for a second every time you send a refresh command topic to the device Is there any way to retain this parsed topic on screen. It is a static value for the most part (software build version)
Yes its an MQTT sensor. Perfect thank you that worked ike a charm!! One other thing how can you change a numerical value returned from a parsed MQTT JSONout string into text? So for example a value of “0” is then displayed as “Off”
value_template: "{{ 'Off' if value_json == 0 else 'On' }}"
For a binary sensor the template has to resolve to true or false for the states on or off:
value_template: "{{ value_json != 0 }}"
You can then have the frontend “translate” these on/off states into other displayed strings using a device class. The state however still remains as on or off. Even the case without a defined device class is translated in the frontend to ‘On’ or ‘Off’ (capitalised).