Reading power consumption from a MyStrom smart plug

Well, it seems that there will be no update for this. Se here: Deprecate current_power_w and today_energy_kwh switch properties and here Deprecate Switch entity properties

It was on purpose to separate the Power Consumption from the Switch. From now on, the Power Consumption will not be a property of the switch anymore; you will have to define it as a sensor.

This is how I have defined it:

sensor:
  - platform: rest
    name: "Washing machine power consumption"
    resource: http://172.16.0.52/report
    method: GET
    unit_of_measurement: W
    device_class: energy
    state_class: measurement
    value_template: "{{ value_json.power }}"
    scan_interval: 10

Unfortunately this is not so reliable when if your wifi network is unstable. From time to time it will result in failed reading because timeout or other network related reasons, an that can cause automation re-trigger because of a change in value.

Example:
you have value 0 → you have a timeout(value undefined) → a good reading again with value 0. Since the value is “0” again, the automation will re-trigger if that’s your trigger. Having 0.1 instead 0 as trigger value will not help either.

I would like to see the mystrom integration for switch sensors as they did it when the power was a switch property… that was more reliable than the Rest sensor