2020-06-07 19:30:34 +00:00
# - platform: mqtt
# name: "Washer"
# state_topic: "zwave2mqtt/washer/50/1/0"
# device_class: "power"
# unit_of_measurement: "kWh"
2019-11-08 17:54:11 +00:00
2020-06-07 19:30:34 +00:00
# - platform: mqtt
# name: "Washer Power 1"
# state_topic: "zwave2mqtt/washer/49/1/4"
# device_class: "power"
# unit_of_measurement: "W"
2019-11-08 17:54:11 +00:00
2020-06-07 19:30:34 +00:00
# - platform: mqtt
# name: "Washer_Power"
# state_topic: "zwave2mqtt/washer/50/1/2"
# device_class: "power"
# unit_of_measurement: "W"
2019-11-08 17:54:11 +00:00
2020-06-07 19:30:34 +00:00
# - platform: mqtt
# name: "Washer Power 3"
# state_topic: "zwave2mqtt/washer/50/1/9"
# device_class: "power"
# unit_of_measurement: "W"
2019-11-08 17:54:11 +00:00
2020-06-07 19:30:34 +00:00
# - platform: mqtt
# name: "Washer Power kwh"
# state_topic: "zwave2mqtt/washer/50/1/1"
# device_class: "power"
# unit_of_measurement: "kWh"
- platform : template
sensors :
washer_power :
friendly_name : "Washer Power"
entity_id : sensor.time
unit_of_measurement : ''
value_template : >-
{{ states.switch.washer.attributes.current_power_w | int }}
low_battery :
friendly_name : 'Low Battery'
entity_id : sensor.time
value_template : >
{%- set threshold = 15 -%}
{%- set domains = ['light', 'switch', 'sensor', 'zwave', 'lock', 'binary_sensor'] -%}
{%- for domain in domains -%}
{%- for item in states[domain] if ((item.attributes.battery_level is defined and item.attributes['battery_level'] | int < threshold) or ("battery" in item.name | lower and ((item.state | int < threshold and item.state|int != 0) or item.state | lower == "low" or item.state | lower == "unknown"))) -%}
{{ item.attributes.friendly_name }} (
{%- if item.attributes.battery_level is defined -%}
{{ item.attributes.battery_level}}
{%- else -%}
{{item.state}}
{%- endif -%}%)
{%- if not loop.last -%}
{{', ' }}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}