fix HA shower time

This commit is contained in:
Paul
2019-10-15 18:26:58 +02:00
parent 66c8e919a9
commit 07f821590b
2 changed files with 19 additions and 17 deletions

View File

@@ -1,12 +1,13 @@
- id: boiler_shower - id: boiler_shower
alias: Alert shower time alias: Alert shower time
initial_state: true
trigger: trigger:
platform: mqtt platform: mqtt
topic: home/ems-esp/showertime topic: home/ems-esp/shower_data
action: action:
- service: notify.general_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: "{{ trigger.payload_json['duration'] }}"
# when ems-esp starts send boottime # when ems-esp starts send boottime

View File

@@ -1,3 +1,6 @@
# thermostat HC1
- platform: mqtt - platform: mqtt
state_topic: 'home/ems-esp/thermostat_data' state_topic: 'home/ems-esp/thermostat_data'
name: 'Current Room Temperature' name: 'Current Room Temperature'
@@ -15,16 +18,7 @@
name: 'Current Mode' name: 'Current Mode'
value_template: "{{ value_json.hc1.mode }}" value_template: "{{ value_json.hc1.mode }}"
# last time esp-esp was started # boiler
- platform: template
sensors:
boiler_boottime:
value_template: '{{ as_timestamp(states.automation.see_if_boiler_restarts.attributes.last_triggered) | timestamp_custom("%H:%M:%S %d/%m/%y") }}'
- platform: mqtt
state_topic: 'home/ems-esp/showertime'
name: 'Last shower duration'
force_update: true
- platform: mqtt - platform: mqtt
state_topic: 'home/ems-esp/boiler_data' state_topic: 'home/ems-esp/boiler_data'
@@ -137,6 +131,13 @@
unit_of_measurement: '%' unit_of_measurement: '%'
value_template: '{{ value_json.pumpMod }}' value_template: '{{ value_json.pumpMod }}'
# shower time duration
- platform: mqtt
name: 'Last shower duration'
state_topic: "home/ems-esp/shower_data"
value_template: "{{ value_json.duration }}"
force_update: true
- platform: template - platform: template
sensors: sensors:
showertime_time: showertime_time:
@@ -145,5 +146,5 @@
boiler_updated: boiler_updated:
value_template: '{{ as_timestamp(states.sensor.boiler_temperature.last_updated) | timestamp_custom("%H:%M on %d/%b") }}' value_template: '{{ as_timestamp(states.sensor.boiler_temperature.last_updated) | timestamp_custom("%H:%M on %d/%b") }}'
boiler_boottime:
value_template: '{{ as_timestamp(states.automation.see_if_boiler_restarts.attributes.last_triggered) | timestamp_custom("%H:%M:%S %d/%m/%y") }}'