Jokerigno
(Jokerigno)
October 16, 2020, 9:01am
1
Hi,
I have an old humifier and a smart plug that I put together to manager humidity in the child’s room.
This is the config at the moment.
- alias: Camera di Adele - Accendi Umidificatore
id: 'Accendi_Umidificatore'
initial_state: true
trigger:
- platform: template
value_template: '{{ states("sensor.cameretta") | float < 49.1}}'
- platform: time_pattern
hours: "00"
minutes: "10"
seconds: "00"
condition:
- condition: state
entity_id: input_boolean.operazioneadele
state: 'on'
- condition: template
value_template: '{{ states("sensor.season") != "Summer" }}'
- condition: template
value_template: '{{ states("sensor.cameretta") | float < 49.1}}'
- condition: state
entity_id: switch.presa_tpl3
state: 'off'
action:
- service: switch.turn_on
entity_id: switch.presa_tpl3
- alias: Camera di Adele - Spegni Umidificatore
id: 'spegni_Umidificatore'
initial_state: true
trigger:
- platform: template
value_template: '{{ states("sensor.cameretta") | float > 51.1}}'
- platform: time_pattern
hours: "00"
minutes: "10"
seconds: "00"
condition:
# - condition: state
# entity_id: input_boolean.operazioneadele
# state: 'off'
- condition: template
value_template: '{{ states("sensor.season") != "Summer" }}'
- condition: template
value_template: '{{ states("sensor.cameretta") | float > 51.1}}'
- condition: state
entity_id: switch.presa_tpl3
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.presa_tpl3
The issue is that it doesn’t work as expected ( keep humidiy at a particular percentage only when my daughter is sleeping.
Can someone please point me to the right direction?
Thank you in advance!
finity
October 16, 2020, 2:46pm
2
What’s not working? we need more details.
Jokerigno
(Jokerigno)
October 16, 2020, 3:05pm
3
Sorry. The issue is that humidifier starts when the input boolean is on but the it’s not triggered when humidity change to the new level
finity
October 16, 2020, 5:20pm
4
Does the plug that you are controlling turn the humidifier on to lower the humidity?
If so then I think you have your comparisons backwards.
right now the humidifier will only turn on if the humidity was above 49.1 and then subsequently goes below that value (while all of the other conditions are also met as well).
Is that the way you want it to work? Seems backwards to me
Jokerigno
(Jokerigno)
October 18, 2020, 7:44am
5
No. In my mind plug should switch on only inf humidity is lower than trigger value.
Why you say above when I use this code?
value_template: '{{ states("sensor.cameretta") | float < 49.1}}'
I think the issue is here in the way the template is written. If I test it on dev it’s true while the humidity at the moment is 55.6 so it should be false!
EDIT: don’t know how or when but sensor was changed to sensor.cameretta_2 (maybe a deconz issue?) changed to the correct sensor. Let’s see if now it works.
finity
October 18, 2020, 2:23pm
6
D’oh!
For some reason I thought you were working with a DE-humidifier…
hopefully it works for you now.
Jokerigno
(Jokerigno)
October 18, 2020, 9:35pm
7
No it doesn’t work.
What it makes me nuts it’s that this code:
- alias: Camera di Adele - Accendi Umidificatore
id: 'Accendi_Umidificatore'
initial_state: true
trigger:
- platform: template
value_template: '{{ states("sensor.cameretta_humidity") | float < 49.1}}'
- platform: time_pattern
hours: "00"
minutes: "01"
seconds: "00"
condition:
- condition: state
entity_id: input_boolean.operazioneadele
state: 'on'
- condition: template
value_template: '{{ states("sensor.season") != "Summer" }}'
- condition: template
value_template: '{{ states("sensor.cameretta_humidity") | float < 49.1}}'
- condition: state
entity_id: switch.presa_tpl3
state: 'off'
action:
- service: switch.turn_on
entity_id: switch.presa_tpl3
- alias: Camera di Adele - Spegni Umidificatore
id: 'spegni_Umidificatore'
initial_state: true
trigger:
- platform: template
value_template: '{{ states("sensor.cameretta_humidity") | float > 51.1}}'
- platform: time_pattern
hours: "00"
minutes: "01"
seconds: "00"
condition:
- condition: template
value_template: '{{ states("sensor.season") != "Summer" }}'
- condition: template
value_template: '{{ states("sensor.cameretta_humidity") | float > 51.1}}'
- condition: state
entity_id: switch.presa_tpl3
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.presa_tpl3
looks good on template:
- alias: Camera di Adele - Accendi Umidificatore
id: 'Accendi_Umidificatore'
initial_state: true
trigger:
- platform: template
value_template: 'False'
- platform: time_pattern
hours: "00"
minutes: "01"
seconds: "00"
condition:
- condition: state
entity_id: input_boolean.operazioneadele
state: 'on'
- condition: template
value_template: 'True'
- condition: template
value_template: 'False'
- condition: state
entity_id: switch.presa_tpl3
state: 'off'
action:
- service: switch.turn_on
entity_id: switch.presa_tpl3
- alias: Camera di Adele - Spegni Umidificatore
id: 'spegni_Umidificatore'
initial_state: true
trigger:
- platform: template
value_template: 'True'
- platform: time_pattern
hours: "00"
minutes: "01"
seconds: "00"
condition:
- condition: template
value_template: 'True'
- condition: template
value_template: 'True'
- condition: state
entity_id: switch.presa_tpl3
state: 'on'
action:
- service: switch.turn_off
entity_id: switch.presa_tpl3
WHY the second automation is not triggered and the switch stays on?
EDIT: The issue was in the trigger.
It should be something like minutes: “/05” to trigger every five minutes!