Hi All, i've got some mosquito repellant diffusers in my bedrooms which I like to switch on around 9pm and switch off at 5.30 which I used to do with old fashioned timers. I got some Tasmota and OpenBeken devices and can run them from various nodes but I chose the Bigtimer node for two of the rooms as those two are away monday to friday at college and that node allows certains days to be inactive. All seemed to be working well until we found those two diffusers empty and discovered that they were on 24/7. I am guessing that at 9pm sunday they would switch on and stay on all week only switching off again the following friday morning as the next active day in the schedule.
Anyway, long explanation over, how can I use this node to for example, switch on sunday night and switch off monday morning but not switch on monday night etc ?
Have you looked at node-red-contrib-cron-plus? I think it should be able to do that. The author is one of the core developers and is active here in case you have any problems configuring it.
My Node-red turns a Tasmota socket ON but I use the Pulsetime setting in Tasmota to turn it off automatically after the preset time.
This is much more reliable than trusting that everything is running and has a network connection at the moment Node-red is set to send OFF.
In order to handle any possible power cut during the night, I would use a relatively short Pulsetime setting, perhaps 15 minutes, and send ON every 10 minutes from 21:00 to 05:20.
I find cron-plus much nicer to use than Bigtimer.
Duck.ai tells me this needs two cron schedules:
Every 10 minutes, from 21:00 through 23:50 on Fri/Sat/Sun:
cron
*/10 21-23 * * 5,6,0
Every 10 minutes, from 00:00 through 05:20 on Fri/Sat/Sun:
cron
*/10 0-5 * * 5,6,0
Re. Bigtimer: It's just that when you uncheck certain days to make them "inactive", an overnight "on" will not become an "off" the next morning if the following day is inactive.
I have never looked into using Tasmota itself for the timer functionality, would it be possible to have certain days being inactive in the "on" sense but still active in the "off" sense from the night before's activity ?
At the risk of re-starting the "mine is better than yours" argument about ESP device firmware ...
If you can use ESPHome it has a couple of CRON-like options for timing control. The built-in on_time scheduler and an external extension esphome-dynamic-cron component for runtime-editable schedules.
Agree that local device control is best if you can use it. Of course, you may still need Node-RED control for things that might be more dynamic such as additional lighting control based on a separate light-level sensor.