Telegram Notifier Not Working - Solved

Whenever I try to send a Telegram message, an error occurs in the logs:

2017-10-01 17:57:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=nofity, service=telegramme, service_data=title=Send a message, message=Leaving home, service_call_id=1960740464-8>
2017-10-01 17:57:03 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=1960740464-7>
2017-10-01 17:57:03 WARNING (MainThread) [homeassistant.core] Unable to find service nofity/telegramme

I’ve double and triple checked my configuration.yaml but can’t see what the problem might be:

telegram_bot:
  - platform: polling
    api_key: 12345678:jewfxkjwefjwhfxrfwhefxrerfe
    allowed_chat_ids:
      - 123456789

notify:
  - name: telegramme
    platform: telegram
    chat_id: 123456789

automation:    
  - alias: "Homekit Away Mode"
    trigger:
      - platform: state
        entity_id: input_boolean.wearehome
        from: 'on'
        to: 'off'
    action:
      - service: nofity.telegramme
        data:
          title: "Send a message"
          message: "Leaving home"

I am able to use the same API and chat ID to send messages to Telegram from command line on a Pi, so I know that’s working ok.

Can anyone suggestion any other ways to troubleshoot the problem please?

I’m using Hass.io 0.54.0.

Thanks in advance!

try putting the name ‘TELEGRAMME’ in capitals… think its the only way I could get the notify to work

I had high hopes for your suggestion as it made plausible sense given that the examples here https://home-assistant.io/components/notify.telegram/ are in Caps, but unfortunately this didn’t help me in the end as it still gives the same error.

Does Telegram work for anyone else in Hass.io?

Did you change the automation to use the capital version.

This works for me…

notify:
  - name: NOHOMETELEGRAM
    platform: telegram
    chat_id: 999999999

and the automation (run as a script in my example below)

nobodyhome:
  alias: Nobody Home
  sequence:
    - service: notify.NOHOMETELEGRAM
      data:
        message: 'Nobody Home - House is empty!'

Yeah, changed to capitals but didn’t work unfortunately. The only difference between yours and mine was the title line, so I removed it but that didn’t help either. Very odd indeed. Are you using Hass.io?

The error message always appears in lowercase despite the name being in uppercase:

WARNING (MainThread) [homeassistant.core] Unable to find service nofity/telegramme

I’m going to fire up a non-hass.io HA install on a spare Pi to see if that helps.

I’m not running hass.io, just generic HA on a debian install.

Have you tried a test using the send_message service from your defined telegram bot, i.e.
telegram_bot / send_message?

You can test it from the services developer tool pumping in some JSON such as:
{"message":"test","target":"999999999"}

That also works for me!

Great suggestion!! This actually worked!

So then, something wrong with my yaml perhaps. I’ll strip everything out and just leave a bare bones telegram setup to see if that helps. Thanks for the tip!

1 Like

tag the topic as solved please.

It’s not solved yet - it worked using developer tool but still doesn’t work using yaml. I’m trying a few options out at the moment so hopefully will have it solved soon.

Now it’s solved!! :grinning: Phew, got there in the end, thank you @pembo

Once I was able to confirm functionality with the developer tool I knew it had to be my yaml, so taking the script example you gave above I was able to work the following into my first example:

telegram_bot:
  - platform: polling
    api_key: 12345678:jewfxkjwefjwhfxrfwhefxrerfe
    allowed_chat_ids:
      - 123456789

notify:
  - name: telegramme
    platform: telegram
    chat_id: 123456789

script:
  telegr_off:
    alias: 'telegram off'
    sequence:
      - service: notify.teleme
        data:
          message: 'HA set to Away Mode'

automation:    
  - alias: "Homekit Away Mode"
    trigger:
      - platform: state
        entity_id: input_boolean.wearehome
        from: 'on'
        to: 'off'
    action:
      - service: script.telegr_off
1 Like

Hi, I also have a mistake similar to yours. I have enabled many chat_id but only for 3 of them in the blog I see the error “unable to find service notify.xxxx”