Skip to content

Telegram Bot doc enhancements with callback queries and more notification options#2508

Merged
balloob merged 1 commit into
home-assistant:nextfrom
azogue:telegram-callbacks
May 10, 2017
Merged

Telegram Bot doc enhancements with callback queries and more notification options#2508
balloob merged 1 commit into
home-assistant:nextfrom
azogue:telegram-callbacks

Conversation

@azogue
Copy link
Copy Markdown
Member

@azogue azogue commented Apr 25, 2017

Description:
Telegram Bot enhancements with callback queries and more notification options. Documentation of new parameters with yaml automation examples.

Pull request in home-assistant (if applicable): home-assistant/core#7294

@mention-bot
Copy link
Copy Markdown

@azogue, thanks for your PR! By analyzing the history of the files in this pull request, we identified @fabaff, @balloob and @icovada to be potential reviewers.

Copy link
Copy Markdown
Contributor

@Landrash Landrash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really good in general.
Some minor clean up is preferred and then this can be merged after parent PR is merged.

- **title** (*Optional*): Will be composed as '%title\n%message'.
- **parse_mode** (*Optional*): Parser for the message text: 'html' or 'markdown'.
- **timeout** (*Optional*): If this value is specified, use it as the definitive timeout (in seconds) for urlopen() operations.
- **disable_notification** (*Optional*): Sends the message silently. iOS users will not receive a notification, Android users will receive a notification with no sound.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be good to include what web users receive.

```

- **edit_message** or **edit_caption** (*Required*):
- **message_id** or **inline_message_id** (*Required*): id of the message to be edited.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of extra indentation here.

To use notifications, please see the [getting started with automation page](/getting-started/automation/).

### {% linkable_title Common message data parameters %}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

Configuration variables:

callback_query_id: '{{ trigger.event.data.id }}'
show_alert: false
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

Configuration variables:

- '/remove button'
...
```

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

Configuration variables:


Text repeater:
```yaml
- alias: 'telegram bot that repeats text'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preference of using capital letter of Telegram since it's used as a name throughout this documentation.


Message editor:
```yaml
- alias: 'telegram bot last sended msg edit'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preference of using capital letter of Telegram since it's used as a name throughout this documentation.


Keyboard editor:
```yaml
- alias: 'telegram bot keyboard edit'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preference of using capital letter of Telegram since it's used as a name throughout this documentation.


Only acknowledges the 'NO' answer:
```yaml
- alias: 'telegram bot simply acknowledges'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preference of using capital letter of Telegram since it's used as a name throughout this documentation.

show_alert: false
```

For a more complex usage of the `telegram_bot` capabilities, using [AppDaemon](https://home-assistant.io/docs/ecosystem/appdaemon/tutorial/) is advised. No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wouldn't happen to have an example to link to except for the AppDaemon tool?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for your review. I'm going to try again.

On the AppDaemon tool, it is my intention to link or include in the documentation a simple example, perhaps with the same behavior of the yaml examples. My uses are too complex to use as examples...

Do you think the screenshots are necessary too? (home-assistant/core#7294)

Also, I think I need to close the smtp PR (was accidentally merged with this one) and make it again. I don't know how to remove files from the PR, sorry!!

Thanks a lot!

@Landrash Landrash added Enhancement new-feature This PR adds documentation for a new Home Assistant feature to an existing integration labels Apr 27, 2017
@azogue
Copy link
Copy Markdown
Member Author

azogue commented May 3, 2017

@Landrash, I think I'm finished. Waiting for the home-assistant review to validate the new doc.

Do you want me to include the screenshots of the bot example?


A command looks like `/thecommand`, or `/othercommand with some args`.

When received by hass it will fire a `telegram_command` event on the event bus with the following `event_data`:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using hass an write out Home Assistant.
There's a few more examples but I won't mark them.

@azogue
Copy link
Copy Markdown
Member Author

azogue commented May 5, 2017

@Landrash,
I've made a new PR (#2573) to avoid the conflicting files (I've screwed it up with this PR and a mix of local branches), I'm sorry
When reviewed, I will close this.

I think it's ready, finally.

…ments with callback queries and more notification options

Telegram Bot doc changes for pull request #7294: some required fixes and an example of an AppDaemon app.

Telegram Bot doc changes for pull request #7294: fix

Telegram Bot doc changes for pull request #7294: minimal clarification about disabling notifications for Telegram web users

Telegram Bot doc changes for pull request #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 #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 #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 #7294: change 'hass' to 'Home Assistant'
@balloob
Copy link
Copy Markdown
Member

balloob commented May 10, 2017

Thanks! 🎉

@balloob balloob merged commit 68a6187 into home-assistant:next May 10, 2017
@azogue azogue deleted the telegram-callbacks branch May 10, 2017 16:47
# Example configuration.yaml entry
# Example configuration.yaml entry for the Telegram Bot
telegram_bot:
platform: webhooks
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should assume that a user has exposed the install to the outside, which is required for webhooks. Better to suggest the polling platform.

Use Telegram on your mobile device to send messages or commands to your Home Assistant.
Use Telegram on your mobile or desktop device to send and receive messages or commands to/from your Home Assistant.

This component creates notification services to send, or edit previously sent, messages from a [Telegram Bot account](https://core.telegram.org/bots) configured either with the [polling](/_components/telegram_bot.polling.markdown) method or with the [webhooks](/_components/telegram_bot.webhooks.markdown) one, and trigger events when receiving messages.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The links for polling and webhooks are incorrect. They should target:
/components/telegram_bot.polling/
/components/telegram_bot.webhooks/

@azogue azogue restored the telegram-callbacks branch May 21, 2017 10:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-feature This PR adds documentation for a new Home Assistant feature to an existing integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants