Newbie here, hopefully posted in the correct forum.
PROBLEM: I'd like to cycle my pool pump 2 hours on 1 hour off 7 days a week.
What is the best KISS solution? On/Off triggers x 7 days seems ungainly in Basic Rules. I'm using a ZEN17 wired to the control circuit of the pool pump's motor starter.
I could run it for a continuous period with a long off but the pump sometimes loses it's prime and may run dry if left off for a few hours.
Any ideas where to start? I'm a licensed electrical contractor but not an automation programmer.
I tested this rule inside for a few days with some LED Lts. and it seemed to work fine. Hooked it up to the Pool Pump starter and it seemed to work OK but it randomly stops cycling. I don't see anything in the logs that gives me a clue what's going on.
I can stop the pump manually. Stop the "Pool Pump beta" rule. Restart the rule and manually start the pump and it will cycle a seemingly random number of times. There are no other rules starting or stopping the pump.
Here's the log from the relay.
The rule looks good to me, Maybe a communication issue with the device turning the pool pump on and off. I have an exhaust fan in my crawlspace controlled by a Aeotec smartplug and I have a similar rule controlling it. For whatever reason it will sometimes not receive the on or off command. So I added a loop after each command to verify the device actually turns off or on. In my case I look at the power level, if it doesn't change as expected I send the command again, usually works first time but sometimes it won't shut off until a second command is sent. I also added a routine to monitor if it stays off for an extended period.
Thanks for the reply. I'm using a Zooz Zen 17 Relay and it's only about 25' from the hub but that's what I'm thinking, it's just not getting the command. I don't have a good way to monitor the power level but I could monitor a contact on the relay or motor starter. Could you share your code for adding the loop and making sure it's running and resending the command?
My programming skill level is rudimentary at best.
After thinking about this, I'm pretty sure it's a communication issue. I put the relay inside the metal motor starter enclosure and it seems the "off" command always fails. I wonder if there is a way to add an external antennae.
I think that has fixed my issue, seems to be cycling correctly now.
On another note, do you know a way to monitor or report the current state of a relay? I would like to close my garage door automatically if its open at 9pm but I haven't figured a way to monitor the tilt sensor. Here's my thread
Works OK if the Garage Door opens between the desired expression time but if the Garage door is open at 6:00pm then nothing happens at 6:21. I keep hearing that Hubitat is event driven, ie the contact needs to change state between the times but there's got to be a simple way to poll the switch and cause an "event"
I'm sitting here at work thinking about RM when I should be doing something else.
If I deleted the required expression so the rule is triggered anytime the garage door is opened could I change the first OR statement to AND "When time is 9:15" Would this send the notifications only after 9:15?
Anytime the rule is triggered it sends notifications as long as the GDO is open.
The trigger determines when it runs. The required expression sets when a rule can trigger.
If you changed the OR to AND, then it would only trigger if the GDO had been open for the required time and it happens at 9:15. So you will probably never trigger the rule.
In my original rule it can only trigger from 30 minutes before sunset till sunrise. So if the door opens outside of that required expression time nothing happens. The rule can not trigger.
If for example, I opened the door at 3:00PM and left the door open and never closed it, then at sunset the rule gets triggered. It does not trigger because the door opened but because the trigger time of sunset occurred. It will trigger at sunset if the door is open or closed. If it is open it will start sending my notifications, if it is closed it does nothing. The GDO is closed so the while loop is false and the rule is exited.
The other trigger, systemstart, will occur anytime the hub is restarted. Again this trigger has nothing to do with the door, it is just a outlier case than could occur. If in my example above opening the door before sunset and leaving it open. If the hub for whatever reason was shutdown and not turned back on until after sunset I would get no notification the door was open. The door is already open and it is past sunset so neither of those two triggers can occur. The restart, however, will trigger the rule and if the door is open it will start sending notifications.