[RELEASE] A Small Collection of Little Possibly Useful Apps


Why Share:

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.


App What it does
when_on_then_off.groovy 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.
slave_thermostat.groovy 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.
schedule_on_off_presence.groovy 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.
power_done_monitor.groovy 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.
keep_on_when.groovy 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.
ir_on_off_validate.groovy 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.
did_it_charge.groovy 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.
http_get_moded_driver.groovy Example hubitat http get driver, modded so if there's no offUri it still works.
temp_limiter.groovy 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.



Thank you for these! They're very useful.

1 Like

Cheers man.
Who knows, maybe like you said, having these might prompt me to try coding solutions.

1 Like

This IS handy - thanks for sharing. May get me to try my hand at groovy this time around.

@2ac16mo, @njanda that's awesome! Once I started to wrap my head around the hubitat API, and the super clear smartthings docs I found it pretty easy. Hopefully this gives you some samples to work from.

I found the preferences section the most daunting to start with, but there's a whole bunch of different options you cut & paste from in these little apps.

1 Like

Some updates to the apps.:

  1. IR controller now uses asynchttp to avoid potential blocking issues

  2. Made the slave thermostat smarter, only fall back to temp/time if the main thermostat is stuck in pending heat.

  3. Added a new app, Charge Temp Limiter. Turn a switch on/off at an interval if a temp gets into a caution level, and then off fully over a limit. See pic for how well this works for me. I cycle on/off at 15 minute intervals, not meant to run in seconds.

1 Like

I try to install the schedule on off presence and get this error?


Hmmm, shucks. That's not info to help, if you go to Logs->Past Logs then it should give you more info and I can give you a hand.

2020-01-24 09:03:19.405 pm error java.text.ParseException: Unparseable date: "null" on line 91 (mainPage)

@leeonestop Ah sorry guys, get the current version from github, it's what I'm running and fixes "app crash when no settings exists" which I think is what you're reporting. :slight_smile:

Yes it does. :slight_smile:

1 Like

A small request... for the "power done monitor", can you add text to speech? I know i can get around it with virtual switch and such but I rather have it all in one :slight_smile:

Thanks for the apps btw..

1 Like

Thanks it working good. Thanks you for the app.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.