jeroenterheerdt / HAsmartirrigation

Smart Irrigation custom component for Home Assistant
https://jeroenterheerdt.github.io/HAsmartirrigation/
MIT License
356 stars 49 forks source link

[REQ] calculate start time #42

Closed eavanvalkenburg closed 4 years ago

eavanvalkenburg commented 4 years ago

Is your feature request related to a problem? Please describe. The best time to use your sprinklers is right before sunrise, apparently that is best for your plants, and worst for any weeds, while it being still night is obviously better with regard to evaporation.

Describe the solution you'd like Event thrown when you should start watering, the amount of time before sunrise that it needs to water.

Describe alternatives you've considered Complex automations with sunset offset etc. but this code should have all the knowledge on what time to start, so why not use the eventing engine to let a automation pick it up.

Additional context More complex is that I have three sprinklers for my grass, so currently have them scheduled one after another, which makes it a bit more complex, but that is not necessary for this.

jeroenterheerdt commented 4 years ago

Awesome ideas, should be doable. One question: I think you mean using the sun entity. Is that a default entity? I have not looked into it too much. Wondering if we can assume that thing is always going to be there or if we need to provide an option for users to plug in their own sunrise sensor.

eavanvalkenburg commented 4 years ago

it is a built-in integration, not sure if it is on by default, but probably most people using HA will have it on: https://www.home-assistant.io/integrations/sun/

jeroenterheerdt commented 4 years ago

new release in beta: https://github.com/jeroenterheerdt/HAsmartirrigation/releases/tag/v0.0.61 that implements this feature - please install and test :) event name is [instance name] start.

jeroenterheerdt commented 4 years ago

I am not seeing the event being fired, added more logging on v0.0.62

posixx commented 4 years ago

I don't see the event as available:

image

Shouldn't it be in the list?

jeroenterheerdt commented 4 years ago

I am not sure if it should be in the list - a component does not have to register an event, you just fire it. Now, maybe it is just not firing.

jeroenterheerdt commented 4 years ago

I am seeing it getting fired in the logs: image

(ignore the part that says Daily Adjusted Run Time, that is just an error in the logging)

I can confirm that the start event is getting fired: image

posixx commented 4 years ago

Yes i can confirm the event is triggered!