Sonoff S60 generally works but it loses overall energy consumption
On/Off control works ok, Daily and Month energy meters are correct. Volts, Amps, Watts I did not exactly check but looks that this is correct as well.
Only thing malfunctioning is overall energy used. It keeps resetting, no idea why. I have 3 of them and on all 3 overall consumption regularly disappears (1st picture in batch of 3). Therefore when I use sensor.sonoff_1002XXXXX_energy in Energy dashboard it shows total bullshit (2nd picture in batch of 3). For example S60TPF is desk LED lamp using 9W, and in Energy dashboard daily energy consumption shows 0,88kWh, while the true one is 0,04. All other readings are ok (3rd picture in batch of 3) and they match ewelink readings (last picture). Let me know if I can assist somehow by sending some more logs or sharing device to Your account.
Energy should have history for last 30 days. Check attributes of your sensor https://github.com/AlexxIT/SonoffLAN?tab=readme-ov-file#sonoff-pow
I don't think this is matter of history settings. I don't set them at all and I have 20+ sonoff devices (mostly POW) and they all work well. Definitely something is wrong on HA side with calculating actual power to energy usage. I bought another S60 and added it to HA to double check it.
Daily/monthly usage from app is correct (I verified that with independent power meter):
Those 2 attrubites are passed to HA correctly and visible there:
However actual power usage readings are somehow incorrect, and when I link it with power meter entity by this:
- platform: integration
name: energy_spent_S60chlod
source: sensor.sonoff_100223XXXX_power
unit_prefix: k
round: 2
This is what I see in Energy dashboard after adding sensor.energy_spent_S60chlod there:
All needed entities like - sensor.sonoff_100223XXXX_power - sensor.energy_spent_S60chlod are of course added to recorder in configuration.yaml
The component just requests data from the cloud. I've never seen this data. I don't have any of these devices.
Hi!
I am also having problems in Energy dashboard when adding S60 devices.
Data in Individual devices usage is not shown correctly as seen on next two screenshots.
I shows negative Energy when it should be positive. I think there is problem with data timestamp.
Any ideas?
I'm having the same issue, maybe it's because Energy dashboard treats them as incremental not daily?
In my case, in the db data looks ok:
But when put in the energy tab:
I can confirm the issue, I have 2xS60TPF and they both do the same.
Another problem I found is that I cannot add the power consumption to the "Energy Tab", despite both devices working correctly.
I guess there's some configuration error on the addon side, both plugs are working perfectly.
Problem with wrong metering I solved with adding method: left to the configuration:
- platform: integration
name: energy_spent_jacuzzi
source: sensor.sonoff_XYZ_power
unit_prefix: k
round: 2
method: left
as per: https://www.home-assistant.io/integrations/integration/#integration-method
Devices I use S60TPF with are not having constant usage, so this metering method is better suited. Now readings in HA match readings in Ewelink. They are being also correctly transformed into daily usage in Energy tab once I registered energy_spent_jacuzzi there.
If someone doesn't need current usage and simply want to have daily readings from device transfered to Energy tab, then the easiest thing to achieve that is to modify S60TPF's _energy_month entity in customize.yaml. You need to set it as total_increasing:
sensor.sonoff_ABC_energy_month:
device_class: energy
unit_of_measurement: kWh
friendly_name: "Device"
state_class: total_increasing
Where exactly did you find customize.yaml? I'm having the same problems and I really only need the energy consumption te be correct for my use case, so i'd like to implement the fix you found.
Thanks in advance!
Where exactly did you find customize.yaml? I'm having the same problems and I really only need the energy consumption te be correct for my use case, so i'd like to implement the fix you found.
Thanks in advance!
I have it in root directory, next to config.yaml. It is included in that config like this:
homeassistant:
customize: !include customize.yaml
I think You can also put that code directly to config.yaml but not sure.
I have the same issue with the S60 plugs and large negative consumption in the 0:00 time bucket. Any ideas what's causing this or how to resolve or work around it? Was considering creating an Integral on the current power value and seeing if that does the same, I suspect it won't from looking at the data.
Problem with wrong metering I solved with adding method: left to the configuration:
- platform: integration name: energy_spent_jacuzzi source: sensor.sonoff_XYZ_power unit_prefix: k round: 2 method: leftas per: https://www.home-assistant.io/integrations/integration/#integration-method
Devices I use S60TPF with are not having constant usage, so this metering method is better suited. Now readings in HA match readings in Ewelink. They are being also correctly transformed into daily usage in Energy tab once I registered energy_spent_jacuzzi there.
If someone doesn't need current usage and simply want to have daily readings from device transfered to Energy tab, then the easiest thing to achieve that is to modify S60TPF's _energy_month entity in customize.yaml. You need to set it as total_increasing:
sensor.sonoff_ABC_energy_month: device_class: energy unit_of_measurement: kWh friendly_name: "Device" state_class: total_increasing
@guciopl Thanks for these work arounds, both seem to work great.
For others that have not got this working yet, I would just add that you can now do the 1st work around direct in the UI without having to use config files. Just add a new Helper, select "Integral" give it a name, use the original power sensor as the input. Set Metric prefix to "k", Time unit "Hours", Method "left", Precision "2" and submit. Then add the newly created sensor to the energy dashboard. Simples! :-)
any news on this? I know that i cant do integral "trick" but since there is an entity for the required data (energy) it should be used.
It seems that the energy reading gets zeroed every hour:
I confirm in April 2025 the same behaviour. Any chance to get it fixed?
I confirm in April 2025 the same behaviour. Any chance to get it fixed?
It should work fine if you follow the steps above. 😁
Yes, the workaround should work. I'm trying it, thank you