Athom Smart Plug V2 current accuracy

Hi

I have introduced a new Athom Smart Plug V2 with a table lamp plugged in. The lamp has a 3.5W LED bulb and I’m trying to determine when the lamp is on and when it is off.

The plug is connected to HA, however I see no change on the Current or Power values when the lamp is on or off, it continues to report 0.00000:

‘Living Room Lamp Current’: Sending state 0.00000 A with 2 decimals of accuracy
‘Living Room Lamp Power’: Sending state 0.00000 W with 1 decimals of accuracy

I would expect the current to read around (3.5/240) = 0.0145 A and the power to read around 3.5 W while the lamp is on. [UK, so 240V]

Any pointers as to how to address? Is this a config issue?

Thanks

Does it work when you plug it in to something with higher power?

Could relate to these lower bounds?

I was under the impression that most of these plugs can’t measure low power. Shooting from the hip I remember 5 or 6 watts as minimum

It does register with higher powered devices.

That’s a bummer if there’s a lower limit.

Try with a lower bound:

            - lambda: if (x < 1.0) return 0.0; else return x;    #For the chip will report less than 3w power when no load is connected

It might just work.

Bit of a newbie when it comes to ESPHome I’m afraid - how would I do this?

The device currently has this config:

substitutions:
  name: living-room-lamp
  friendly_name: Living Room Lamp
packages:
  athom.smart-plug-v2: github://athom-tech/athom-configs/athom-smart-plug-v2.yaml
esphome:
  name: ${name}
  name_add_mac_suffix: false
api:
  encryption:
    key: XXXXXXXXXXXXXXXXXXXXXXX

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

Thanks

Under the sensor portion of the YAML (which you didn’t paste), edit the lambda to read like I pasted above. Then compile and install the changes onto the Athom.

Your YAML should look like what’s on this page:

OK, but FYI - what I pasted was the full extent of the yaml in ESPHome for the plug, there is nothing else to edit.

Are you saying I need to copy and paste the rest of the stuff in the github page you linked to?

UPDATE:
Did copy the full yaml from that github page into ESPHome for the plug, edited as required and hey presto, seems to be working now. I get power and current with the figures reduced.

Thanks @RonnieLast for the signpost.

3 Likes

To correct my slur on accuracy; what are you getting for the 3.5w LED?

The default Athom config points at their remote config on GitHub so that they can make firmware changes and you get the updates. So the default config doesn’t have much in there, it mostly links to another source.

To customise and take control of the config, I usually do exactly what you did. Copy/paste it locally. I think there’s other ways to just merge in and override parts though.

A common thing I implement is “auto off after x time”. My exhaust fan, hot glue gun, coffee machine, some dumb lights.

It’s reporting between 1.3 and 1.6 W for the 3.5W LED.

1 Like

And goes to 0W when the bulb is off, right?

Yes, 0 when off

1 Like

There is BL0937 energy meter chip in the plug. The datasheet specification says RMS current measurement accuracy is 0.3% typical. The input range of the current measurement sigma-delta ADC is ±50mV peak. 0.3% of it is 150uV that is very low voltage and it would need exra care to garantee this in the crammed room inside the plug.
If the maximum current is 16A, 0.3% presents 48mA, it ishard to expect better accuracy.