-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
irrigation_unlimited_start does not fire the automation #134
Comments
I got the picture. I overlooked this "These events are fired when a sequence starts and finishes." I just go it fired when a watering sequence started. I guess I've been fooled by the name of the event, that maybe should be better named: irrigation_unlimited_sequence_start? |
Correct, you only get these messages when using sequences. You can use the state platform to get a zone or controller on/off. It might be handy to fire one on the zone as well. Let me know if you can't do what you need using the state platform. automation:
id: a43d818a-787e-41ba-b5d3-f5129599168e
alias: "Irrigation Unlimited starting"
trigger:
- platform: state
entity_id:
binary_sensor.irrigation_unlimited_c1_z1
from: "off"
to: "on"
action:
... |
Thank you. |
Correct, changing the adjustment will not effect any running schedules. |
I ended up with this automation which fair enough. If watering start time is changed, its is fairly easy to update the code. I still have to add some logic related to rain forecast and soil moisture. I works very well so far. It would be nice to be able to template schedule start time, then everything could be based on that. Any thoughts?
|
Not sure what you want to do exactly with the start time. Could you expand your thoughts. |
Yes with pleasure. If sequence start time is set by an input_datetime helper, the automation triggers above could referred to it minus 1 minute and minus 2 minutes for instance. Triggers would be then dynamic instead of being static. |
Can you use the |
Thank you, I see, if start time is needed to be changed then I do it by load_schedule (instead of doing it in the .yaml) and then I can use the same reference minus some time to change time at which events are fired. |
So I had to defined two template sensors:
And then final code for automation:
and the snippet for load_schedule
So no matter the sequence start time, I'm now sure that watering time will be computed just a bit before the sequence starts. |
Please note that currently changes made to schedules with the trigger:
- platform: homeassistant
event: start |
thank you for the tip. I'll make sure a piece of code is added at startup. |
I think you can combine into your automation like this.
|
You are right, thank you. I'll will shortly update the code above. I discovered that trying to make a template sensor from an input_datetime is a dead end because it is not viewed as datetime object. As a consequence, events are not fired. |
Thanks for the tip, I never experienced yet the template trigger, I think it can make it. HA is full of ressources |
Here is the final code, no templates. Much more elegant and efficient. Watering time is computed 2 minutes before scheduled time and set one minute before it. Again thank you very much for your kind help.
And this is the piece of code that sets the watering time using percentage at controller level:
|
I'm just trying to get the following example from the documentation working without success so far. I have only tested Manual run (no event is fired). I haven't tested automatic start, time will tell. Am I misunderstanding something?
Configuration
Automation
Version of the custom_component: very latest version, downloaded from repositery
Logs (excerpt)
The text was updated successfully, but these errors were encountered: