kitchen_dashboard.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. input_boolean:
  2. kitchen_dashboard:
  3. name: "Kitchen: Dashboard"
  4. kitchen_trigger_dashboard:
  5. name: "Kitchen: Trigger dashboard"
  6. template:
  7. - trigger:
  8. platform: state
  9. entity_id: input_boolean.kitchen_trigger_dashboard
  10. to:
  11. - "on"
  12. - "off"
  13. binary_sensor:
  14. - name: "Kitchen: Trigger dashboard"
  15. state: "{{ true }}"
  16. auto_off: 5
  17. # Require: https://github.com/jmgiaever/home-assistant-blueprints/blob/master/automation/cast_lovelace_on_motion.yaml
  18. automation:
  19. - id: 'kitchen_dashboard'
  20. alias: "Kitchen: Cast lovelace on motion detection"
  21. description: ''
  22. use_blueprint:
  23. path: cast_lovelace_on_motion.yaml
  24. input:
  25. trigger_sensors:
  26. - binary_sensor.kitchen_trigger_dashboard
  27. - binary_sensor.kitchen_motion_sensor_home_security_motion_detection
  28. media_devices:
  29. - media_player.kitchen_display
  30. dashboard_path: lovelace
  31. dashboard_view: "{{ 'kitchen' if is_state('input_boolean.kitchen_dashboard', 'on') else 'home' }}"
  32. - id: "kitchen_dashboards_toggle"
  33. alias: "Kitchen: Toggle dashboard"
  34. trigger:
  35. platform: state
  36. entity_id: input_boolean.kitchen_dashboard
  37. to:
  38. - "on"
  39. - "off"
  40. action:
  41. - service: media_player.turn_off
  42. target:
  43. entity_id: media_player.kitchen_display
  44. - wait_template: "{{ is_state('media_player.kitchen_display', 'off') }}"
  45. - service: input_boolean.toggle
  46. target:
  47. entity_id: input_boolean.kitchen_trigger_dashboard