Telegram automation not working

Hi folks,

Have successfully created telegram integration, confirmed by sending a “test” message through service. Afterwards created a automation to send a message after light turns on.

configuration.yaml

### Telegram configs ###
telegram_bot:
  platform: polling
  api_key: !secret telegram_rockasbot_apiKey
  allowed_chat_ids:
    - !secret telegram_chatID
    #- !secret chatid02

notify:
  - name: telegram
    platform: telegram
    chat_id: !secret telegram_chatID

automation.yaml

- id: '1608067011813'
  alias: Teste
  trigger:
  - platform: state
    entity_id: light.yeelight_office_light
    to: "on"
  action:
    - service: notify.telegram
      data:
        message: "Luz do escritório acesa"

see trigger working but not receiving message…

image

what am I missing here?

Thanks.

Are you sending to a group like home assistant alerts? If so you’ll need to add allowed_chat_ids also for the group.
In telegram do you have IDBot, BotFather, telegram and another if so thats your group.

1 Like

no, alerts are sent to a singular person, singular chat_id.
using BotFather…did test within HA invoking notify service and worked perfectly.

what am I missing?

Try following this tutorial, hes using the same polling solution. I thought I had a user account but inadvertently created a group, which does have some benefits that you can add family members to it.
Telegram
And
Telegram2
Also send a message to the bot in telegram create a new message and write @mybotname and send ‘hello’ , test again
Also try adding title: test, I’ve seen somewhere that it needs it.

Since you have tested the telegram bot and successful in receiving the message through the service, it wont be an issue with telegram bot. Try this automation.

- id: '1608067011813'
  alias: Teste
  trigger:
  - platform: state
    entity_id: light.yeelight_office_light
    from: "off"
    to: "on"
  action:
    - service: notify.telegram
      data:
        message: "Luz do escritório acesa"

finally got why was failing…binary off set!
instead o active parse_mode to html, changed message and it worked :expressionless:

thanks guys.

1 Like

is it possible to create an alert for when a temperature passes x value?
Light alerts are working fine.
Now I would like to have an alert for the maximum temperature of a probe.