This is a collection of a small apps that might be useful to someone. They could all be done by RM4, but I find editing code easier and faster than RM4**. As such maybe someone could find one of them useful. But more so, if someone is getting started these are so simple they can hopefully understand them and build on them or edit them.
|What it does
|Turn off a switch when a contact opens, as fast as hubitat can do it. I have a gate that has an electric strike (push button to buzz to open), when the gate opens I use a contact sensor to turn off the buzzer. I'd like this to be quick since the buzzing is annoying and loud. Why not RM4? This is 2-3x faster.
|Turn on heat on a 2nd theromstat when the master turns on, turn it off when the 1st thermostat goes idle. (idle means temp is > reported temp, my thermostats don't report state changes properly) Force the 2nd thermostat off if someone turns it on after 60s. This allows someone to adjust the setpoint on the 2nd thermostat manually, but then it turns it back off.
|This is similar to simple lighting, but time+presence: Run a device between two times when at least 1 person is home. For example my partner has a humidifier for the night, this turns the switch on at 9pm and off at 7am, but only if she's home. If we're out till midnight it's off, then it turns on when we get home. If she's on a business trip then it's off.
|Monitor a power meter for a device such as a dryer or washer finishing. Has a threshold the power must exceed, and then a level it must stay under for some period. Ex: Dryer when it runs takes 600 watts, when it stops it takes 6 watts. So over 100 watts is running, under 10 watts is stopped. (it takes 16 watts with the door open and inside light on) My washer is all over the place, but when it runs it jumps over 500 watts and down to ~0 for 15s, and much higher when spinning. When it stops it blinks a light and cycles between ~0W and 0.7w. So on is over 500 watts, and off is under 1 watt for 3 minutes.
|Monitor a switch and power, and control another switch. When the switch turns on keep the controlled switch on for a period. If power rises above a threshold, keep it on for a period. Each period is configurable. How I use it. My dryer takes 6 watts sitting there doing nothing, so I want to turn it off when idle 99% of the time (that's 4.3kWh each month), but I want its on/off to be totally transparent to the household. So: 1. There's an automated laundry light above the washer that turns on due to motion, doors, etc. When the laundry light turns on, turn on the dryer for 15 minutes if someone uses it. Now the dryer is on. If the dryer power meter reports over 10 watts, someone opened the dryer door so keep it on for 30 minutes. If the dryer reports over 100 watts someone started it, so keep it on for 2 hours. After that time you can turn it off. This reacts to events happening, and always extends the time to the furthest possible time. So if the dryer shuts off and a 2nd load starts it will then get another 2 hours. I also monitor the washing machine, if the washer goes over 100 watts then turn on the dryer. This is due to a bug in the dryer, if the panel gets under 60f it won't run, but if it's powered for ~30 mins before you use it on cold days then it's ok.
|Use an http IR controller to turn on/off a device, and monitor the devices power use to make sure the IR controller did it. Try again 4 times if it fails. Why? I like devices to be reliable, and since you can't confirm a device turned on/off via IR I use a power monitoring plug to validate it did what I wanted. (I could also use the plug to turn power off/on and put the IR controlled device into a known state) Caution this uses sync http get at the moment.
|Monitor a devices energy consumptions and report each day if it ran and charged. I use it to monitor if my Roomba's ran and/or got stuck somewhere. They use about 0.03kWh each day, and they don't then they didn't It's configurable per day, so if they don't run on weekends then it won't notify you on weekends.
|Example hubitat http get driver, modded so if there's no offUri it still works.
|Watch a temperature sensor, and when it reases a "caution" limit cycle it on/off every X many minutes, when it goes above a high level then turn it off. I use this to monitor charging of a battery and keeping the levels within reason.
**) Plus I'm not sure, but if a Zwave or Zigbee device produces fast back to back events that results in concurrent executing of an RM4 rule, bad things happen. I can't debounce all devices. Maybe it's a symptom not a cause but groovy works without issue.