chickenandpork / hass-osbee

Simple integration for OpenSprinkler Bee (OSBee) irrigation controller in Home Assistant
MIT License
0 stars 0 forks source link

Feature Requests: control OSBee programs from ha-osbee #24

Open gitwob101 opened 3 weeks ago

gitwob101 commented 3 weeks ago

I would like to be able to control programs from within Home Assistant. In my setup I have switches that run for a short time only because they feed water to containers. For example, a 20 minute timeout is way too long and will flood these containers. I am typically enabling this switch for 15-60 seconds, and maybe several times with a delay of something like 5-10 minutes. On another switch I am using drip tape which needs to run for much longer than the default max of 20 minutes. I run for 19 minutes x 6 for 2 hrs.

It would be useful to be able to enable/disable or run existing programs in OSBee from HA. The intention is to achieve a manual rain delay by interacting with a button/etc. in HA. This can also form the basis of having HA, if detected rain (by means unrelated to OSBee), then automatic disable OSBee programs via HA, or vice versa if clear skies.

The reason to have HA control programs as opposed to programming OSBee and performing all actions from HA is that I relying on OSbee, and embedded control, seems more reliable when away from the physical location for some time (a week). There are any number of reasons as to why access to HA could be lost (dynamic IP changes, VPN issues, HA issues, failed wifi network, etc.) but the OSBee device will continue to do its thing on schedule. If there are technical issues, all things being equal, water plants during rainy period is prefer to no water at all during a dry period. Rain delay with HA, or even manual intervention is preferable, but things happen.

Also not that since I am managing OSBee switches with programs that are being re-run in succession, disable ha-osbee switches is only an intermittent change as OSBee turns them back on with the next program iteration. Off-cycle watering for containers is straight forward as can run for 15 seconds via HA (this could be a timed button in HA as well), but off-cycle for the drip tape will only be 20 minutes, as opposed to multiple iterations if I decide to, say, water in the evening when I am only on an AM OSBee watering program.

That's my user story, and I am sticking to it :)

chickenandpork commented 3 weeks ago

The osbee has a default program time, but you can still turn it on and off.

for example, you can build an automation that:

  1. Turn on switch (valve)
  2. Delay 20 seconds
  3. Turn off switch

This should work just fine with any switch, including osbee, and you don’t need to change the default program duration.

otherwise, the fix would be exposing a config value to change the default program duration, and I’m happy to do it, but the basic 3-step automation should work for you now

Can you give it a try, tell me how it works?

chickenandpork commented 2 weeks ago

@gitwob101 ^^ tagging you to ensure GitHub lets you know.

Although the above would let you have the same control on your system that I have in mine, re-reading your feature-request, it seems you actually want more of a way to define and apply new schedules that the OSBee runs independently? If that's the case, what would that look like? I don't mean to argue, I'm looking for an idea of how that would work best for you.

gitwob101 commented 2 weeks ago

I have implemented some schedules via Home Assistant which should get me where I need to now.

My original ask was have Home Assistant call the OSBee API to enable or disable OSBee programs, or to be able to "run now". The "run now" is mostly the same effect as calling an automation from HA. The problem that I was trying to solve is to conveniently disable a program in the event of rain.

The problem that I am trying to solve is to make watering reliable and choose the most resilient path so I we away for a week, etc.. For example if there was a power outage that exceed my UPS capacity, the OSBee could potentially continue as it can be run on its own power bank. It is located away from my IT/network stuff as it is close to the water source so requires this anyway. If the infrastructure running HA failed, OSBee would continue to keep trucking.

I am not an engineer, but my thought is that HA is left for the bells and whistles, and let OSBee be its own fail save. The stakes aren't actually high as this is an attempted to growing a small quantity of backyard vegetables (this is not a farming operation), but I also rather not lose things because HA decides to fail for some reason (operating VMs/containers much more complex than an embedded controller). HA on its own embedded hardware? Maybe but that is not a summer project for me, and also negates the whole point of consolidating my IT stuff.

Context: I live in the GTA in Ontario, Canada. We get a spurt of hot summer periods where I will need to provided additional watering. Despite being a "word class" city, the area that I live in doesn't have the most stable electrical supply. My UPS devices squawk regularly, and we do get brown outs and the occasional power outages more regularly than is reasonable, and sometimes seemingly quite randomly.

chickenandpork commented 2 weeks ago

I have implemented some schedules via Home Assistant which should get me where I need to now.

:)

Context: I live in the GTA in Ontario, Canada. We get a spurt of hot summer periods where I will need to provided additional watering

This makes a bit more sense. Although I'm currently in Victoria, BC, I had a few years in Kingston, commuting into TO for meetings, I can point at what those summers are like :) I like your notion of trimming the dependencies down to just the program that OSBee independently runs.

It might be possible to convert this to a different sort of module:

chickenandpork commented 5 days ago

@gitwob101 looking for your thoughts on how this module can dramatically change together you what you're looking for ^^

gitwob101 commented 1 day ago

Can we start with enable/disable each of the 6 program schedules?