gomble
(Gomble)
January 22, 2021, 1:32pm
1
Hello i have a problem with notify groups my code below does not work:
notify:
- name: Family
platform: group
services:
- service: mobile_app_iphone1
- service: mobile_app_iphone2
- service: persistent_notification.create
I get following error:
Invalid config for [notify.group]: invalid slug persistent_notification.create (try persistent_notification_create) for dictionary value @ data['services'][2]['service']. Got 'persistent_notification.create'. (See ?, line ?).
Can anyone tell me why this error appear?
Try this
notify:
- name: Family
platform: group
services:
- service: notify.mobile_app_iphone1
data:
message: 'Notification text'
- service: notify.mobile_app_iphone2
data:
message: 'Notification text'
- service: persistent_notification.create
data:
message: 'Notification text'
gomble
(Gomble)
January 22, 2021, 1:49pm
3
Yes but i change the text via the automatation, example:
- alias: Fenster offen vergessen
trigger:
- platform: state
entity_id:
- binary_sensor.badezimmer_sensor_contact
- binary_sensor.dachfenster_garten_contact
- binary_sensor.dachfenster_strasse_contact
- binary_sensor.dachfenster_treppe_contact
to: 'on'
for: '01:00:00'
condition:
- condition: state
entity_id: group.fensterkontakte
state: 'on'
for: '01:00:00'
action:
- service: notify.family
data_template:
message: >
{% set open =
states.binary_sensor
|selectattr
('entity_id','in',state_attr
('group.fensterkontakte','entity_id')
)
|selectattr
('state','eq','on')
|map
(attribute='name')
|list %}
{{ open|join(', ') }} {{ '' if open|length > 1 else '' }} offen vergessen!
title: "Offenes Fenster !"
if i put the text into the notification group it is the same for all automatation…
you can try to put it in a script and call the script from the group.
gomble
(Gomble)
January 22, 2021, 1:52pm
5
How do you mean ?
I did not understood.
So you want you have different message for each notification which is provided by different data template?
gomble
(Gomble)
January 22, 2021, 2:00pm
7
I want to group my devices. If i remove:
- service: persistent_notification.create
my notifications work. I call from the automatation the notify group like this:
action:
- service: notify.family
and i also give with the automatation the message which has to appear on the mobile phones.
But i also wanted to add:
- service: persistent_notification.create
to my group, to show me a message in the message tab ofhomeassistant, after that i got the error above.
DO you have a service called notify.persistent_notification
?
gomble
(Gomble)
January 22, 2021, 2:09pm
9
No where i have to do this ?
Did you check the services? I have one but have to check how it got there.
gomble
(Gomble)
January 22, 2021, 2:25pm
13
Yes man this worked thank you !