Hello, I have sonoff pow R2 switch. I configured it in the home assistant configuration.yaml:
switch:
- platform: mqtt
name: Boiler
command_topic: "cmnd/sonoff/power"
state_topic: "stat/sonoff/POWER"
qos: 1
payload_on: "ON"
payload_off: "OFF"
retain: true
Today I wanted to monitor the power, current and voltage of the Switch in the home assistant so I added this to the configuration.yaml in the sensor section:
sensor:
- platform: mqtt
name: "Boiler Current"
state_topic: "tele/sonoff/SENSOR"
value_template: "{{ value_json['ENERGY'].Current }}"
unit_of_measurement: 'A'
- platform: mqtt
name: "Boiler Power"
state_topic: "tele/sonoff/SENSOR"
value_template: "{{ value_json['ENERGY'].Power }}"
unit_of_measurement: 'W'
- platform: mqtt
name: "Boiler Voltage"
state_topic: "tele/sonoff/SENSOR"
value_template: "{{ value_json['ENERGY'].Voltage }}"
unit_of_measurement: 'V'
I restated the home assistant and turned on the switch and It turend on I checked that the boiler is working. I waited a few minutes and it show me everthing is 0 in the sensors and doesn’t change. I entered to the web interface of the switch and also there it shows 0 in all the parameters of the sensor.
What is the problem?