Ewelink device attributes stop reporting after short time

I have some chinese eWeLink circuit breakers which also have power metering.
They are EARU kind: 1P Din Rail WIFI Smart Energy Meter Power Consumption kWh Meter Circuit Breaker Time Timer Switch Relay Voltmeter for Smart Home|Circuit Breakers| - AliExpress
The power meter function doesn’t present as sensors directly, they are attributes on the switch.
In order to make the attributes into sensors, I need to do something like this in configuration.yaml:

sensor:
  - platform: template
    sensors:
      10013bc192_voltage:
        friendly_name: 'Circuit voltage'
        device_class: voltage
        unit_of_measurement: 'V'
        value_template: "{{ float(state_attr('switch.10013bc192', 'voltage')[0:-2]) }}"
      10013bc192_current:
        friendly_name: 'Circuit current'
        device_class: current
        unit_of_measurement: 'A'
        value_template: "{{ float(state_attr('switch.10013bc192', 'current')[0:-2]) }}"
      10013bc192_power:
        friendly_name: 'Circuit power'
        device_class: power
        unit_of_measurement: 'W'
        value_template: "{{ float(state_attr('switch.10013bc192', 'power')[0:-2]) }}"

the [0:-2] bit is because the sensor reports as a string with a unit suffix; ie, “1500 W”. I strip the unit and cast to a number. With this code these sensors appear to be reporting correctly.

That said, there is a problem. The sensors (from the attributes) update properly every second or so for a little while after I refresh the device in the “eWeLink Smart Home” configuration panel, but after a short time, the device stops updating that data and the value freezes. If I click the refresh button on the device, it starts updating again every second for some time before stopping again.

What is causing it to stop like this? Is there a way I can make sure it keeps updating forever?

I tried doing something similar with a Sonoff S31 WiFi switch that I added into HA with the eWeLink Add-on. I was pulling the wattage attribute directly with Node Red but also noticed that it would continue to report the same wattage and amp draw unless I refreshed the view. I think the issue is with the status reporting from the eWeLink Cloud. You might want to try enabling or disabling LAN Control in the phone app to see if that makes any difference. You can enable/disable LAN Control, but I don’t see any option to disable Cloud control, so one option might be to block the device (IP) from accessing the internet and see if LAN Control only improves the refresh rate.

For my use case I was only trying to turn it off when the power dropped below 5 watts, so I ended up removing the automation and just setting the “OPS - Min Power” option in the iPhone app to turn it off automatically.

I have the same problem. Note to self: never buy eWelink connected devices!

I have the same breakers and have created a similar template sensor for monitoring energy usage. My sensor also stops updating. What I noticed is that when you open the Ewelink app and view the device there, the HA sensor starts updating again for some time. Would love to solve this if someone know how…

I bought the EARO breaker wi-fi and the Current, Voltage, Power, SSI all entities show up on separately in Home Assistant latest update. But I have problem with refresh the values on the HA. I am not able to get refresh every minutes even I add the force update on configuration file for every 1 minutes. The switch does when you trigger it changed back in 2 second to original status. I have submit problem to ewelink. It also happen on their ewelink web site not refreshing the power monitoring values. I have several TUYA wi-fi and it works great and refresh every seconds for the same type of devices.