mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-23 09:17:06 +00:00
Minimize configuration sample
This commit is contained in:
parent
7eb63a23b9
commit
48662967ec
@ -14,15 +14,36 @@ ha_release: 0.39
|
||||
|
||||
Telegram webhooks support as described in [docs](https://core.telegram.org/bots/webhooks).
|
||||
|
||||
With new component `telegram_webhooks` it is possible to send commands to home assistant via telegram bot. It works well with telegram notification: webhooks receive commands from user and notify send messages to user.
|
||||
With new component `telegram_webhooks` it is possible to send commands to Home Assistant via a Telegram bot. It works well with Telegram notification: webhooks receive commands from user and notify send messages to user.
|
||||
|
||||
Webhook responds only to:
|
||||
|
||||
- users listed in configuration, in telegram user_id format.
|
||||
- telegram servers (listed in webhooks [docs](https://core.telegram.org/bots/webhooks)) specified in trusted_networks
|
||||
|
||||
|
||||
To integrate this into Home Assistant, add the following section to your `configuration.yaml` file:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
http:
|
||||
base_url: <public_url>
|
||||
|
||||
telegram_webhooks:
|
||||
user_id:
|
||||
user1: USER_ID
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
|
||||
- **user_id** (*Required*): A list of user in the `user_id` Telegram format enabled to interact to webhook
|
||||
- **api_key** (*Optional*): The API token of your bot. If present, the webhook of bot is automatically registered to `public_url/api/telegram_webhooks`. If not present, manual registration is required.
|
||||
- **trusted_networks** (*Optional*): Telegram server access ACL as list. Defaults to `149.154.167.197-233`.
|
||||
|
||||
Full configuration sample:
|
||||
|
||||
```yaml
|
||||
# Example configuration.yaml entry
|
||||
http:
|
||||
base_url: <public_url>
|
||||
|
||||
@ -40,20 +61,18 @@ telegram_webhooks:
|
||||
user2: USER_ID
|
||||
```
|
||||
|
||||
Configuration variables:
|
||||
- **api_key** (*Optional*): the API token of your bot. If present webhook of bot is automatically registered to `public_url/api/telegram_webhooks`. If not present manual registration is required.
|
||||
- **trusted_networks** (*Optional*): telegram server access ACL (default to 149.154.167.197-233)
|
||||
- **user_id** (*Required*): list of user in user_id telegram format enabled to interact to webhook
|
||||
### {% linkable_title Configuration samples %}
|
||||
|
||||
Telegram webhooks raise an event `telegram.command` with a payload.
|
||||
|
||||
Telegram webhooks raise an event `telegram.command` with a payload
|
||||
```json{
|
||||
'command': '/thecommand'
|
||||
'args': 'strings after command'
|
||||
'user_id': 12345
|
||||
}
|
||||
|
||||
Automation example that realize simple test to command/notify interaction.
|
||||
|
||||
Automation example that realize simple test to command/notify interaction
|
||||
```yaml
|
||||
alias: 'telegram bot that reply pong to ping'
|
||||
hide_entity: true
|
||||
@ -68,7 +87,8 @@ action:
|
||||
message: 'pong'
|
||||
```
|
||||
|
||||
Example that show keyboard interaction with notify.telegram
|
||||
Example that show keyboard interaction with `notify.telegram`
|
||||
|
||||
```yaml
|
||||
trigger:
|
||||
platform: event
|
||||
@ -85,7 +105,8 @@ action:
|
||||
- '/siren'
|
||||
```
|
||||
|
||||
... and an automation to trigger a related command "/siren"
|
||||
and an automation to trigger a related command "/siren".
|
||||
|
||||
```yaml
|
||||
trigger:
|
||||
platform: event
|
||||
|
Loading…
x
Reference in New Issue
Block a user