Skip to content

Commit

Permalink
Merge pull request #451 from drsugranes/master
Browse files Browse the repository at this point in the history
Wait to enable selectors automations
  • Loading branch information
Egyras authored Jan 2, 2024
2 parents 777d240 + 2cf4f95 commit 0a9ee40
Showing 1 changed file with 121 additions and 62 deletions.
183 changes: 121 additions & 62 deletions Integrations/Home Assistant/heishamon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
## 1.5.1 (18-10-2023)
## Fixed
## - Power templates when values not available
## 1.5.2 (28-12-2023)
## Fixed
## - Wait to enable selectors automations

# Automations #
###############
Expand All @@ -60,16 +63,26 @@ automation:
platform: state
entity_id: input_select.heishamon_quietmode
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetQuietMode
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{%- if states('input_select.heishamon_quietmode') == "Off" -%}
0
{%- else -%}
{{ states('input_select.heishamon_quietmode') }}
{%- endif -%}
- service: automation.turn_off
entity_id: automation.set_quiet_level_selector
- service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetQuietMode
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{%- if states('input_select.heishamon_quietmode') == "Off" -%}
0
{%- else -%}
{{ states('input_select.heishamon_quietmode') }}
{%- endif -%}
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: true
- service: automation.turn_on
entity_id: automation.set_quiet_level_selector

#Fetches powerful level from status and sets the selector accordingly
- alias: Set powerful level selector
Expand All @@ -93,16 +106,26 @@ automation:
platform: state
entity_id: input_select.heishamon_powermode
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetPowerfulMode
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{%- if states('input_select.heishamon_powermode') == "Off" -%}
0
{%- else -%}
{{ "%.0f" % ((states('input_select.heishamon_powermode') | replace("min", "") | int) / 30) }}
{%- endif -%}
- service: automation.turn_off
entity_id: automation.set_powerful_level_selector
- service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetPowerfulMode
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{%- if states('input_select.heishamon_powermode') == "Off" -%}
0
{%- else -%}
{{ "%.0f" % ((states('input_select.heishamon_powermode') | replace("min", "") | int) / 30) }}
{%- endif -%}
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: true
- service: automation.turn_on
entity_id: automation.set_powerful_level_selector

#Fetches heatmode from status and sets the selector accordingly
- alias: Set heatmode selector
Expand Down Expand Up @@ -140,30 +163,36 @@ automation:
platform: state
entity_id: input_select.heishamon_heatmode
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetOperationMode
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{%- if states('input_select.heishamon_heatmode') == "Heat" -%}
0
{%- elif states('input_select.heishamon_heatmode') == "Cool" -%}
1
{%- elif states('input_select.heishamon_heatmode') == "Auto" -%}
2
{%- elif states('input_select.heishamon_heatmode') == "DHW" -%}
3
{%- elif states('input_select.heishamon_heatmode') == "Heat+DHW" -%}
4
{%- elif states('input_select.heishamon_heatmode') == "Cool+DHW" -%}
5
{%- elif states('input_select.heishamon_heatmode') == "Auto(Head)+DHW" -%}
6
{%- elif states('input_select.heishamon_heatmode') == "Auto(Cool)" -%}
7
{%- elif states('input_select.heishamon_heatmode') == "Auto(Cool)+DHW" -%}
8
{%- endif -%}
- service: automation.turn_off
entity_id: automation.set_heatmode_selector
- service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetOperationMode
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{%- if states('input_select.heishamon_heatmode') == "Heat" -%}
0
{%- elif states('input_select.heishamon_heatmode') == "Cool" -%}
1
{%- elif states('input_select.heishamon_heatmode') == "Auto" -%}
2
{%- elif states('input_select.heishamon_heatmode') == "DHW" -%}
3
{%- elif states('input_select.heishamon_heatmode') == "Heat+DHW" -%}
4
{%- elif states('input_select.heishamon_heatmode') == "Cool+DHW" -%}
5
{%- elif states('input_select.heishamon_heatmode') == "Auto+DHW" -%}
6
{%- endif -%}
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: true
- service: automation.turn_on
entity_id: automation.set_heatmode_selector

#Fetches Z1 temperature from status and sets the selector accordingly
- alias: Set Z1 selector
Expand All @@ -183,12 +212,22 @@ automation:
platform: state
entity_id: input_number.heishamon_heatshift_z1
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetZ1HeatRequestTemperature
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{{ "%.0f" % (states('input_number.heishamon_heatshift_z1') | int) }}
- service: automation.turn_off
entity_id: automation.set_Z1_selector
- service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetZ1HeatRequestTemperature
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{{ "%.0f" % (states('input_number.heishamon_heatshift_z1') | int) }}
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: true
- service: automation.turn_on
entity_id: automation.set_Z1_selector

#Fetches Z2 temperature from status and sets the selector accordingly
- alias: Set Z2 selector
Expand All @@ -208,12 +247,22 @@ automation:
platform: state
entity_id: input_number.heishamon_heatshift_z2
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetZ2HeatRequestTemperature
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{{ "%.0f" % (states('input_number.heishamon_heatshift_z2') | int) }}
- service: automation.turn_off
entity_id: automation.set_Z2_selector
- service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetZ2HeatRequestTemperature
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{{ "%.0f" % (states('input_number.heishamon_heatshift_z2') | int) }}
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: true
- service: automation.turn_on
entity_id: automation.set_Z2_selector

#Fetches tank target temperature from status and sets the selector accordingly
- alias: Set tank target temperature selector
Expand All @@ -233,12 +282,22 @@ automation:
platform: state
entity_id: input_number.heishamon_tank_temp
action:
service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetDHWTemp
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{{ "%.0f" % (states('input_number.heishamon_tank_temp') | int) }}
- service: automation.turn_off
entity_id: automation.set_tank_target_temperature_selector
- service: mqtt.publish
data_template:
topic: panasonic_heat_pump/commands/SetDHWTemp
retain: false #IMPORTANT! ALWAYS set retain flag false for commands!
payload_template: >-
{{ "%.0f" % (states('input_number.heishamon_tank_temp') | int) }}
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
enabled: true
- service: automation.turn_on
entity_id: automation.set_tank_target_temperature_selector

# input_number #
################
Expand Down

0 comments on commit 0a9ee40

Please sign in to comment.