Hi mate,
When playing with this HA thermostat project I found that I was
accidentally setting the temperature using the little Ikea (Zigbee)
dimmer switch whilst meaning to just turn it on or off.
This is process is currently done using 3 automations:
One to turn the virtual thermostat on:
alias: New Ikea long hold heater on
description: ""
trigger:
- device_id: d7801919c3628a93bbb9bb67b76594eb
domain: zha
platform: device
type: remote_button_long_press
subtype: dim_up
condition: []
action:
- service: climate.turn_on
metadata: {}
data: {}
target:
entity_id: climate.lounge
mode: single
One to turn it off:
alias: New Ikea long hold heater off
description: ""
trigger:
- device_id: d7801919c3628a93bbb9bb67b76594eb
domain: zha
platform: device
type: remote_button_long_press
subtype: dim_down
condition: []
action:
- service: climate.turn_off
target:
entity_id:
- climate.lounge
data: {}
mode: single
And a third that allows you to set the stat up or down 1 DegC:
alias: New Ikea up down temp
description: ""
trigger:
- device_id: d7801919c3628a93bbb9bb67b76594eb
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
id: "1"
- device_id: d7801919c3628a93bbb9bb67b76594eb
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_off
id: "-1"
condition: []
action:
- service: climate.set_temperature
metadata: {}
data:
temperature: "{{ state_attr('climate.lounge', 'temperature') +
trigger.id | int(0) }}"
target:
entity_id: climate.lounge
mode: single
What I tried to do was to add a condition to the Up/Down automation that
would only allow that to work if the stat was 'on' but I'm not sure we
have that state, just heating or idle so I tried to include those but
don't think the logic is right (eg, heating and idle can't be positive
at the same time, so I need an 'OR' in there somewhere?)
alias: New Ikea Up Down target temp test
description: ""
trigger:
- device_id: d7801919c3628a93bbb9bb67b76594eb
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
id: "1"
- device_id: d7801919c3628a93bbb9bb67b76594eb
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_off
id: "-1"
condition:
- condition: state
entity_id: climate.lounge
attribute: hvac_action
state: heating
enabled: true
- condition: state
entity_id: climate.lounge
attribute: hvac_action
state: idle
enabled: true
action:
- service: climate.set_temperature
metadata: {}
data:
temperature: "{{ state_attr('climate.lounge', 'temperature') +
trigger.id | int(0) }}"
target:
entity_id: climate.lounge
mode: single
So I think I found how to add that in the OR in the automation GUI:
alias: New Ikea Up Down target temp test or
description: ""
trigger:
- device_id: d7801919c3628a93bbb9bb67b76594eb
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_on
id: "1"
- device_id: d7801919c3628a93bbb9bb67b76594eb
domain: zha
platform: device
type: remote_button_short_press
subtype: turn_off
id: "-1"
condition:
- condition: state
entity_id: climate.lounge
attribute: hvac_action
state: heating
enabled: true
- condition: or
conditions: []
- condition: state
entity_id: climate.lounge
attribute: hvac_action
state: idle
enabled: true
action:
- service: climate.set_temperature
metadata: {}
data:
temperature: "{{ state_attr('climate.lounge', 'temperature') +
trigger.id | int(0) }}"
target:
entity_id: climate.lounge
mode: single
But it doesn't seem to work? eg, I can still set the temp up and down
when the stat *isn't* 'heating' or 'idle'?
Any idea what have I missed please?
Cheers, T i m