QuailAutomation / openhab2-addons

The next-generation open Home Automation Bus (openHAB)
Eclipse Public License 2.0
8 stars 7 forks source link

Support Unit/Output/Flag timers. #75

Open boc-tothefuture opened 7 years ago

boc-tothefuture commented 7 years ago

Presently we don't (at least that I see) have support for turning and omni unit type (flag, output, light, etc) on/off for a duration. This is supported by the API for omni - but not represented in the binding.

There are some advantages to using this method (in certain cases) vs. just using timers in openhab.

The API is a bit weird (go figure), so its unclear to me what the channel definition should look like. Hoping for @craigham and @digitaldan to weigh in here with some thoughts. You can set a unit on or off for a duration of time. That duration can be 1 to 99 seconds OR 1 to 99 minutes OR 1 to 18 hours

Because each type of duration has its own min and max, I am thinking we need to make distinct channels types for each? Then for each unit/flag/output have 6 new channels? on_for_seconds on_for_minutes on_for_hours off_for_seconds off_for_minutes off_for_hours

I am not a channel design expert.. So I eagerly await better solutions.

digitaldan commented 7 years ago

I'm not sure there is a better way. The APi as you say is weird :-)

craigham commented 7 years ago

@boc-tothefuture those channels are what I was thinking as I was reading your comments. Seems like a reasonable starting point.