I have create a custom sensor from a ZWave attribute.
sensor:
- platform: template
sensors:
front_door_battery:
value_template: >-
{%- if states.zwave.schlage_be469_touchscreen_deadbolt_2 -%}
{{ states.zwave.schlage_be469_touchscreen_deadbolt_2.attributes.battery_level }}
{%- else -%}
101
{%- endif -%}
unit_of_measurement: '%'
entity_id: zwave.schlage_be469_touchscreen_deadbolt_2
I create a automation to know when the battery is low.
- id: '1543724536619'
alias: Front Door Low Battery SMS
trigger:
- below: '20'
entity_id: sensor.front_door_battery
platform: numeric_state
condition: []
action:
- data:
message: Front Door battery below 20%
target:
- '<private number>'
service: notify.twilio_sms
The metric shows up and I get the value displaying in the interface, but I get the following error on startup of Home Assistant
2019-04-04 07:19:55 WARNING (MainThread) [homeassistant.helpers.condition] Value cannot be processed as a number: <state sensor.front_door_battery=; unit_of_measurement=%, friendly_name=front_door_battery @ 2019-04-04T07:19:55.888586-07:00> (Offending entity: )
Anything I am doing wrong?