openshwprojects / OpenBK7231T_App

Open source firmware (Tasmota/Esphome replacement) for BK7231T, BK7231N, BL2028N, T34, XR809, W800/W801, W600/W601 and BL602
https://openbekeniot.github.io/webapp/devicesList.html
1.37k stars 230 forks source link

PowerSave command - i really need feedback from You guys #678

Open openshwprojects opened 1 year ago

openshwprojects commented 1 year ago

Thanks to the @btsimonh hard work, we have added a PowerSave command some time ago.

This enables lower power mode on T and N, and it seems to work well, as long as you don't have the Web App console log open (it does HTTP request every 2 seconds or so and breaks the sleep).

Apart from that, the device seem to work 100% normal with PowerSave on, there is no noticeable extra MQTT lag, no input lag, etc. It's not a deep sleep!

My question is - should we enable PowerSave by default?

There are some devices with weak power supplies that can get premature death of caps by too high power usage: https://www.elektroda.pl/rtvforum/topic3898805.html

Can anyone reading (and willing to do some testing and take some potential risks) put PowerSave in short startup command and/or autoexec.bat and tell me if device still behaves well?

avassdal commented 1 year ago

I can do some testing if needed

openshwprojects commented 1 year ago

just put PowerSave in short startup command or autoexec and reboot and tell me if it still works okay.

Check if device works with HA, if it's stable, if it reacts to WWW panel, etc etc etc. Does it keep connection with wifi in long term, is it still useable

lungucosmin02 commented 1 year ago

I've enabled it on Nous Smart WiFi Bulb P8 RGBCW - version 1.15.460 BK7231N chipset. There's no signs of noticeable slowdown as of now. The lightbulb performs operations as the other ones that do not have the feature enabled. Also works fine with Home Assistant 2023.2.2. Will see how this works in the long run.

openshwprojects commented 1 year ago

If working, this command could even reduce your electricity bills.

valekCN commented 1 year ago

After using following autoexec.bat

addClockEvent 17:30:00 0xff 1 ToggleChannel 0
addClockEvent 17:35:00 0xff 2 ToggleChannel 0
PowerSave 1

Device was no longer accessible by WebGUI. I had to restart it into SAFE. WebApp was not working in safe mode. Command 'lfs_remove autoexec.bat' was not working also LFS not initialized under SAFE mode ????? Finally adding ;lfs_remove autoexec.bat; to startup command killed autoexec.bat

I try it again without powersave.

openshwprojects commented 1 year ago

While I don't think that PowerSave can be that bad, I still think you have very good point with LFS.

It seems that lfs_format command should be also available in unsafe mode, so we can clear littlefs scripts in case of emergency.

Or maybe Main_ForceUnsafeInit should skip autoexec execution... so we can edit it in case of emergency.

openshwprojects commented 1 year ago

I think I can move "LFSAddCmds" from Unsafe init to safe init....

valekCN commented 1 year ago

My BK7231N is completely frozen after PowerSave 1; This time I executed it from webgui command. LOG is dead. (I know that active log is against power saving) Web gui is dead. WebApp is also dead. Button is not working also. Device is frozen.

I am using it on DINRAIL power meter. Probably not the ideal device. I change it to device which has wired UART log. To see it exactly.

openshwprojects commented 1 year ago

Hmm my N devices seems to work with PowerSave: image so the question would be where is the difference.....

valekCN commented 1 year ago

I have running: image Probably need to kill all drivers and start from scratch. EDIT: A lot of periodic functions.

cplagz commented 1 year ago

12 hours uptime no issues yet

biggoof1 commented 1 year ago

BL602 - Power save enabled. Up to now (20 minutes) everything seems to be normal. Will post, if something seems to be weird.

openshwprojects commented 1 year ago

As said in first post - it's for T and N, not BL602, but... you gave me an idea, maybe it's possible also on BL602? I will update PowerSave to do something on BL602, wait, but don't try it yet.

biggoof1 commented 1 year ago

Sorry.. Did not map T and N to the model ;-) But at least it did not disturb anything on the BL602 ;-)

openshwprojects commented 1 year ago

Yea, it seems it should be possible on BL602... thanks to your comment, of course! @biggoof1 I didn't check that earlier. https://github.com/openshwprojects/OpenBK7231T_App/commit/4eff71a4ae8f409264a4ab4196ade613dd16c2ab let me try...

lungucosmin02 commented 1 year ago

I've enabled it on Nous Smart WiFi Bulb P8 RGBCW - version 1.15.460 BK7231N chipset.

There's no signs of noticeable slowdown as of now. The lightbulb performs operations as the other ones that do not have the feature enabled.

Also works fine with Home Assistant 2023.2.2. Will see how this works in the long run.

I’ve discovered an issue with the device on which I have PowerSave enabled.. I don’t know if it’s expected behaviour or not but it tends to retain power for a second or two longer than the one that does not have the feature active. For example when cutting power to them, the one that has PowerSave enabled turns off a bit slower than the other one.

Can you tell me if this is the way this feature should work?

biggoof1 commented 1 year ago

Hi,

updated to 1.15.476 as I understood that PowerSave for 602 has been enabled?

PowerSave 1 executed as Command and it states, that is has been set to 1.

Can I check somehow that it is really in PowerSave mode? For now (just a few tests) BL602 seems to behave as usual.