Hi petro,
thanks, but not one of this lines is working.
There is no messagee about any error, just had result 'false' and so do the wrong thing.
BUT: Asking me, that in the variable it needs an 'climate' device triggers more investigation. Whenever I used the variable in my blueprint to carry out some action, the AC box do it. For me: "Content of this variable correct". But the Studio server shows some message which I ignored (as somebody told me, that this messages were not reliable)
I immediately checked the configuration.yaml and there is the 'climate-line'.
logger:
default: info
logs:
homeassistant.components.python_script: debug
homeassistant.components.automation: info
homeassistant.components.mqtt.discovery: info
climate:
#- platform: local_daikin
# ip_address:
# - 192.168.0.170
###### Thermostate (PID) KG ######
# Thermostat für Turnsaal
- platform: smart_thermostat
name: KG Turnsaal Thermostat WP
unique_id: kg_turnsaal_thermostat_wp
heater: input_boolean.kg_turnsaal_wp
target_sensor: sensor.kg_turnsaal_tempmeter_temp
outdoor_sensor: sensor.out_tempmeter_temp
min_temp: 15
max_temp: 28
ac_mode: False
target_temp: 23
keep_alive:
seconds: 60
away_temp: 14
kp: 5
ki: 0.01
kd: 500
ke: 0.5
pwm: 00:15:00
I use some PID thermostates for the heating (not AC boxes) system since about 2 years without any problems. And all my automations for AC boxes without blueprints working fine. And some functions of the AC boxes in blueprints working fine (Switching On/Off, setting target temperature ...) only checking the state doesn't work out.
Here the whole yaml for SirGoodEnough, but it is much more than the part causing the problems:
blueprint:
name: Air Condition Controller V2
description: Controls an air condition box in a room, stops using the remote control and takes care of open windows/doors and black out condition.
domain: automation
author: DI Gerhard Kreuzer
input:
main_switch:
name: Main Switch
selector:
entity:
filter:
domain: input_boolean
room_switch:
name: Room Switch
selector:
entity:
filter:
domain: input_boolean
remote_switch:
name: Remote Power Switch
selector:
entity:
filter:
domain: switch
blackout_signal:
name: Signals a blackout condition
selector:
entity:
filter:
domain: input_boolean
room_state:
name: Room State
description: Signals, that the room is ready for cooling/heating (all windows or doors were closed).
selector:
entity:
filter:
domain: binary_sensor
room_closed_delay_seconds:
name: Delay start of AC after romm is closed
description: Delay action after room is closed for x seconds
default: 30
selector:
number:
min: 10
max: 300
step: 5
unit_of_measurement: seconds
room_opened_delay_seconds:
name: Delay stop of AC after room is opened
description: Delay action after room is opened for x seconds
default: 30
selector:
number:
min: 10
max: 300
step: 5
unit_of_measurement: seconds
override_delay_seconds:
name: Delay the override action after usage of remote control
description: Delay overruling of user setting (with remote control) for x seconds
default: 30
selector:
number:
min: 10
max: 300
step: 5
unit_of_measurement: seconds
target_temperature:
name: Target Temperature Value
selector:
entity:
filter:
domain:
- input_number
room_temperature:
name: Room Temperature Sensor
selector:
entity:
filter:
domain: sensor
device_class: temperature
ac_mode:
name: Mode of the AC (Cool, Heat, Dry, ...)
selector:
entity:
filter:
domain:
- input_select
preselection:
name: Preselected Mode of Thermostat (Eco, Boost, ...)
selector:
entity:
filter:
domain:
- input_select
ac_device:
name: AC Device to be controlled
selector:
entity:
multiple: true
filter:
domain:
- climate
mode: single #queued
variables:
myBlackoutInput: !input blackout_signal
myBlackoutSignal: '{{ states(myBlackoutInput) == ''on''}}'
myMainSwitchInput: !input main_switch
myMainSwitch: '{{ states(myMainSwitchInput) == ''on''}}'
myRoomSwitchInput: !input room_switch
myRoomSwitch: '{{ states(myRoomSwitchInput) == ''on''}}'
myRemoteSwitch: !input remote_switch
myIsWindowOpenInput: !input room_state
myIsWindowOpen: '{{ states(myIsWindowOpenInput) == ''on''}}'
myTargetTemp: !input target_temperature
myRoomTemperature: !input room_temperature
myAcMode: !input ac_mode
myPreselection: !input preselection
myRoomIsOpenDelay: !input room_opened_delay_seconds
myRoomIsClosedDelay: !input room_closed_delay_seconds
myOverrideDelay: !input override_delay_seconds
myAcDevice: !input ac_device
myRCIsOn: '{{ saver.entity(myRemoteSwitch) == ''on''}}'
myEnabled: '{{ not myBlackoutSignal and myMainSwitch and myRoomSwitch and not myIsWindowOpen }}'
triggers:
- trigger: state
entity_id: !input blackout_signal
from:
- "off"
to:
- "on"
id: Blackout hat begonnen
- trigger: state
entity_id: !input blackout_signal
from:
- "on"
to:
- "off"
for:
hours: 0
minutes: 10
seconds: 0
id: Blackout endet
- trigger: state
entity_id: !input main_switch
from:
- "off"
to:
- "on"
id: Main Switched On
- trigger: state
entity_id: !input main_switch
from:
- "on"
to:
- "off"
id: Main Switched Off
- trigger: state
entity_id: !input room_switch
from:
- "off"
to:
- "on"
id: Room Switched On
- trigger: state
entity_id: !input room_switch
from:
- "on"
to:
- "off"
id: Room Switched Off
- trigger: state
entity_id: !input remote_switch
from:
- "off"
to:
- "on"
id: Remote Switched on
#enabled: false
for:
hours: 0
minutes: 0
seconds: !input override_delay_seconds
- trigger: state
entity_id: !input remote_switch
from:
- "on"
to:
- "off"
id: Remote Switched off
- trigger: state
entity_id: !input ac_device
attribute: hvac_action
id: Set AC Mode from off to something
# enabled: false
for:
hours: 0
minutes: 0
seconds: !input override_delay_seconds
from:
- "off"
- trigger: state
entity_id: !input ac_device
attribute: hvac_action
id: AC Mode set to Off
# enabled: false
for:
hours: 0
minutes: 0
seconds: !input override_delay_seconds
to:
- "off"
- trigger: state
entity_id: !input ac_mode
id: AC Mode zentral geƤndert
- trigger: state
entity_id: !input target_temperature
id: Zentral vorgegebene Solltemperatur wurde geƤndert
- trigger: state
entity_id: !input ac_device
attribute: temperature
id: Soll-Temperatur wurde remote geƤndert
for:
hours: 0
minutes: 0
seconds: !input override_delay_seconds
- trigger: state
entity_id: !input preselection
id: AC Level geƤndert
- trigger: state
entity_id: !input ac_device
attribute: preset_mode
for:
hours: 0
minutes: 0
seconds: !input override_delay_seconds
id: Voreinstellung remote geƤndert
- trigger: state
entity_id: !input room_state
from: "off"
to: "on"
id: Window or Door opened
for:
hours: 0
minutes: 5
seconds: 0
- trigger: state
entity_id: !input room_state
from: "on"
to: "off"
for:
hours: 0
minutes: 0
seconds: !input room_closed_delay_seconds
id: Window or Door closed
- trigger: time_pattern
minutes: /1
seconds: "15"
id: TickTack
conditions: []
actions:
- choose:
# Save current state and switch AC off, because AC is not usable anymore
- conditions:
- condition: trigger
id:
- Blackout hat begonnen
- Main Switched Off
- Room Switched Off
- Window or Door opened
sequence:
- action: saver.save_state
data:
entity_id: !input ac_device
- action: climate.turn_off
metadata: {}
target:
entity_id: !input ac_device
data: {}
# If AC is usable again restore last state
- conditions:
- condition: trigger
id:
- Blackout endet
- Main Switched On
- Room Switched On
- Window or Door closed
sequence:
- condition: template
value_template: '{{ myEnabled == true }}'
- action: saver.restore_state
data:
entity_id: !input ac_device
delete_after_run: false
#- condition: template
# value_template: '{{ not (states(myAcDevice) == ''off'') }}'
#- action: climate.turn_on
# metadata: {}
# target:
# entity_id: !input ac_device
# data: {}
# Somebody used the remote control to switch off his AC
- conditions:
- condition: trigger
id:
- Remote Switched off
- AC Mode set to Off
sequence:
# Box is off now, save this information
#- condition: state
# state:
# - "on"
# entity_id: !input remote_switch
- action: saver.save_state
data:
entity_id: !input ac_device
# Somebody tried to switch on his AC using the remote control
- conditions:
- condition: trigger
id:
- Remote Switched on
- Set AC Mode from off to something
sequence:
# Box is off now, save this information
- action: saver.save_state
data:
entity_id: !input ac_device
- condition: template
value_template: '{{ myEnabled == false }}'
- action: climate.turn_off
metadata: {}
target:
entity_id: !input ac_device
data: {}
- conditions:
- condition: trigger
id:
- AC Mode zentral geƤndert
- Zentral vorgegebene Solltemperatur wurde geƤndert
- Soll-Temperatur wurde remote geƤndert
- AC Level geƤndert
- Voreinstellung remote geƤndert
- TickTack
sequence:
- condition: template
value_template: "{{ myEnabled == true }}"
- condition: template
value_template: "{{ not is_state(myAcDevice, 'off') }}"
- action: climate.set_temperature
metadata: {}
data:
temperature: >-
{{ states( myTargetTemp ) }}
target:
entity_id: !input ac_device
- action: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: "{{ states( myAcMode ) }}"
target:
entity_id: !input ac_device
- action: climate.set_preset_mode
metadata: {}
data:
preset_mode: >-
{{ states( myPreselection )|lower }}
target:
entity_id: !input ac_device
Maybe one can show me (newbee to blueprints) some better solution for some lines of code. And keep in mind, I do lot of tests to overcome this problem.
Thanks for helping out.