Hello everyone,
So far 3 months in I’ve been able to set up my HA by myself but now I’m running into some issues that I’m unable to figure out. No amount of reading can help me as I’m too much of a noob I guess.
So I get this sensor information from my recently installed powr2.
07:49:07 MQT: tele/powr2/SENSOR = {"Time":"2019-05-12T07:49:07","ENERGY":{"TotalStartTime":"2019-05-04T10:35:46","Total":4.556,"Yesterday":0.260,"Today":0.070,"Power":18,"ApparentPower":130,"ReactivePower":129,"Factor":0.14,"Voltage":238,"Current":0.546}}
And I wanna define an on state for my switch:
switch:
- platform: mqtt
name: "Kachel"
command_topic: "cmnd/kachel1/POWER"
state_topic: "tele/powr2/SENSOR"
# value_template: >-
# {% if { value_json['ENERGY'].Power }, > 10 ) %}}
# on
# {% else %}
# off
# {% endif %}
qos: 1
payload_on: "ON"
payload_off: "ON"
And it’s not really working out. I’ve tried to look up in multiple topics how to go about doing this and this code is just one of many I’ve tried. I try my value template under DEV > templates and it always comes back as undefined no matter what I do.
I really could use some assistance.