mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
updates to HA config for shower time
This commit is contained in:
@@ -1,32 +1,42 @@
|
|||||||
|
- id: ems-esp_offline
|
||||||
|
alias: See if ems-esp goes offline
|
||||||
|
initial_state: true
|
||||||
|
trigger:
|
||||||
|
platform: state
|
||||||
|
entity_id: sensor.ems_esp_status
|
||||||
|
to: offline
|
||||||
|
action:
|
||||||
|
- service: notify.admin_notify
|
||||||
|
data_template:
|
||||||
|
title: EMS-ESP
|
||||||
|
message: 'gone offline'
|
||||||
|
|
||||||
|
- id: emsesp_restart
|
||||||
|
alias: See if ems-esp restarts
|
||||||
|
initial_state: true
|
||||||
|
trigger:
|
||||||
|
platform: mqtt
|
||||||
|
topic: home/ems-esp/start
|
||||||
|
payload: start
|
||||||
|
action:
|
||||||
|
- service: notify.admin_notify
|
||||||
|
data_template:
|
||||||
|
title: ems-esp has booted
|
||||||
|
message: EMS-ESP
|
||||||
|
- service: mqtt.publish
|
||||||
|
data_template:
|
||||||
|
topic: home/ems-esp/start
|
||||||
|
payload: '{{ now().strftime("%H:%M:%S %-d/%b/%Y") }}'
|
||||||
|
|
||||||
- id: boiler_shower
|
- id: boiler_shower
|
||||||
alias: Alert shower time
|
alias: Alert shower time
|
||||||
initial_state: true
|
initial_state: true
|
||||||
trigger:
|
trigger:
|
||||||
platform: mqtt
|
platform: state
|
||||||
topic: home/ems-esp/shower_data
|
entity_id: sensor.last_shower_duration
|
||||||
action:
|
action:
|
||||||
- service: notify.admin_notify
|
- service: notify.admin_notify
|
||||||
data_template:
|
data_template:
|
||||||
title: Shower finished at {{states.sensor.time.state}}
|
title: Shower finished at {{states.sensor.time.state}}
|
||||||
message: "{{ trigger.payload_json['duration'] }}"
|
message: "{{ states.sensor.last_shower_duration.state }}"
|
||||||
|
|
||||||
# when ems-esp starts send boottime
|
|
||||||
- id: boiler_restart
|
|
||||||
alias: See if ems-esp restarts
|
|
||||||
trigger:
|
|
||||||
platform: mqtt
|
|
||||||
topic: home/ems-esp/start
|
|
||||||
payload: 'start'
|
|
||||||
action:
|
|
||||||
- service: notify.admin_notify
|
|
||||||
data_template:
|
|
||||||
title: "ems-esp has booted"
|
|
||||||
message: "EMS-ESP"
|
|
||||||
- service: mqtt.publish
|
|
||||||
data_template:
|
|
||||||
topic: 'home/ems-esp/start'
|
|
||||||
payload: >
|
|
||||||
{{ now().strftime("%H:%M:%S %-d/%b/%Y") }}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -132,11 +132,11 @@
|
|||||||
value_template: '{{ value_json.pumpMod }}'
|
value_template: '{{ value_json.pumpMod }}'
|
||||||
|
|
||||||
# shower time duration
|
# shower time duration
|
||||||
|
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
name: 'Last shower duration'
|
name: 'Last shower duration'
|
||||||
state_topic: "home/ems-esp/shower_data"
|
state_topic: "home/ems-esp/shower_data"
|
||||||
value_template: "{{ value_json.duration }}"
|
value_template: "{{ value_json.duration | is_defined }}"
|
||||||
force_update: true
|
|
||||||
|
|
||||||
- platform: template
|
- platform: template
|
||||||
sensors:
|
sensors:
|
||||||
@@ -148,3 +148,9 @@
|
|||||||
|
|
||||||
boiler_boottime:
|
boiler_boottime:
|
||||||
value_template: '{{ as_timestamp(states.automation.see_if_boiler_restarts.attributes.last_triggered) | timestamp_custom("%H:%M:%S %d/%m/%y") }}'
|
value_template: '{{ as_timestamp(states.automation.see_if_boiler_restarts.attributes.last_triggered) | timestamp_custom("%H:%M:%S %d/%m/%y") }}'
|
||||||
|
|
||||||
|
# general
|
||||||
|
|
||||||
|
- platform: mqtt
|
||||||
|
state_topic: 'home/ems-esp/status'
|
||||||
|
name: 'ems-esp status'
|
||||||
|
|||||||
Reference in New Issue
Block a user