Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: Work Alarm Check
- description: ""
- trigger:
- - platform: time
- at: "23:00:00"
- enabled: true
- condition:
- - condition: or
- conditions:
- - condition: numeric_state
- entity_id: sensor.pixel_6_pro_volume_level_alarm
- below: 5
- - condition: state
- entity_id: sensor.pixel_6_pro_next_alarm
- state: unavailable
- action:
- - alias: Set up variables for the actions
- variables:
- action_ack: "{{ 'Ack_' ~ context.id }}"
- action_setvol: "{{ 'SetVol_' ~ context.id }}"
- action_setal: "{{ 'SetAl_' ~ context.id }}"
- - alias: Work Alarm Warning Message and Responses
- service: notify.mobile_app_pixel_6_pro
- data:
- message: >-
- <h1> !!! No Alarm Detected !!!</h1>You're
- <b>going to be late</b> for work tomorrow!
- data:
- actions:
- - action: "{{ action_ack }}"
- title: Ignore
- - action: "{{ action_setvol }}"
- title: Volume Up
- - action: "{{ action_setal }}"
- title: Alarm Set
- - alias: Wait for a response
- wait_for_trigger:
- - platform: event
- event_type: mobile_app_notification_action
- event_data:
- action: "{{ action_ack }}"
- - platform: event
- event_type: mobile_app_notification_action
- event_data:
- action: "{{ action_setvol }}"
- - platform: event
- event_type: mobile_app_notification_action
- event_data:
- action: "{{ action_setal }}"
- - alias: Perform the action
- choose:
- - conditions: "{{ wait.trigger.event.data.action == action_ack }}"
- sequence:
- - service: Input_boolean.turn_off
- target:
- entity_id: input_boolean.livingroom_climate_dropdown
- - conditions: "{{ wait.trigger.event.data.action == action_setal }}"
- sequence:
- - service: notify.mobile_app_pixel_6_pro
- data:
- message: command_activity
- data:
- intent_package_name: com.google.android.deskclock
- intent_action: android.intent.action.SET_ALARM
- intent_extras: >-
- android.intent.extra.alarm.HOUR:{{ 5
- }},android.intent.extra.alarm.MINUTES:{{ 45
- }},android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.RINGTONE:VALUE_RINGTONE_SILENT
- - conditions: "{{ wait.trigger.event.data.action == action_setvol }}"
- sequence:
- - service: notify.mobile_app_pixel_6_pro
- data:
- message: command_volume_level
- data:
- media_stream: alarm_stream
- command: 6
- mode: single
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement