Hi
my house has 3 sources of AC power some of them with limited current So I decided to make it work according to my need but something is wrong
1- I have a sensor that check AC power sources
sensor.power_ac_source
has 4 states (Main, Outside G., Home G., and Offline)
2- 3 input select
home_kids_room_air_conditioner_main:
name: Main
options:
- Online
- Cool
- Fan Only
- Offline
icon: mdi:progress-question
home_kids_room_air_conditioner_outside_generator:
name: Outside G.
options:
- Online
- Cool
- Fan Only
- Offline
icon: mdi:progress-question
home_kids_room_air_conditioner_home_generator:
name: Home G.
options:
- Online
- Cool
- Fan Only
- Offline
icon: mdi:progress-question
3- automation
alias: Power AC Source "Non-Offline"
description: ''
trigger:
- platform: state
entity_id: sensor.power_ac_source
from: Offline
condition: []
action:
- service: script.turn_on
data: {}
target:
entity_id:
- script.home_kids_room_ac
mode: single
4- Script
home_kids_room_ac:
alias: ' Home Kids Room AC '
sequence:
- wait_template: '{{ is_state(''binary_sensor.power_sub_status'', ''on'') }}'
continue_on_timeout: true
timeout: 00:00:05
- choose:
- conditions:
- condition: state
entity_id: sensor.power_ac_source
state: Main
- condition: not
conditions:
- condition: state
entity_id: input_select.home_kids_room_air_conditioner_main
state: Offline
sequence:
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- service: switch.turn_on
data: {}
target:
entity_id: switch.power_sub_t_2r
- wait_template: '{{ is_state(''binary_sensor.kids_room_ac_status'', ''on'')
}}'
continue_on_timeout: true
timeout: 00:00:05
- choose:
- conditions:
- condition: state
entity_id: input_select.home_kids_room_air_conditioner_main
state: Cool
sequence:
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: climate.set_hvac_mode
data:
hvac_mode: cool
target:
entity_id: climate.kids_room_ac
- conditions:
- condition: state
entity_id: input_select.home_kids_room_air_conditioner_main
state: Fan Only
sequence:
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: climate.set_hvac_mode
data:
hvac_mode: fan_only
target:
entity_id: climate.kids_room_ac
default: []
- conditions:
- condition: state
entity_id: sensor.power_ac_source
state: Outside G.
- condition: not
conditions:
- condition: state
entity_id: input_select.home_kids_room_air_conditioner_outside_generator
state: Offline
sequence:
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- service: switch.turn_on
data: {}
target:
entity_id: switch.power_sub_t_2r
- wait_template: '{{ is_state(''binary_sensor.kids_room_ac_status'', ''on'')
}}'
continue_on_timeout: true
timeout: 00:00:05
- choose:
- conditions:
- condition: state
entity_id: input_select.home_kids_room_air_conditioner_outside_generator
state: Cool
sequence:
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: climate.set_hvac_mode
data:
hvac_mode: cool
target:
entity_id: climate.kids_room_ac
- conditions:
- condition: state
entity_id: input_select.home_kids_room_air_conditioner_outside_generator
state: Fan Only
sequence:
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: climate.set_hvac_mode
data:
hvac_mode: fan_only
target:
entity_id: climate.kids_room_ac
default: []
- conditions:
- condition: state
entity_id: sensor.power_ac_source
state: Outside G.
- condition: not
conditions:
- condition: state
entity_id: input_select.home_kids_room_air_conditioner_home_generator
state: Offline
sequence:
- delay:
hours: 0
minutes: 0
seconds: 10
milliseconds: 0
- service: switch.turn_on
data: {}
target:
entity_id: switch.power_sub_t_1r
- wait_template: '{{ is_state(''binary_sensor.kids_room_ac_status'', ''on'')
}}'
continue_on_timeout: true
timeout: 00:00:05
- choose:
- conditions:
- condition: state
entity_id: input_select.home_kids_room_air_conditioner_home_generator
state: Cool
sequence:
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: climate.set_hvac_mode
data:
hvac_mode: cool
target:
entity_id: climate.kids_room_ac
- conditions:
- condition: state
entity_id: input_select.home_kids_room_air_conditioner_home_generator
state: Fan Only
sequence:
- delay:
hours: 0
minutes: 0
seconds: 20
milliseconds: 0
- service: climate.set_hvac_mode
data:
hvac_mode: fan_only
target:
entity_id: climate.kids_room_ac
default: []
default: []
mode: single
icon: mdi:air-conditioner
Any suggestions ?