You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Telegram Bot doc changes for pull request home-assistant#7294: Telegram Bot enhancements with callback queries and more notification options (home-assistant#2508)
Telegram Bot doc changes for pull request home-assistant#7294: some required fixes and an example of an AppDaemon app.
Telegram Bot doc changes for pull request home-assistant#7294: fix
Telegram Bot doc changes for pull request home-assistant#7294: minimal clarification about disabling notifications for Telegram web users
Telegram Bot doc changes for pull request home-assistant#7294: added new notification services (like in the `mediaplayer` component doc); added a description to how operates now the `notify.telegram` platform; changed service calls from `notify/telegram_bot` to `telegram_bot/EXPLICIT_NEW_SERVICE` in some of the yaml examples and in the appdaemon example.
Telegram Bot doc changes for pull request home-assistant#7294: added `parse_mode` global config variable in webhooks and polling platforms; fixed links to /components/notify.telegram
Telegram Bot doc changes for pull request home-assistant#7294: removed complex usage of telegram_bot services (moved to the telegram_bot doc); removed api_key from required params; removed multiple target feature (it can be done with the telegram_bot services or simply defining more than one notifier); added keyboard and inline_keyboard config vars to every type of notification.
Telegram Bot doc changes for pull request home-assistant#7294: change 'hass' to 'Home Assistant'
Copy file name to clipboardExpand all lines: source/_components/notify.telegram.markdown
+48-7Lines changed: 48 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,8 @@ The `telegram` platform uses [Telegram](https://web.telegram.org) to delivery no
18
18
The requirements are:
19
19
20
20
- You need a [Telegram bot](https://core.telegram.org/bots). Please follow those [instructions](https://core.telegram.org/bots#6-botfather) to create one and get the token for your bot. Keep in mind that bots are not allowed to contact users. You need to make the first contact with your user. Meaning that you need to send a message to the bot from your user.
21
-
- The `chat_id` of an user.
21
+
- You need to configure a [Telegram bot in Home Assistant](/components/telegram_bot) and define there your API key and the allowed chat ids to interact with.
22
+
- The `chat_id` of an allowed user.
22
23
23
24
To retrieve your `chat_id`, contact any of the Telegram bots created for this purpose (@myidbot, @get_id_bot)
24
25
@@ -45,22 +46,51 @@ $ python3
45
46
To enable Telegram notifications in your installation, add the following to your `configuration.yaml` file:
46
47
47
48
```yaml
48
-
# Example configuration.yaml entry
49
+
# Example configuration.yaml entry for the Telegram Bot
50
+
telegram_bot:
51
+
platform: webhooks
52
+
api_key: ABCDEFGHJKLMNOPQRSTUVXYZ
53
+
allowed_chat_ids:
54
+
- CHAT_ID_1
55
+
- CHAT_ID_2
56
+
- CHAT_ID_3
57
+
58
+
# Example configuration.yaml entry for the notifier
49
59
notify:
50
60
- name: NOTIFIER_NAME
51
61
platform: telegram
52
-
api_key: ABCDEFGHJKLMNOPQRSTUVXYZ
53
-
chat_id: YOUR_CHAT_ID
62
+
chat_id: CHAT_ID_2
54
63
```
55
64
56
65
Configuration variables:
57
66
58
67
- **name** (*Optional*): Setting the optional parameter `name` allows multiple notifiers to be created. The default value is `notify`. The notifier will bind to the service `notify.NOTIFIER_NAME`.
59
-
- **api_key** (*Required*): The API token of your bot.
60
68
- **chat_id** (*Required*): The chat ID of your user.
61
69
62
70
To use notifications, please see the [getting started with automation page](/getting-started/automation/).
63
71
72
+
### {% linkable_title Text message %}
73
+
74
+
```yaml
75
+
...
76
+
action:
77
+
service: notify.NOTIFIER_NAME
78
+
data:
79
+
title: '*Send a message*'
80
+
message: 'That's an example that _sends_ a *formatted* message with a custom keyboard.'
81
+
data:
82
+
keyboard:
83
+
- '/command1, /command2'
84
+
- '/command3, /command4'
85
+
```
86
+
87
+
Configuration variables:
88
+
89
+
- **message** (*Required*): Message text.
90
+
- **title** (*Optional*): Will be composed as '%title\n%message'.
91
+
- **keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom keyboard.
92
+
- **inline_keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with asociated callback data.
93
+
64
94
### {% linkable_title Photo support %}
65
95
66
96
```yaml
@@ -81,10 +111,15 @@ action:
81
111
caption: I.e. for a Title
82
112
```
83
113
114
+
Configuration variables:
115
+
84
116
- **url** or **file** (*Required*): For local or remote path to an image.
85
117
- **caption** (*Optional*): The title of the image.
86
118
- **username** (*Optional*): Username for a URL which require HTTP basic authentication.
87
119
- **password** (*Optional*): Username for a URL which require HTTP basic authentication.
120
+
- **keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom keyboard.
121
+
- **inline_keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with asociated callback data.
122
+
88
123
89
124
### {% linkable_title Document support %}
90
125
@@ -99,13 +134,16 @@ action:
99
134
document:
100
135
file: /tmp/whatever.odf
101
136
caption: Document Title xy
102
-
103
137
```
104
138
139
+
Configuration variables:
140
+
105
141
- **url** or **file** (*Required*): For local or remote path to a document.
106
142
- **caption** (*Optional*): The title of the document.
107
143
- **username** (*Optional*): Username for a URL which require HTTP basic authentication.
108
144
- **password** (*Optional*): Username for a URL which require HTTP basic authentication.
145
+
- **keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom keyboard.
146
+
- **inline_keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with asociated callback data.
109
147
110
148
### {% linkable_title Location support %}
111
149
@@ -123,7 +161,10 @@ action:
123
161
longitude: 117.22743
124
162
```
125
163
164
+
Configuration variables:
165
+
126
166
- **location** (*Required*): For local or remote path to an image.
127
167
- **latitude** (*Required*): The latitude to send.
128
168
- **longitude** (*Required*): The longitude to send.
129
-
169
+
- **keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom keyboard.
170
+
- **inline_keyboard** (*Optional*): List of rows of commands, comma-separated, to make a custom inline keyboard with buttons with asociated callback data.
0 commit comments