Guest User

Untitled

a guest
Jan 5th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. switch:
  2. - platform: dlink
  3. name: coffee
  4. host: x.x.x.x
  5. username: admin
  6. password: !secret dlink_password
  7.  
  8. sensor:
  9. - platform: template
  10. sensors:
  11. coffee_consumption:
  12. value_template: "{{float(states.switch.coffee.attributes['power_consumption'].split(' ')[0] if states.switch.coffee else 0)}}"
  13. friendly_name: 'Coffee Machine Consumption'
  14. unit_of_measurement: 'W'
  15.  
  16. automation:
  17. - action:
  18. - data:
  19. message: Water tank is empty.
  20. title: Coffee Machine
  21. service: notify.all
  22. alias: Coffee Machine tank empty
  23. condition:
  24. - condition: state
  25. entity_id: switch.coffee
  26. state: 'on'
  27. id: '1514720198787'
  28. # heating element was inactive for 15 minutes but machine is still on
  29. trigger:
  30. - above: '5'
  31. below: '500'
  32. for:
  33. minutes: 15
  34. entity_id: sensor.coffee_consumption
  35. platform: numeric_state
Add Comment
Please, Sign In to add comment