My problem is that I want to set a value on an entity by a input number but it doesent work. Do you have a suggestion on this ?
Share the configuration for this you are trying.
alias: Set roof min
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.roof_2
above: 0
below: 50
condition: []
action:
- service: input_number.set_value
data: {}
target:
entity_id: input_number.roof_min
mode: single
What entity’s state do you want to set the input number to?
Also when are you hoping this will trigger?
At the moment it will only trigger if the roof sensor goes from outside the range 0-50 to somewhere within that range. It will not trigger again if the value stays in that range.
To sensor.roof _2 I want to send it.
alias: Set roof min
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.roof_2
above: 0
below: 50
condition: []
action:
- service: input_number.set_value
data:
value: "{{ trigger.to_state }}"
target:
entity_id: input_number.roof_min
mode: single
Do I need some script or somethink else ?
To do what?
The automation above sets the input number like you asked for.
Though I doubt it will ever trigger. Read my question above.
I just wanted that the input number reads the state of the sensor.roof_2. And when I want to set the value I can set it with the input number. Thats all
Small oversight; example is missing the state
property.
trigger.to_state.state
^^^^^^
I wonder if I’ll ever stop making that mistake. Thanks.