GMFalka
(Gm Falka)
March 7, 2017, 2:32pm
1
Hey!
After fidling a bit with chat_id vs user_id, i got hass to boot up but the webhook still not working.
This is the error i got:
telegram.error.BadRequest: 'Bad Request: bad webhook: Webhook can be set up only on ports 80, 88, 443 or 8443
Anyone knows how to fix this?
Kind regards,
Falka
Not sure. Is your home-assistant exposed to the internet ? webhook requires this.
any newswith the webhooks?
I’ve tried to run it, but got the very same error
update:
I’ve configured another bot [didn’t want to mess with my “main” buddy, who helps me with other things ;)]
this time everything went smooth, and webhooks works fine.
one thing I’ve added in comparison with first bot is custom url with proper port. just to override base_url configuration [even tho it’s the same url, I’ve got different port attached to hass.io dashboard]. worked like a charm
km4lin
October 2, 2018, 11:05pm
6
Could you tell me how you configured bot? I have the same error:
telegram.error.BadRequest: Bad webhook: webhook can be set up only on ports 80, 88, 443 or 8443
Ciquattro
(Ciquattro)
October 3, 2018, 11:43am
7
you have to add
url: “homeassistant public ip/dns”:8443/80/88/443 (choose only one port)
example: myhome.dyndns.org:8443
make a port forwarding on your router from source port 8443/80/88/443 to destination port 8443/80/88/443 for your hassio device.
scote
(Scott Pattinson)
October 27, 2018, 3:42pm
8
In addition to the above you have to add “server_port: 8443” to your http config, it is not read off the end of the url like I was expecting
Murales
(Giorgio)
December 27, 2020, 2:58pm
9
Thank you so much! You made my bot working again
niro1987
(Niels)
August 3, 2022, 8:31pm
10
Got it working like this, with port 8443 forwarded to my HomeAssistant server, 8123 is still my server port.
telegram_bot:
- platform: webhooks
url: !secret telegram_url # myhome.example.org:8443
api_key: !secret telegram_api_key # 123456789-some-randomstring-hash
allowed_chat_ids: !secret telegram_allowed_chat_ids # [1234567890, -9876543210]