Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POWR320D randomly Turn Off when Energy entity is enabled in HA #1351

Open
sanketgroup opened this issue Feb 19, 2024 · 20 comments
Open

POWR320D randomly Turn Off when Energy entity is enabled in HA #1351

sanketgroup opened this issue Feb 19, 2024 · 20 comments
Labels
question Further information is requested

Comments

@sanketgroup
Copy link

Hello
POWR320D Firmware: 1.1.1
SonoffLAN: 3.6.0

If I enable the "Energy" entity of POWR320D in HA, the device is getting turned off automatically at random few minutes.

Under HA Logbook (basic), there is no command being sent to the device from HA but device it self Turn off by it self.

This issue happens only when Energy Entity is enabled.
If i turn it off, device stay on without any issue.

Surprisingly it also reset the Device's internal stored readings such as "Energy Day" and "Energy Month"

Pls help to resolve this issue.

Thanks

@AlexxIT AlexxIT added the question Further information is requested label Feb 19, 2024
@AlexxIT
Copy link
Owner

AlexxIT commented Feb 19, 2024

Why doesn't anyone read the docs? https://github.com/AlexxIT/SonoffLAN#issues
Start by downloading the device diagnostics

@sanketgroup
Copy link
Author

sanketgroup commented Feb 19, 2024

Sorry for that. I below are log files.
I Turned ON the device at 13:48:51

It got automatically Turned Off @ 13:57:35
(i updated POWR320D_debug.txt file, filtered only for specific device)

diagnostic.json
debug_log.txt
POWR320D_debug.txt

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 19, 2024

I think your device has problems with WiFi. It goes offline a lot

@sanketgroup
Copy link
Author

so, why it works well when "Energy" entity of this particular device is disabled in HA.

Also, it reset all the counters on device when it Turns Off.
Even ewelink shows 0, for "Energy Day" "Energy Month" after it randomly Turns off.
It also set "Power-on State" = OFF (even when i saved it as ON or Last State)

Same device at same place worked well for 10 days when "Energy" entity was disabled.

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 19, 2024

Try to collect 24 hours log for this device with disabled energy entity

@sanketgroup
Copy link
Author

sanketgroup commented Feb 20, 2024

I kept Energy entity disabled for more than 25 hrs.

No auto turn off and no settings on device was changed by it self.

Debug Logs attached.
Also attaching screenshot of device activity log showing last it was Turned ON yesterday before 25 hrs.
Then there is no OFF or any other activity.

Thanks
2024-02-20_17-45-52

POW_debug_long.txt

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 20, 2024

Well. Only two errors for 10 hours. Not a big deal.
Maybe very often energy requests overload your device.

@sanketgroup
Copy link
Author

but those two errors did not Turned Off the circuit nor it reset anything.

while the energy entity is Turning Off and reset the value of the device.

How should it be resolved ?

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 20, 2024

Just don't use energy entity. Probably it can't be solved from integration side

@sanketgroup
Copy link
Author

To use this power meter in Energy Dashboard of HA, device must have Energy Entity enabled.
Otherwise, it will not be shown in the Energy dashboard.

Since this is power meter, having it in Energy Dashboard is basic requirement

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 21, 2024

@sanketgroup
Copy link
Author

ok, need some more clarity.

it says
"By default energy data loads from cloud every hour. You can change interval via YAML and add history data to sensor attributes (max size - 30 days, disable - 0). For multi-channel devices use energy_1, energy_2."


sonoff:
  devices:
    1000xxxxxx:
      reporting:
        energy: [3600, 10]  # update interval (seconds), history size (days)

template:
  - sensor:
      - name: "10 days consumpion"
        unit_of_measurement: "kWh"
        state: "{{ (state_attr('sensor.sonoff_1000xxxxxx_energy', 'history') or [])|sum }}"

So lets say if i put this code into config.yaml then it will automatically pull the data every hour (3600sec) and i can use it in energy dashboard.

and
what is 10 days consumption, how does it calculate for 10days?

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 21, 2024

Also it says that you can collect energy via Hass. Using only device power sensor.

@AlexxIT
Copy link
Owner

AlexxIT commented Feb 21, 2024

Also you can try to check only cloud mode for component. And only local mode. Maybe problem with energy only via cloud/local. Your device support local energy requests. But I don't have this model for local tests.

@sanketgroup
Copy link
Author

I just tried.
Before it was LAN (local mode), so i turned off LAN mode, and same issue came again.
It Turned off the switch by itself.

@RegardtK
Copy link

@sanketgroup I have the same issue - thought it was the device, but as soon as I disabled the integration it stopped.

Log Shows: "Device Triggered"

@sanketgroup
Copy link
Author

sanketgroup commented Feb 23, 2024

I have few questions:

"Read Me" says
By default energy data loads from cloud every hour. You can change interval via YAML and add history data to sensor attributes (max size - 30 days, disable - 0). For multi-channel devices use energy_1, energy_2.

Question: Is really true that it loads from cloud every hour by default. Because my device log does not say that. It is trying to get data from cloud every few seconds rather 3600 seconds. So default does not match with actual log.
So i am confused here with interval.

It suggests one option as follow:


sonoff:
  devices:
    1000xxxxxx:
      reporting:
        energy: [3600, 10]  # update interval (seconds), history size (days)

template:
  - sensor:
      - name: "10 days consumpion"
        unit_of_measurement: "kWh"
        state: "{{ (state_attr('sensor.sonoff_1000xxxxxx_energy', 'history') or [])|sum }}"

Question2: above code utilize 'Energy' entity, so it requires me to enable Energy entity, and so it will have the same problem again (Turning Off the device), so how can i use this option?

@bn4z
Copy link

bn4z commented May 19, 2024

Same issue for me. I've removed the integration from HA since the automatic switch off was a big issue for my usage.

@georgepauna
Copy link

First, thank you very much AlexxIT!
I also have this problem, enabling energy entity makes the devices randomly turn off. Maybe it's reading this energy too often and crashing the fragile software on the device, I don't know but above comments seems to indicate that.
I also have been using many power meters from sonoff for more than a year, and when I tried enabling energy entity, 4-5 of them turned off after a few minutes. The rest would have probably done the same, but I quickly disabled them when I saw the problem.

@georgepauna
Copy link

To be clear, they are POWR320D and POWR316D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants