Skip to content

Instantly share code, notes, and snippets.

@Nokius
Last active October 30, 2020 11:55
Show Gist options
  • Save Nokius/7f0393d8c28bae5de160bd7740dbb860 to your computer and use it in GitHub Desktop.
Save Nokius/7f0393d8c28bae5de160bd7740dbb860 to your computer and use it in GitHub Desktop.
home assistant more interactive telegram bot

Home Assistant random snips telegram bot with interaction per state

Have a dynamic bot to responde on therten state.

- alias: Telegram controle xyz
  initial_state: 'on'
  trigger:
    platform: event
    event_type: telegram_command
    event_data:
      command: /xyz
  action:
    - choose:
        - conditions:
            - condition: templete
              value_template: "{{ is_state('automation.xyz', 'off') }}"
          sequence:
            - service: telegram_bot.send_message
              data_template:
                title: "xyz is *{{ states('automation.xyz') }}*"
                message: Shall I turn it on?
                inline_keyboard:
                - Nope:/stop
                - On:/xyz_on
      default:
        - service: telegram_bot.send_message
          data_template:
            title: "xyz is *{{ states('automation.xyz') }}*"
            message: Shall I turn it off?
            inline_keyboard:
            - Off:/xyz_off
            - Nope:/stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment