Loents
(Loents)
November 25, 2020, 8:50pm
1
There is a need to send the same notification to several phones via Telegram, I am trying to describe them like this …
action:
- service: >
notify.telegram_id_1
notify.telegram_id_2
data:
message: |
{{"\U0001F6A8"}}
but service doesn’t want to work like that, tell me how to write this block correctly?
notify:
- [YOUR TELEGRAM PLATFORM 1]
- [YOUR TELEGRAM PLATFORM 2]
- name: everyone
platform: group
services:
- telegram 1
- telegram 2
Then…
- service: notify.everyone
data:
message: |
{{"\U0001F6A8"}}
Loents
(Loents)
November 25, 2020, 9:32pm
3
I have entries like this in cofiguration.yaml:
telegram_bot:
- platform: polling
api_key: !secret api_key_telegram
allowed_chat_ids:
- !secret telegram_id_1
- !secret telegram_id_2
notify:
- name: telegram_id_1
platform: telegram
chat_id: !secret telegram_id_1
- name: telegram_id_2
platform: telegram
chat_id: !secret telegram_id_2
sorry, but I didn’t understand how I need to change them
You need to add a group to the bottom of the notify bit, to create a notification group, and then you send the message to the group.
I’ve literally put the code in my post, all you have to do is change the last two lines to your actual notifier names.
Loents
(Loents)
November 26, 2020, 2:57pm
5
anon43302295:
notify.everyone
I did just that, I just copied your text, but by the time I’m not very well versed in all the nuances, and it took me a long time to understand that you do not have a service word - service
- name: telegram_all
platform: group
services:
- service: telegram_id_1
- service: telegram_id_2
this is how it became right and worked, thanks a lot anyway
2 Likes