Yale Z-Wave Deadbolt log warning. Can someone explain?

I think this error may be because a sensor I’ve set up below cannot instantly read the battery level when HA is restarted as Z-wave is not ready for a few seconds/minutes after restart? Any way to fix that and remove the warning?

  - alias: 'Notify front door battery low'
    trigger:
      platform: numeric_state
      entity_id: zwave.frontdoor_deadbolt
      # Optional
      value_template: '{{ states.zwave.frontdoor_deadbolt.attributes.battery_level }}'
      below: 75
      # If given, will trigger when condition has been for X time.
      for:
        hours: 1
    action:
      - service: notify.hass_synochat
        data:
          message: "Deatbolt battery is below 75%"


2019-02-03 18:29:21 WARNING (MainThread) [homeassistant.helpers.condition] Value cannot be processed as a number: <state zwave.frontdoor_deadbolt=unknown; node_id=18, node_name=Assa Abloy Yale Key Free Touchscreen Deadbolt (YRD240), manufacturer_name=Assa Abloy, product_name=Yale Key Free Touchscreen Deadbolt (YRD240), friendly_name=Deadbolt @ 2019-02-03T18:29:21.207079+13:00> (Offending entity: )
    2019-02-03 18:29:21 WARNING (MainThread) [homeassistant.helpers.condition] Value cannot be processed as a number: <state zwave.frontdoor_deadbolt=initializing; node_id=18, node_name=Assa 
Abloy Yale Key Free Touchscreen Deadbolt (YRD240), manufacturer_name=Assa Abloy, product_name=Yale Key Free Touchscreen Deadbolt (YRD240), query_stage=CacheLoad, is_awake=True, is_ready=False, is_failed=False, is_info_received=True, max_baud_rate=40000, is_zwave_plus=False, capabilities={'routing', 'beaming', 'frequent'}, sentCnt=0, sentFailed=0, retries=0, receivedCnt=0, receivedDups=0, receivedUnsolicited=0, sentTS=2019-02-03 18:29:09:368 , receivedTS=2019-02-03 18:29:09:368 , lastRequestRTT=0, averageRequestRTT=0, lastResponseRTT=0, averageResponseRTT=0, friendly_name=Deadbolt @ 2019-02-03T18:29:21.752350+13:00> (Offending entity: )

I would guess that None is being returned from the template, since the battery level doesn’t exist yet, and the automation requires a number for the numeric_state platform. (That or some other non-number).

I would try this:

value_template: '{{ state_attr("zwave.frontdoor_deadbolt", "battery_level") | int(100) }}'

state_attr is recommended to better handle missing entities and attributes. If None is returned, the int filter will return 100, which will prevent the automation from being triggered until the real level is reported. Choose any number which works for you. If the battery level is valid, it will return the actual number instead.

http://jinja.pocoo.org/docs/dev/templates/#int

1 Like

Thank you so much for your input. That’s great to know. I’ll give this a try now.

EDIT: Works great, thank you! Error gone.