Description
Home Assistant release (hass --version
):
0.54
Python release (python3 --version
):
Python 3.5.3
Component/platform:
history
Description of problem:
I want to use the end_time
parameter documented here https://home-assistant.io/developers/rest_api/.
It is not documented which time format is expected as end_time. I tried different time formats but didn' t found a working one.
curl -X GET -H "Content-Type: application/json" "http://localhost:8123/api/history/period/2017-09-20T00:00:00+02:00?end_time=2017-09-22T00:00:00+02:00"
Expected:
JSON Output
Traceback (if applicable):
2017-10-03 18:17:11 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web_protocol.py", line 422, in start
resp = yield from self._request_handler(request)
File "/srv/homeassistant/lib/python3.5/site-packages/aiohttp/web.py", line 306, in _handle
resp = yield from handler(request)
File "/usr/lib/python3.5/asyncio/coroutines.py", line 213, in coro
res = yield from res
File "/usr/lib/python3.5/asyncio/coroutines.py", line 213, in coro
res = yield from res
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/http/ban.py", line 58, in ban_middleware_handler
return (yield from handler(request))
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/http/__init__.py", line 428, in handle
result = yield from result
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/history.py", line 282, in get
return self.json_message('Invalid end_time', HTTP_BAD_REQUEST)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/dt.py", line 64, in as_utc
if dattim.tzinfo == UTC:
AttributeError: 'NoneType' object has no attribute 'tzinfo'
Additional info:
curl returns
<html><head><title>500 Internal Server Error</title></head><body><h1>500 Internal Server Error</h1>Server got itself in trouble</body></html>