Hi,
I am very new to HA and have got myself tangled trying to work out a way of automating my garden sprinklers so I am seeking your expert advice.
The overall ‘when’ to turn them on will be a schedule of some sort. And only one at a time - for water flow reasons
I cant conceptualise how to deal with the 2 dimensional nature of the duration they should be on for which varies by season
Device Spring/Autumn Summer Winter
Ferns 10 18 3
Veg2 8 15 3
Veg1 20 20 3
GeneralWhite 5 7 3
GeneralGreen 5 15 5
And these are not actuually devices? entities? in HA. There is a 2nd Raspberry with a relay hat that does the physical switching
This reacts to Mqtt messages sent by HA and, practically speaking, only has 2 commands
watering/Ferns (Yellow)/ON
watering/Ferns (Yellow)/OFF
I setup a dropdown helper to define the current ‘season’. I think is accessed like
{ states("input_select.watering_season_2") }
I would prefer the durations to be in a variable of some kind rather than buried in code as they do get tinkerred with a bit depending actual rainfall
so I thought of 15 variables
Spring/Autumn/Ferns 10
Spring/Autumn/GeneralGreen 5
Spring/Autumn/GeneralWhite 5
Spring/Autumn/Veg1 20
Spring/Autumn/Veg2 8
Summer/Ferns 18
Summer/GeneralGreen 15
Summer/GeneralWhite 7
Summer/Veg1 20
Summer/Veg2 15
Winter/Ferns 3
Winter/GeneralGreen 5
Winter/GeneralWhite 3
Winter/Veg1 3
Winter/Veg2 3
but then the automation looks messy to me. Allowing one for each area eg ‘Ferns’
In pseudo code it would be
trigger - schedule
condition - water is needed
action
send 'ON' mqtt message
if { states("input_select.watering_season_2") } = 'Spring/Autumn'
delay { states("input_select.Spring/Autumn/Ferns") } minutes
if { states("input_select.watering_season_2") } = 'Summer'
delay { states("input_select.Summer/Ferns") } minutes
if { states("input_select.watering_season_2") } = 'Winter'
delay { states("input_select.Winter/Ferns") } minutes
send 'OFF' mqtt message
If I had a database it would be simple
select duration where season = { states(“input_select.watering_season_2”) } and device = me
Thanks for any advice
JC