123
(Taras)
June 17, 2019, 11:12am
41
Why not use a simpler trigger?
trigger:
- platform:state
entity_id: sensor.wirelesstag_lounge_temperature
condition:
condition: and
conditions:
- condition: numeric_state
entity_id: sensor.wirelesstag_lounge_temperature
above: 26
- condition: state
entity_id: fan.lounge_fan
state: 'on'
- condition: state
entity_id: binary_sensor.people_home
state: 'on'
action:
- service: fan.set_speed
entity_id: fan.lounge_fan
data_template:
speed: >
{% set temp = trigger.to_state.state | float %}
{% if temp < 28 %} low
{% elif temp < 30 %} medium
{% else %} high
{% endif %}
1 Like
I see. Any state change would trigger it. That is a simpler solution. Thanks.
Jiran
(Jiran)
November 24, 2019, 9:16pm
43
Please could anyone help? This is my automations.yaml:
- alias: fan on
initial_state: 'off'
trigger:
- platform: numeric_state
entity_id: sensor.krb_teplota
above: '45'
action:
- service: switch.turn_on
entity_id: switch.ventilator
- alias: fan off
initial_state: 'on'
trigger:
- platform: numeric_state
entity_id: sensor.krb_teplota
below: '41'
action:
- service: switch.turn_off
entity_id: switch.ventilator
but is not working. I also canĀ“t edit his in HASS gui. Other automations run and IĀ“m able to edit them even via GUI. Any idea?
finity
November 25, 2019, 1:25am
44
Jiran:
but is not working.
try removing the quotes from around the numbers in above: and below:
in order to make the automation editable in the ui it needs to have a unique_id included.
it can be anything as long as itās unique and not capitalized.
- id: yghygygulfsrdrtrd765687
alias:...
Jiran
(Jiran)
November 25, 2019, 9:29pm
45
Thank you. But this is not the question. What could be wrong with this automation?
Tinkerer
(aka DubhAd on GitHub)
November 25, 2019, 9:51pm
47
Because you didnāt add an id:
line - see here
finity
November 26, 2019, 12:19am
48
yes it wasā¦
Tinkerer:
Itās turned off
good catch. Didnāt even notice that.
Jiran
(Jiran)
November 27, 2019, 9:58pm
49
Please how to config automation to let the fan start anytime the temperature is above xx, even if I turn it off manually? Automation start after xx temp is reached. But if I turn fan off if temp is above xx it will stay stopped.
Try this. I think you need to add a condition rather than the initial state
- id: fan_on
alias: fan on
trigger:
- platform: numeric_state
entity_id: sensor.krb_teplota
above: 45
condition:
- condition: state
entity_id: switch.ventilator
state: 'on'
action:
- service: switch.turn_on
entity_id: switch.ventilator
- id: fan_off
alias: fan off
trigger:
- platform: numeric_state
entity_id: sensor.krb_teplota
below: 41
condition:
- condition: state
entity_id: switch.ventilator
state: 'off'
action:
- service: switch.turn_off
entity_id: switch.ventilator
Jiran
(Jiran)
November 28, 2019, 6:35am
51
Thank you butā¦ Donā t you have bad conditions? In ON automation should be off and viceversa?
Yep. Switch them around. See how you go.