Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service call code for Alarm & TTS notifications #116

Open
BeardedTinker opened this issue Jun 23, 2024 · 0 comments
Open

Service call code for Alarm & TTS notifications #116

BeardedTinker opened this issue Jun 23, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation Enhancement New feature or request

Comments

@BeardedTinker
Copy link
Owner

Here are the examples for Alarm notification + TTS notifications.
Also, I've included sample Automation code.

Service call for Alarm notification

service: notify.mobile_app_pixel_7_pro
data:
  message: command_activity
  data:
    intent_package_name: com.google.android.deskclock
    intent_action: android.intent.action.SET_TIMER
    intent_extras: 'android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.LENGTH:1'

Service call for TTS notification

service: notify.mobile_app_pixel_7_pro
data:
  message: "TTS"
  data:
    tts_text: "Motion has been detected"
    media_stream: alarm_stream

And 2 simple automation:

alias: Send notification and alarm to Pixel
description: ""
trigger:
  - type: motion
    platform: device
    device_id: f46a7d284f919918254c6021e040b0da
    entity_id: eba83449aa09a124c6f4a16182e7e01d
    domain: binary_sensor
condition: []
action:
  - service: notify.mobile_app_pixel_7_pro
    metadata: {}
    data:
      message: Motion detected
      title: WARNING
  - service: notify.mobile_app_pixel_7_pro
    data:
      message: command_activity
      data:
        intent_package_name: com.google.android.deskclock
        intent_action: android.intent.action.SET_TIMER
        intent_extras: >-
          android.intent.extra.alarm.SKIP_UI:true,android.intent.extra.alarm.LENGTH:1
mode: single

and

alias: Notify by voice on motion - Pixel
description: ""
trigger:
  - type: motion
    platform: device
    device_id: f46a7d284f919918254c6021e040b0da
    entity_id: eba83449aa09a124c6f4a16182e7e01d
    domain: binary_sensor
condition: []
action:
  - service: notify.mobile_app_pixel_7_pro
    data:
      message: TTS
      data:
        tts_text: Or it will be delivered very late.
        media_stream: alarm_stream
mode: single
@BeardedTinker BeardedTinker added documentation Improvements or additions to documentation Enhancement New feature or request labels Jun 23, 2024
@BeardedTinker BeardedTinker self-assigned this Jun 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant