Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better Battery Templates for z-wave battery powered devices #104

Open
brianjking opened this issue May 16, 2017 · 1 comment
Open

Better Battery Templates for z-wave battery powered devices #104

brianjking opened this issue May 16, 2017 · 1 comment

Comments

@brianjking
Copy link
Owner

battery_level_warning:
        friendly_name: 'Front Sensor Battery Level Warning'
        value_template: >
          {% if states('sensor.aeotec_zw100_multisensor_6_battery_level_5_0') | float < 10 or
                states('sensor.aeotec_zw120_door_window_sensor_gen5_battery_level_8_0') | float < 10 or
                states('sensor.aeotec_zw120_door_window_sensor_gen5_battery_level_9_0') | float < 10
          %}
            Replace
          {% elif states('sensor.aeotec_zw100_multisensor_6_battery_level_5_0') | float < 25 or
                  states('sensor.aeotec_zw120_door_window_sensor_gen5_battery_level_8_0') | float < 25 or
                  states('sensor.aeotec_zw120_door_window_sensor_gen5_battery_level_9_0') | float < 25 
          %}
            Low
          {% else %}
            Good
          {% endif %}
@brianjking
Copy link
Owner Author

  - alias: Battery level low
    trigger:
      platform: state
      entity_id: sensor.battery_level_warning
      state: 'Low'
    action:
      - service: tts.google_say
        entity_id: media_player.office_google_home
        data:
          message: 'Sensor battery low.'
      - service: notify.nexus5x
        data:
          title: 'Sensor battery low'
          message: 'Sensor battery low.'

  - alias: Replace battery
    trigger:
      platform: state
      entity_id: sensor.battery_level_warning
      state: 'Replace'
    action:
      - service: tts.google_say
        entity_id: media_player.office_google_home
        data:
          message: 'Replace sensor battery.'
      - service: notify.nexus5x
        data:
          title: 'Replace sensor battery'
          message: 'Replace sensor battery.'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant