Hello,
I am just a new user of Home Assistant. I have tried to configure Telegram Notification. I have followed all instructions as described https://home-assistant.io/components/notify.telegram/, including configuration.yaml . I have also created Bot and tested that it is working.
I am not sure how I can receive notifications to sent by Home Assistant to Telegram bot. Could you please guide me? Not sure if problem is caused of Phyton version and how to fix it.
Tank you!
I am having following Errors:
Please advise.
INFO:homeassistant.core:Bus:Handling <Event call_service[L]: service=NAME, service_call_id=1396xxxxxxxxxxx,
domain=notify, service_data=message=The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!>
ERROR:homeassistant.components.notify.telegram:Error sending message.
Traceback (most recent call last):
File "/home/ivko/.homeassistant/lib/telegram/utils/request.py", line 77, in decorator
return func(*args, **kwargs)
File "/home/ivko/.homeassistant/lib/telegram/utils/request.py", line 173, in post
result = urlopen(request, **urlopen_kwargs).read()
File "/usr/lib64/python3.4/urllib/request.py", line 161, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python3.4/urllib/request.py", line 469, in open
response = meth(req, response)
File "/usr/lib64/python3.4/urllib/request.py", line 579, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python3.4/urllib/request.py", line 507, in error
return self._call_chain(*args)
File "/usr/lib64/python3.4/urllib/request.py", line 441, in _call_chain
result = func(*args)
File "/usr/lib64/python3.4/urllib/request.py", line 587, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/homeassistant/components/notify/telegram.py", line 60, in send_message
text=title + " " + message)
File "/home/iv/.homeassistant/lib/telegram/bot.py", line 128, in decorator
result = func(self, *args, **kwargs)
File "/home/iv/.homeassistant/lib/telegram/bot.py", line 145, in decorator
return Bot._post_message(url, data, kwargs)
File "/home/iv/.homeassistant/lib/telegram/bot.py", line 175, in _post_message
network_delay=network_delay)
File "/home/iv/.homeassistant/lib/telegram/utils/request.py", line 85, in decorator
raise Unauthorized()
telegram.error.Unauthorized: Unauthorized
INFO:homeassistant.core:Bus:Handling <Event service_executed[L]: service_call_id=1396xxxx>
INFO:homeassistant.components.http:"POST /api/services/notify/NAME HTTP/1.1" 200 -
INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sun.sun, new_state=<state sun.sun=above_horizon; friendly_name=Sun, elevation=8.42, next_setting=18:09:24 17-04-2016, next_rising=04:00:16 18-04-2016 @ 09:58:08 17-04-2016>, old_state=<state sun.sun=above_horizon; friendly_name=Sun, elevation=8.57, next_setting=18:09:24 17-04-2016, next_rising=04:00:16 18-04-2016 @ 09:58:08 17-04-2016>>
INFO:homeassistant.core:Bus:Handling <Event call_service[L]: service=NAME, service_call_id=1396xxxxx, domain=notify, service_data=message=The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!>
ERROR:homeassistant.components.notify.telegram:Error sending message.
Traceback (most recent call last):
File "/home/iv/.homeassistant/lib/telegram/utils/request.py", line 77, in decorator
return func(*args, **kwargs)
File "/home/iv/.homeassistant/lib/telegram/utils/request.py", line 173, in post
result = urlopen(request, **urlopen_kwargs).read()
File "/usr/lib64/python3.4/urllib/request.py", line 161, in urlopen
return opener.open(url, data, timeout)
File "/usr/lib64/python3.4/urllib/request.py", line 469, in open
response = meth(req, response)
File "/usr/lib64/python3.4/urllib/request.py", line 579, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python3.4/urllib/request.py", line 507, in error
return self._call_chain(*args)
File "/usr/lib64/python3.4/urllib/request.py", line 441, in _call_chain
result = func(*args)
File "/usr/lib64/python3.4/urllib/request.py", line 587, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 403: Forbidden
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.4/site-packages/homeassistant/components/notify/telegram.py", line 60, in send_message
text=title + " " + message)
File "/home/iv/.homeassistant/lib/telegram/bot.py", line 128, in decorator
result = func(self, *args, **kwargs)
File "/home/iv/.homeassistant/lib/telegram/bot.py", line 145, in decorator
return Bot._post_message(url, data, kwargs)
File "/home/iv/.homeassistant/lib/telegram/bot.py", line 175, in _post_message
network_delay=network_delay)
File "/home/iv/.homeassistant/lib/telegram/utils/request.py", line 85, in decorator
raise Unauthorized()
telegram.error.Unauthorized: Unauthorized
INFO:homeassistant.core:Bus:Handling <Event service_executed[L]: service_call_id=139620418012776-5>
INFO:homeassistant.components.http:"POST /api/services/notify/NAME HTTP/1.1" 200 -
INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sun.sun, new_state=<state sun.sun=above_horizon; friendly_name=Sun, elevation=8.27, next_setting=18:09:24 17-04-2016, next_rising=04:00:16 18-04-2016 @ 09:58:08 17-04-2016>, old_state=<state sun.sun=above_horizon; friendly_name=Sun, elevation=8.42, next_setting=18:09:24 17-04-2016, next_rising=04:00:16 18-04-2016 @ 09:58:08 17-04-2016>>
Check your credentials.
Thank you for the advise!
I am receiving following ERROR:
INFO:homeassistant.util.package:Attempting install of netdisco==0.6.1
Command “/srv/hass/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-build-wle_v54l/netifaces/setup.py’;exec(compile(getattr(tokenize, ‘open’, open)(file).read().replace(’\r\n’, ‘\n’), file, ‘exec’))” install --record /tmp/pip-ulzqj6v9-record/install-record.txt --single-version-externally-managed --compile --install-headers /srv/hass/include/site/python3.4/netifaces --home=/tmp/tmpj6_utpo0” failed with error code 1 in /tmp/pip-build-wle_v54l/netifaces/
ERROR:homeassistant.bootstrap:Not initializing discovery because could not install dependency netdisco==0.6.1
Any idea how fix it?
Install netifaces or disable the discovery
component.