Hi...need some help. Installed an mqtt sensor Tasmota on D1 mini. Seems to transmit the status into Hassio. State shows {"Time":"2017-09-28T18:15:50", "DS18x20":{"DS1":{"Type":"DS18B20", "Address":"28FFDAE770170468", "Temperature":26.7}, "DS2":{"Type":"DS18B20", "Address":"28FFCEBA7017044E", "Temperature":27.9}}, "TempUnit":"C"}. What should I put into config.yaml to extract the temp values?
Can't get it working
value_template: "{{ value_json.DS18x20.DS1.Temperature }}"
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Just in case you're like me and want to extract value by sensor address, e.g.:
value_template: "{% for key, value in value_json.DS18x20.items() if value.Address == "28FFDAE770170468" %} {{ value.Temperature }} {% endfor %}"
thx Piotr
2018-04-26 20:58 GMT+02:00 Piotr Oleszczyk notifications@github.com:
Just in case you're like me and want to extract value by sensor address,
e.g.:value_template: "{% for key, value in value_json.DS18x20.items() if
value.Address == "28FFDAE770170468" %} {{ value.Temperature }} {% endfor %}"—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/arendst/Sonoff-Tasmota/issues/1009#issuecomment-384753916,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AfMGBEQN9hgyM9turgR8etj87LeRFcopks5tshjDgaJpZM4P1Qq4
.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue will be auto-closed because there hasn't been any activity for a few months. Feel free to open a new one if you still experience this problem.
Just in case you're like me and want to extract value by sensor address, e.g.:
value_template: "{% for key, value in value_json.DS18x20.items() if value.Address == "28FFDAE770170468" %} {{ value.Temperature }} {% endfor %}"
Hi, I have an error when I use your code, my config,
sensor hexid4:
platform: mqtt
name: "00000B10C80F Temperature"
state_topic: "tele/pbaja1/SENSOR"
unit_of_measurement: "°C"
value_template: "{% for key, value in value_json.DS18B20.items() if value.Address == "00000B10C80F" %} {{ value.Temperature }} {% endfor %}"
payload_available: "Online"
payload_not_available: "Offline"
and the error,
can not read a block mapping entry; a multiline key may not be an implicit key
Please, could you help me. Thanks
Most helpful comment
value_template: "{{ value_json.DS18x20.DS1.Temperature }}"