hi, i try to setup some timer . the problem is at the end not jump to idle but stay at Active.
after is select a sauna mode will statrt the timer for 1 hour… between this time u cant select other sauna mode. after this 1 hour jump to cool down , this time u cant select any of the mode. after the cool down time should go to idle and reset the sauna. right now its working if i select manual cooldown finish. please for help
config : # Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Input select for sauna mode
input_select:
sauna_mode:
name: Sauna Mode
options:
- Izklop
- Turška
- Infra
- Finska
initial: Izklop
icon: mdi:sauna
# Timer definitions
timer:
sauna_active:
duration: "00:01:00"
sauna_cooldown:
duration: "00:01:00"
# Sensor definitions
sensor:
- platform: template
sensors:
sauna_temperature:
friendly_name: "Sauna Temperature"
value_template: "{{ state_attr('climate.sauna1_thermobox_thermostat', 'current_temperature') }}"
unit_of_measurement: "°C"
automations.yaml:
# Automation to manage sauna modes
- alias: Set Sauna Mode
trigger:
- platform: state
entity_id: input_select.sauna_mode
action:
- choose:
- conditions:
- condition: state
entity_id: input_select.sauna_mode
state: "Izklop"
sequence:
- service: switch.turn_off
target:
entity_id:
- switch.sauna2_switchbox_0_relay_0
- switch.sauna3_switchbox_0_relay_0
- service: climate.set_hvac_mode
target:
entity_id: climate.sauna1_thermobox_thermostat
data:
hvac_mode: "off"
- conditions:
- condition: state
entity_id: input_select.sauna_mode
state: "Turška"
sequence:
- service: switch.turn_on
target:
entity_id: switch.sauna2_switchbox_0_relay_0
- service: switch.turn_off
target:
entity_id: switch.sauna3_switchbox_0_relay_0
- service: climate.set_hvac_mode
target:
entity_id: climate.sauna1_thermobox_thermostat
data:
hvac_mode: "off"
- conditions:
- condition: state
entity_id: input_select.sauna_mode
state: "Infra"
sequence:
- service: switch.turn_on
target:
entity_id: switch.sauna3_switchbox_0_relay_0
- service: switch.turn_off
target:
entity_id: switch.sauna2_switchbox_0_relay_0
- service: climate.set_hvac_mode
target:
entity_id: climate.sauna1_thermobox_thermostat
data:
hvac_mode: "off"
- conditions:
- condition: state
entity_id: input_select.sauna_mode
state: "Finska"
sequence:
- service: climate.set_hvac_mode
target:
entity_id: climate.sauna1_thermobox_thermostat
data:
hvac_mode: "heat"
- service: climate.set_temperature
target:
entity_id: climate.sauna1_thermobox_thermostat
data:
temperature: 90
- service: switch.turn_off
target:
entity_id:
- switch.sauna2_switchbox_0_relay_0
- switch.sauna3_switchbox_0_relay_0
- service: timer.start
data:
entity_id: timer.sauna_active
- alias: Log Sauna Mode State
trigger:
- platform: state
entity_id: input_select.sauna_mode
action:
- service: system_log.write
data:
message: "Sauna Mode changed to {{ states('input_select.sauna_mode') }}"
# Automation to turn off sauna after the active timer finishes
- alias: Turn Off Sauna After Active Timer
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.sauna_active
action:
- service: switch.turn_off
target:
entity_id:
- switch.sauna2_switchbox_0_relay_0
- switch.sauna3_switchbox_0_relay_0
- service: climate.set_hvac_mode
target:
entity_id: climate.sauna1_thermobox_thermostat
data:
hvac_mode: "off"
- service: input_select.select_option
data:
entity_id: input_select.sauna_mode
option: "Izklop"
- service: timer.start
data:
entity_id: timer.sauna_cooldown
- alias: Prevent Sauna Mode Change During Cooldown
trigger:
- platform: state
entity_id: timer.sauna_cooldown
to: "active"
action:
- service: input_select.select_option
data:
entity_id: input_select.sauna_mode
option: "Izklop"
- alias: Block Mode Selection During Cooldown
trigger:
- platform: event
event_type: timer.started
event_data:
entity_id: timer.sauna_cooldown
action:
- service: input_select.set_options
data:
entity_id: input_select.sauna_mode
options:
- Cooldown
- service: input_select.select_option
data:
entity_id: input_select.sauna_mode
option: Cooldown
- alias: Restore Mode Selection After Cooldown
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.sauna_cooldown
action:
- service: input_select.set_options
data:
entity_id: input_select.sauna_mode
options:
- Izklop
- Turška
- Infra
- Finska
- service: input_select.select_option
data:
entity_id: input_select.sauna_mode
option: Izklop