piotr
(Peter)
January 26, 2017, 11:08am
1
I have a general MQTT question. The device publishes this:
tele/pow1/TELEMETRY {"Time":"2017-01-01T13:50:17", "Energy":{"Yesterday":"0.234", "Today":"0.016", "Period":5, "Power":53, "Factor":"1.00", "Voltage":214, "Current":"0.247"}}
What is the correct way to define a sensor that displays for instance “Current” ?
sebk-666
(Sebastian)
January 26, 2017, 11:22am
2
Look at the examples here:
I’m not sure about the nested values, but I’d try something like:
value_template: '{{ value_json.energy.current }}'
Sebastian
piotr
(Peter)
January 26, 2017, 11:37am
3
I understand the value_template, it looks like HA doesn’t get the information from the MQTT broker. See this page: https://github.com/arendst/Sonoff-MQTT-OTA-Arduino/wiki/Sonoff-Pow
What topic should I use in my sensors.yaml ?
sebk-666
(Sebastian)
January 26, 2017, 12:01pm
4
I’m not familiar with this sensor, but it ssems there is a “legacy” message format and a “new” one?
So you should get the current by subscribing to tele/pow1/CURRENT
using the legacy format.
You’d get the JSON reply with the new format by subscribing to tele/pow1/TELEMETRY
.
Sebastian