I have an automation that turns on a light. I want to also set the brightness based on a helper number input, but every way I tried makes the automation to break and not even load.
The error I get on the log says that it expects a float but None was found.
The helper is defined on the UI, so there is no way to set a default value, not sure if that matters
- id: 'study lights on via motion'
alias: Study Lights On via Motion
description: Control Study Lights with Shelly Motion Detection
trigger:
- platform: state
entity_id: binary_sensor.shellymotionsensor_60a423c66d96_motion
to: 'on'
condition:
- condition: state
entity_id: light.study_cans_current_value
state: 'off'
action:
- service: light.turn_on
target:
entity_id: light.study_cans_current_value
data:
brightness_pct: "{{states('input_number.brightness') | float(0)}}"
mode: single
Device Actions don’t support templates. It expected to find a numeric value (float) for brightness_pct but instead it got something it didn’t understand (namely a template which it doesn’t support).
You have to use a service call, like in the example AllHailJ posted.
that mostly makes sense, thanks. I find a bit confusing to understand what things support templates and which ones doesn’t. I’d there any rule of thumb that I can use?