djos
(Derek Osborn)
January 14, 2019, 12:24am
1
Hi All, I’m a bit perplexed as to how I can fix this Automation issue - I have the below automation which works great when the conditions are all met and then the trigger condition is met.
However If im not home and the trigger condition is exceeded and then rerturn home making the conditions met, it doesnt fire. it’s very simple logic:
Trigger :
Downstairs thermostat temp exceeds 22c
Conditions :
Kilsyth villa away = off (in other words we are home)
Outside temp exceeds 25c
Rumpus room AC is not already on
Can anyone assist please?
- id: '1536901501240'
alias: Downstairs AC & Fan - 25+ On
trigger:
- above: '22'
entity_id: sensor.downstairs_thermostat_temperature
platform: numeric_state
condition:
- condition: state
entity_id: binary_sensor.kilsyth_villa_away
state: 'off'
- above: '25'
condition: numeric_state
entity_id: sensor.pws_temp_c
- condition: state
entity_id: climate.rumpus_room_air_con
state: 'off'
action:
- data:
entity_id: switch.lounge_fan_190
service: switch.turn_on
- data:
entity_id: climate.rumpus_room_air_con
service: climate.turn_on
- data:
entity_id: climate.rumpus_room_air_con
operation_mode: cool
service: climate.set_operation_mode
- data:
entity_id: climate.rumpus_room_air_con
temperature: '23'
service: climate.set_temperature
tom_l
January 14, 2019, 2:16am
2
If you want the automation to trigger when you return home as well as on temperature, simply add both to the trigger block:
- id: '1536901501240'
alias: Downstairs AC & Fan - 25+ On
trigger:
- platform: numeric_state
entity_id: sensor.downstairs_thermostat_temperature
above: '22'
- platform: state
entity_id: binary_sensor.kilsyth_villa_away
to: 'off'
Your existing conditions and actions stay the same.
1 Like
djos
(Derek Osborn)
January 14, 2019, 3:02am
3
Thank you, I’ll give that a try.
djos
(Derek Osborn)
January 15, 2019, 10:08pm
4
So I tried your suggestion and it didnt trip at all yesterday despite my wife being home - is having 2 triggers an AND or OR scenario?
PS, I did reload automations after making the changes.
djos
(Derek Osborn)
January 15, 2019, 10:37pm
6
ok thanks, I’ll see if it behaves today as it’s going to be hot again.
tom_l
January 15, 2019, 11:01pm
7
As written it should turn on when you actually arrive and it is above 22, or if you are already home and it goes above 22 due to the combination of triggers and conditions.
1 Like
djos
(Derek Osborn)
January 15, 2019, 11:04pm
8
Considering the Triggers are OR logic and the Conditions are AND logic, I’ve updated my Automation to use any one of 3 triggers and enhanced the conditions so any of the triggers can fire the Actions assuming all Conditions are met:
- id: '1536901501240'
alias: Downstairs AC & Fan - 25+ On
trigger:
- above: '22'
entity_id: sensor.downstairs_thermostat_temperature
platform: numeric_state
- entity_id: binary_sensor.kilsyth_villa_away
platform: state
to: 'off'
- above: '25'
entity_id: sensor.pws_temp_c
platform: numeric_state
condition:
- condition: state
entity_id: binary_sensor.kilsyth_villa_away
state: 'off'
- above: '25'
condition: numeric_state
entity_id: sensor.pws_temp_c
- condition: state
entity_id: climate.rumpus_room_air_con
state: 'off'
- above: '22'
condition: numeric_state
entity_id: sensor.downstairs_thermostat_temperature
action:
- data:
entity_id: switch.lounge_fan_190
service: switch.turn_on
- data:
entity_id: climate.rumpus_room_air_con
service: climate.turn_on
- data:
entity_id: climate.rumpus_room_air_con
operation_mode: cool
service: climate.set_operation_mode
- data:
entity_id: climate.rumpus_room_air_con
temperature: '23'
service: climate.set_temperature
tom_l
January 15, 2019, 11:09pm
9
The above 22 trigger will never fire the automation because of the above 25 condition.
your '-'s should be on the platform, not the value… not sure if HA will work either way, but the docs suggest that this:
trigger:
- above: '22'
entity_id: sensor.downstairs_thermostat_temperature
platform: numeric_state
should be this:
trigger:
- platform: numeric_state
entity_id: sensor.downstairs_thermostat_temperature
above: '22'
…and so forth. Just another thing to tidy up
No it will work… the automation editor mangles everything but it works as he has it.
1 Like
djos
(Derek Osborn)
January 21, 2019, 1:36am
12
It’s all working well now so Im happy - thanks for the help all, much appreciated.