@kslb wrote:
Hi,
I need help with configuring sensor which receive data from MQTT.
So, when I listen to MQTT broker:
I get data like this:
Sporočilo 0 prejeto v OilFox ob 8:32: { ... "devices": [ { ... "measurementIntervalInSeconds": 86400, "metering": { "value": 12, "fillingPercentage": 95, "liters": 1803, "currentOilHeight": 134, "serverDate": 1589813339698, "battery": 100 }, ... } } ] }
So how to configure sensor that I read specific data (in my case “liters”) which need be readed as integer type…
- platform: mqtt name: "Trenutni nivo olja" state_topic: "OilFox" value_template: '{{ value_json.devices[0].metering[0].liters | int }}' icon: mdi:hydraulic-oil-level unit_of_measurement: L
THANK YOU for help…
Posts: 1
Participants: 1