I want to use pushover for notification. All I find so far is entries in config.yaml. Is there some way I can setup a global push setup and use it from a automation?
Yes, pushover is configured in YAML.
Once you’ve done that, run a command line config check (to spot any YAML errors), and then restarted HA, you’ll find a notify
service in Developer Tools → Services.
So, in YAML I create the notification for each automation I need and validate it, restart. Then I can call it in the automation. Sound right?
Thanks
You should only need a single pushover notification service in the YAML. Before restarting you can try reloading “Rest Entities and Notify Services” from the “YAML Configuration Reloading” section of developer tools, you might not need a restart.
Once it’s loaded you call it from each automation, and as tinkerer said, you can test it from the services tab in developer tools.
The YAML configuration creates a notification service that you then use:
- service: notify.petunia
data:
title: "Incoming!"
message: "The whale is falling"
You just change the title and message to suit each time you use it.
I got it working and the notifications are working, now a twist I want to make. I want a regular notification and another that is for emergencies. Here is what I added to YAML and ONLY one notify pushover shows up. what to do? Thanks
notify:
- platform: pushover
name: Pushover_Emergency
api_key: API_Key
user_key: User_Key
data:
priority: 0
sound: siren
notify:
- platform: pushover
name: pushover
api_key: API_Key
user_key: User_Key
Can there be two notify to the same platform??
This is why you should run the command line config check (which requires SSH) when making changes to YAML.
See this part of the docs which explain that you need to do either:
notify:
- platform: pushover
name: Pushover_Emergency
api_key: API_Key
user_key: User_Key
data:
priority: 0
sound: siren
- platform: pushover
name: pushover
api_key: API_Key
user_key: User_Key
or
notify:
- platform: pushover
name: Pushover_Emergency
api_key: API_Key
user_key: User_Key
data:
priority: 0
sound: siren
notify petunia:
- platform: pushover
name: pushover
api_key: API_Key
user_key: User_Key
I see my error I will give it a try.
Thanks alot
Ed
I used your first example. I created an automation and I could select each instance, pushover and pushover_emergency. Both sent a push to my phone when I ran the actions. The missing part is that the data portion did not go through. The sound and the priority were omitted or ignored by pushover.net
Probably then you had a problem with your YAML - you did run the check command I linked to?
(I know you didn’t as the YAML has an error in it )
I checked the config.yaml from the Developer Tools and it came out valid. Running ha core check from the cli now, this is really slow. It eventually timed out with a “context deadline exceeded” message I have been using Studio Code Server to edit the YAML file
Here is a automation config from the automation for a pushover Emergency
id: '1661130401039'
alias: Fire Alarm Basement
description: ''
trigger:
- type: smoke
platform: device
device_id: 39f84bc5377ad237ed40db2867443c4b
entity_id: binary_sensor.bsment_smoke_smoke
domain: binary_sensor
condition: []
action:
- service: notify.pushover_emergency
data:
message: Smoke Detected
title: Basement Smoke
mode: single
would the data ie Priority and sound entered into the config.yaml for this notify show up here? Where can I see a log of what was sent to pushover
That doesn’t look right if you check the docs - the last three lines don’t belong there, they’re part of the notification service call you make in the automation.
notify:
- platform: pushover
name: Pushover_Emergency
api_key: API_Key
user_key: User_Key
action:
- service: notify.pushover_emergency
data:
message: Smoke Detected
title: Basement Smoke
data:
priority: 0
sound: siren
OK I understand what you are saying I think. So how do I get that data into the action ?
I totally missed the Data entry in the automation. I have the priority and the sound there. Not working yet . I am going to start over and use only one notify and add the extra data and see what happens
I finally got it to do what I wanted. In the Action segment under Data I added:
priority: 2
sound: siren
retry: 20
expire: 3600
The priority and the sound didn’t work until I added the retry and the expire times.
Sorry if I was a PIA, I appreciate your patience with me.