Skip to content

Instantly share code, notes, and snippets.

@rokam
Last active June 25, 2021 19:25
Show Gist options
  • Save rokam/1e887a3bb39dd9264d9a220ec516b2d7 to your computer and use it in GitHub Desktop.
Save rokam/1e887a3bb39dd9264d9a220ec516b2d7 to your computer and use it in GitHub Desktop.
Sends notification on low battery for SonOff DW2-Wifi
blueprint:
name: Sonoff DW2-Wifi low battery notification
description: Sends notification on low battery for DW2-Wifi
domain: automation
input:
door_sensor:
name: Door sensor
selector:
entity:
domain: binary_sensor
device_class: door
threshold:
name: Battery warning level threshold
description: Battery voltage below threshold are assumed to be low-battery.
default: 2.5
selector:
number:
min: 2.0
max: 3.0
unit_of_measurement: 'V'
mode: slider
step: 0.1
time:
name: Time to test on
description: Test is run at configured time
default: '12:00:00'
selector:
time: {}
actions:
name: Actions
description: Notifications or similar to be run.
selector:
action: {}
trigger:
- platform: time
at: !input 'time'
condition:
- condition: numeric_state
entity_id: !input 'door_sensor'
attribute: battery_level
below: !input 'threshold'
action:
- choose: []
default: !input 'actions'
mode: single
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment