Hi team HASS.
going batty here trying to debug what should be a simple automation improvement.
Basically, as summer moves to winter, I need to tweak my sunset offsets. I.e. in winter I switch on lighting 60 mins prior to sunset. In summer that offset is different.
I want to be able to control these via sliders (input_number) in the GUI. The input_numbers are working, just fine for instance, my input_number looks like this:
input_number:
sunset_pre_event:
name: Pre-Sunset Trigger
icon: mdi:weather-sunset-down
mode: slider
# unit_of_measurement: min
min: 1
max: 90
step: 1
which in the GUI looks like this:
which in the templates editor I can confirm is coming up ok:
but when I try to use this in an offset sun automation as the minute value:
#~~~~~~~~~~~~~~~~~~~~~~~SUNSET EVENT
- alias: 'LIGHTING: Sunset Lamps'
trigger:
platform: sun
event: sunset
# offset: -00:15:00
offset: '-00:{{states("input_number.sunset_pre_event")|int}}:00'
action:
I get this error:
2021-06-27 18:52:43 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: offset 00:{{states("input_number.sunset_pre_event")|int|string}}:00 should be format 'HH:MM', 'HH:MM:SS' or 'HH:MM:SS.F' for dictionary value @ data['offset']. Got None. (See ?, line ?).
whatâs doing my head in is I have a NEAR IDENTICAL setup to tune my irrigation and that is working just fine (note the <<<<<<<<<< template part). Is âoffsetâ more fussy than âdelayâ ??
#~~~~~~~~~~~~~~~~~~~~~~~WATER GARDEN
- alias: 'IRRIGATION: Water Garden'
trigger:
platform: time
at: "07:30:00"
condition:
# If today's forecast shows no rain....
- condition: numeric_state
entity_id: sensor.bexley_rain_amount_min_0
below: 0.5
action:
- service: notify.k_telegram_bex36debug_push
data:
message: '*IRRIGATION:* @tonyTap ->Opening (as no rain forecasted today)'
###########TAP OPEN
- service: switch.turn_on
data:
entity_id: switch.aeon_labs_zw132_dual_nano_switch_switch
###########SLEEP...
- delay: '00:{{ states("input_number.water_tony_before_off") | int }}:00' #<<<<<<<<<<
###########NOTIFY
- service: notify.k_telegram_bex36debug_push