Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias: Pure Scooter Charging
- description: >-
- When ARRIVED home using scooter (ESPrence, BT), push notification for charging
- duration is sent (HA Companion push notification to Pixel), turn on switch for
- duration as requested (TP Kasa Plug, WiFi)
- trigger:
- - platform: state
- entity_id:
- - sensor.pure_scooter_ble
- to: snug
- from: not_home
- for:
- hours: 0
- minutes: 0
- seconds: 0
- condition: []
- action:
- - alias: Set up variables for the actions
- variables:
- action_ign: "{{ 'Ign_' ~ context.id }}"
- action_p4m: "{{ 'P4m_' ~ context.id }}"
- action_p2h: "{{ 'P2h_' ~ context.id }}"
- - alias: Work Alarm Warning Message and Responses
- service: notify.mobile_app_pixel_6_pro
- data:
- message: ""
- title: Home Assistant
- data:
- image: /local/purechargestart.png
- actions:
- - action: "{{ action_ign }}"
- title: Ignore
- - action: "{{ action_p4m }}"
- title: 45 Minutes
- - action: "{{ action_p2h }}"
- title: 2 Hours
- - alias: Wait for a response
- wait_for_trigger:
- - platform: event
- event_type: mobile_app_notification_action
- event_data:
- action: "{{ action_ign }}"
- - platform: event
- event_type: mobile_app_notification_action
- event_data:
- action: "{{ action_p4m }}"
- - platform: event
- event_type: mobile_app_notification_action
- event_data:
- action: "{{ action_p2h }}"
- - alias: Perform the action
- choose:
- - conditions: "{{ wait.trigger.event.data.action == action_ign }}"
- sequence:
- - service: notify.mobile_app_pixel_6_pro
- data:
- message: clear_notification
- data:
- tag: phone-alarm-reminder
- - conditions: "{{ wait.trigger.event.data.action == action_p2h }}"
- sequence:
- - service: script.pure_scooter_charge_2_hours
- data: {}
- - conditions: "{{ wait.trigger.event.data.action == action_p4m }}"
- sequence:
- - service: script.pure_scooter_charge_45_minutes
- data: {}
- mode: single
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement