Aeotec Water Sensor 6 Binary Sensor

Hello

I have purchased an Aeotec Water Sensor 6 and added it successfully into my Z-Wave. I am using the standard Z-Wave with HA Core and I am on 0.116.2. I have an automation that works when the sensor gets wet. Here is that automation:

# Automation
alias: Laundry Room Leak
description: 'Notify if water detected in Laundry Room'
trigger:
- platform: state
  entity_id: sensor.laundry_water_flood
  from: '0'
  to: '2'
condition: []
action:
- service: notify.mobile_app_mytelephone
  data:
    message: Laundry Room Leaking!
mode: single

However, I cannot get a binary sensor to work and show me the status. I have tried several different methods, combed through here, and cannot get it to update. I am assuming I am missing a syntax or something. Here is my Binary Sensor:

# Binary Sensor
- platform: template
  sensors:
    laundry_water_leak_status:
      friendly_name: 'Laundry Water Leak'
      unique_id: leakl001
      device_class: moisture
      value_template: >-
        {% if is_state('sensor.laundry_water_flood', '2')%}
        Wet!
        {% elif is_state('sensor.laundry_water_flood', '0')%}
        Dry
        {% endif %}        

If anyone could advise me on how to set this Binary Sensor up so that I can see the status of the water sensor I would appreciate it.

The value template is not written as a binary sensor. Your template is returning “wet” and “dry” instead of True or False.

You probably just want:

value_template: "{{ is_state('sensor.laundry_water_flood', '2') }}"

So I am making it more complex than it needs to be? Thank you. I will try your suggestion.

If you want a binary sensor, I think so. My example follows the ones in the docs which use other similar sensors: https://www.home-assistant.io/docs/z-wave/entities#access-control-entity

So, due to the recommendation from @freshcoast this could work:

binary_sensor:
  - platform: template
    sensors:
      laundry_water_leak_status:
        friendly_name: 'Laundry Water Leak'
        unique_id: leakl001
        device_class: moisture
        value_template: >-
          {{ states('sensor.laundry_water_flood')|float > 0 }}

or replace last two lines whith

value_template: "{{ is_state('sensor.laundry_water_flood', '1') }}"

whereby ‘1’ could be an ‘2’ due to your multisensor configuration

The solution worked great! Thank you @freshcoast and @honikos for your help