Browse Source

Fixes to motion detected lights and minor changes

Joachim M. Giæver 1 year ago
parent
commit
717e9cf9c2

+ 35 - 0
automation/lights_turned_on_by.yaml

@@ -0,0 +1,35 @@
+# - alias: 'who turned on the light, the home assistant or the person?'
+#     description: ''
+#     trigger:
+#       - platform: state
+#         entity_id: light.inner_living_room_chandelier_light
+#     condition: []
+#     action:
+#       - choose:
+#           - conditions:
+#               - condition: template
+#                 value_template: '{{ trigger.to_state.context.user_id == none }}'
+#               - condition: template
+#                 value_template: '{{ trigger.to_state.context.parent_id == none }}'
+#             sequence:
+#               - service: notify.notify
+#                 data:
+#                   message: The light was turned physically
+#           - conditions:
+#               - condition: template
+#                 value_template: '{{ trigger.to_state.context.user_id == none }}'
+#             sequence:
+#               - service: notify.notify
+#                 data:
+#                   message: The light turned on the Home Assistant
+#         default: []
+#     mode: single
+
+blueprint:
+  domain: automation
+  name: Lights turned on by
+  description: >-
+    Was the light turned on by Home Assistant, or
+    someone/-thing else?
+trigger:
+  action: 

+ 0 - 84
script/homeassistant/confirmable_notification.yaml

@@ -1,84 +0,0 @@
-blueprint:
-  name: Confirmable Notification
-  description: >-
-    A script that sends an actionable notification with a confirmation before
-    running the specified action.
-  domain: script
-  source_url: https://github.com/home-assistant/core/blob/master/homeassistant/components/script/blueprints/confirmable_notification.yaml
-  input:
-    notify_device:
-      name: Device to notify
-      description: Device needs to run the official Home Assistant app to receive notifications.
-      selector:
-        device:
-          integration: mobile_app
-    title:
-      name: "Title"
-      description: "The title of the button shown in the notification."
-      default: ""
-      selector:
-        text:
-    message:
-      name: "Message"
-      description: "The message body"
-      selector:
-        text:
-    confirm_text:
-      name: "Confirmation Text"
-      description: "Text to show on the confirmation button"
-      default: "Confirm"
-      selector:
-        text:
-    confirm_action:
-      name: "Confirmation Action"
-      description: "Action to run when notification is confirmed"
-      default: []
-      selector:
-        action:
-    dismiss_text:
-      name: "Dismiss Text"
-      description: "Text to show on the dismiss button"
-      default: "Dismiss"
-      selector:
-        text:
-    dismiss_action:
-      name: "Dismiss Action"
-      description: "Action to run when notification is dismissed"
-      default: []
-      selector:
-        action:
-
-mode: restart
-
-sequence:
-  - alias: "Set up variables"
-    variables:
-      action_confirm: "{{ 'CONFIRM_' ~ context.id }}"
-      action_dismiss: "{{ 'DISMISS_' ~ context.id }}"
-  - alias: "Send notification"
-    domain: mobile_app
-    type: notify
-    device_id: !input notify_device
-    title: !input title
-    message: !input message
-    data:
-      actions:
-        - action: "{{ action_confirm }}"
-          title: !input confirm_text
-        - action: "{{ action_dismiss }}"
-          title: !input dismiss_text
-  - alias: "Awaiting response"
-    wait_for_trigger:
-      - platform: event
-        event_type: mobile_app_notification_action
-        event_data:
-          action: "{{ action_confirm }}"
-      - platform: event
-        event_type: mobile_app_notification_action
-        event_data:
-          action: "{{ action_dismiss }}"
-  - choose:
-      - conditions: "{{ wait.trigger.event.data.action == action_confirm }}"
-        sequence: !input confirm_action
-      - conditions: "{{ wait.trigger.event.data.action == action_dismiss }}"
-        sequence: !input dismiss_action