When a Sonoff Pow threshold like PowerLow has been met a message tele/sonoff/POWER_LOW ON will be sent. When the error is corrected a message tele/sonoff/POWER_LOW OFF will be sent.
While most MQTT commands will result in a message in JSON format the power status feedback will always be returned like stat/sonoff/POWER ON too.
Telemetry data will be sent by prefix tele like tele/sonoff/SENSOR {“Time”:“2017-02-16T10:13:52”, “DS18B20”:{“Temperature”:20.6}}
The reason it’s not working now is it’s nested json…
Notice the {} they indicate it’s nested json {“Time”:“2018-01-25T02:16:38”,“ENERGY”:{“Total”:0.149,“Yesterday”:0.079,“Today”:0.070,“Period”:0,“Power”:22,“Factor”:0.52,“Voltage”:228,“Current”:0.183}}
Nested JSON in a response is supported as well
{
"sensor": {
"type": "air",
"id": "12345"
},
"values": {
"temp": 26.09,
"hum": 56.73,
}
}
Just use the “Square bracket notation” to get the value.
'{{ value_json["values"]["temp"] }}'
so you would need -
{{ value_json[“ENERGY”][“Yesterday”] }} for example.
2018-01-25 02:13:16 ERROR (Thread-2) [homeassistant.util.yaml] while parsing a block mapping
in “/home/homeassistant/.homeassistant/sensors.yaml”, line 31, column 5
expected , but found ‘’
in “/home/homeassistant/.homeassistant/sensors.yaml”, line 35, column 38
2018-01-25 02:13:16 ERROR (MainThread) [homeassistant.bootstrap] Error loading /home/homeassistant/.homeassistant/configuration.yaml: while parsing a block mapping
in “/home/homeassistant/.homeassistant/sensors.yaml”, line 31, column 5
expected , but found ‘’
in “/home/homeassistant/.homeassistant/sensors.yaml”, line 35, column 38