I have a hot water recirculating pump that I was earlier operating using smart-life scenes. The routine failed if there was an internet outage at any triggers. I also did not want the pump to needlessly run 24/7. So, I converted it to OpenBeken. It was easy to open and see the marking on the chip. It wasn't glued. Used tuya-cloudcutter on this device and then wrote this autoexec.bat for it to work autonomously. More refinements with DST implementation and MQTT and HA are in my bucket list. Let me know if there are any suggestions to improve this:
AI: Could you share the exact brand and model of your hot water recirculating pump or the Tuya-based device you converted to OpenBeken?
1. Watts Hot Water Recirculation 120V Pump (0955800)
2. 10A KR2201WB Wi-Fi Wireless Smart Basic Switch for Smart Home Smart Life APP Compatible with Alexa & Google Home Assistant No Hub Required
AI: Are there any specific issues or limitations you've noticed with your current script, or are you mainly looking for general suggestions and best practices?
I am using a manually changeable channel 11 for Daylight adjustments. I wish there was a way to compute and change to daylights automatically based on the NTP data. Or if there was an easy IF Endif combo that would allow me to to change DST time without any manual interventions.
// Section 1: Do nothing until wifi connection because NTP is critical for this
waitFor WiFiState 4
// Section 2: Start the drivers
startDriver ntp
startDriver SSDP
// Section 3: NTP Time Synchronization and wait for it
ntp_enable 1
ntp_server 192.168.116.1
ntp_setLatlong 38.42828026695736 -122.58794605216814
setChannel 11 -7
ntp_timeZoneOfs $CH11
waitFor NTPState 1
// Section 4: Periodic time synchronization
addClockEvent 05:00 0xff 1 ntp_enable 1
addClockEvent 21:00 0xff 1 ntp_enable 1
// Section 5: This routine is effective only during 6:00 am and 10:00 pm
addClockEvent 06:00 0xff 1 setChannel 10 1
addClockEvent 22:00 0xff 1 setChannel 10 0
// Section 6: Start the pump first time at 5:31 am
addClockEvent 05:31 0xff 1 setChannel 1 1
// Section 7: If this was rebooted after 5:31 am and before 10:00 pm then above section 6 won't execute
if $hour>=5 && $hour<22 then
setChannel 10 1
endif
// Section 8: If the pump turns on, manually or by system, turn it off after 3 min & 10 seconds (200 seconds)
addChangeHandler "Channel1" == 1 backlog cancelRepeatingEvent 456; addRepeatingEventID 200 1 789 setChannel 1 0
// Section 9: If the pump turns off, manually or by system, Wait for 30 minutes (1800 secs) and turn it on (Only during 5am-10pm)
addChangeHandler "Channel1" == 0 backlog cancelRepeatingEvent 789; if $CH10==1 then addRepeatingEventID 1800 1 456 setChannel 1 1 endif
// Section 10: Enable powersave mode
PowerSave 1
//

AI: Could you share the exact brand and model of your hot water recirculating pump or the Tuya-based device you converted to OpenBeken?
1. Watts Hot Water Recirculation 120V Pump (0955800)
2. 10A KR2201WB Wi-Fi Wireless Smart Basic Switch for Smart Home Smart Life APP Compatible with Alexa & Google Home Assistant No Hub Required
AI: Are there any specific issues or limitations you've noticed with your current script, or are you mainly looking for general suggestions and best practices?
I am using a manually changeable channel 11 for Daylight adjustments. I wish there was a way to compute and change to daylights automatically based on the NTP data. Or if there was an easy IF Endif combo that would allow me to to change DST time without any manual interventions.