I have a general script to switch on or/and set the temperature of my aircons.
This works mostly fine, but sometimes for some reason my aircon’s switch off directly. So to resolve this I call the script in my several automatisations twice…problem solved, but not so clean cause mostly it works fine with one time.
So I was wondering if I couldn’t change the script itself… Or create a new script (that I use in my automatisations) that calls my first script and eventually a second time…
Or other idea ?
alias: 'Switch : Airco x op y graden'
description: Set airco mode to heat and set temperature
fields:
temperature:
description: The temperature to set the airco at
default: 22
example: '21'
entity_id:
description: The climate entity you want to control
default: climate.airco_gang
example: climate.airco_gang
sequence:
- service: climate.turn_on
target:
entity_id: '{{ entity_id }}'
- service: climate.set_hvac_mode
target:
entity_id: '{{ entity_id }}'
data:
hvac_mode: heat
- service: climate.set_temperature
data:
temperature: '{{ temperature }}'
target:
entity_id: '{{ entity_id }}'
- service: climate.set_fan_mode
data:
fan_mode: auto
target:
entity_id: '{{ entity_id }}'
mode: single
Found it, but get an error “Message malformed: Entity {{ entity_id }} is neither a valid entity ID nor a valid UUID for dictionary value @ data[‘sequence’][1][‘choose’][0][‘conditions’][0][‘entity_id’]”
Why ?
alias: 'Switch : Airco x op y graden'
description: Set airco mode to heat and set temperature
fields:
temperature:
description: The temperature to set the airco at
default: 22
example: '21'
entity_id:
description: The climate entity you want to control
default: climate.airco_gang
example: climate.airco_gang
sequence:
- choose:
- conditions: []
sequence:
- service: climate.turn_on
target:
entity_id: '{{ entity_id }}'
- service: climate.set_hvac_mode
target:
entity_id: '{{ entity_id }}'
data:
hvac_mode: heat
- service: climate.set_temperature
data:
temperature: '{{ temperature }}'
target:
entity_id: '{{ entity_id }}'
- service: climate.set_fan_mode
data:
fan_mode: auto
target:
entity_id: '{{ entity_id }}'
default: []
- choose:
- conditions:
- condition: state
**entity_id: '{{ entity_id }}'**
state: 'off'
attribute: hvac_modes
sequence:
- service: climate.turn_on
target:
entity_id: '{{ entity_id }}'
- service: climate.set_hvac_mode
target:
entity_id: '{{ entity_id }}'
data:
hvac_mode: heat
- service: climate.set_temperature
data:
temperature: '{{ temperature }}'
target:
entity_id: '{{ entity_id }}'
- service: climate.set_fan_mode
data:
fan_mode: auto
target:
entity_id: '{{ entity_id }}'
default: []
mode: single