Okay, this is the first one that came up:
17-02-19 12:43:02 ERROR (MainThread) [homeassistant.helpers.condition] Error during template condition: UndefinedError: ‘Player’ is undefined
Update: Okay, I’m getting something that looks like this:
17-02-19 13:21:02 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_server.py", line 62, in handle_request
resp = yield from self._handler(request)
File "/usr/local/lib/python3.5/site-packages/aiohttp/web.py", line 270, in _handle
resp = yield from handler(request)
File "/usr/local/lib/python3.5/asyncio/coroutines.py", line 213, in coro
res = yield from res
File "/usr/local/lib/python3.5/asyncio/coroutines.py", line 213, in coro
res = yield from res
File "/usr/src/app/homeassistant/components/http/__init__.py", line 427, in handle
result = yield from result
File "/usr/src/app/homeassistant/components/api.py", line 311, in post
body = yield from request.text()
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_reqrep.py", line 394, in text
return bytes_body.decode(encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 1993: invalid start byte
17-02-19 13:21:15 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_server.py", line 62, in handle_request
resp = yield from self._handler(request)
File "/usr/local/lib/python3.5/site-packages/aiohttp/web.py", line 270, in _handle
resp = yield from handler(request)
File "/usr/local/lib/python3.5/asyncio/coroutines.py", line 213, in coro
res = yield from res
File "/usr/local/lib/python3.5/asyncio/coroutines.py", line 213, in coro
res = yield from res
File "/usr/src/app/homeassistant/components/http/__init__.py", line 427, in handle
result = yield from result
File "/usr/src/app/homeassistant/components/api.py", line 312, in post
data = json.loads(body) if body else None
File "/usr/local/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
17-02-19 13:21:15 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.5/site-packages/aiohttp/web_server.py", line 62, in handle_request
resp = yield from self._handler(request)
File "/usr/local/lib/python3.5/site-packages/aiohttp/web.py", line 270, in _handle
resp = yield from handler(request)
File "/usr/local/lib/python3.5/asyncio/coroutines.py", line 213, in coro
res = yield from res
File "/usr/local/lib/python3.5/asyncio/coroutines.py", line 213, in coro
res = yield from res
File "/usr/src/app/homeassistant/components/http/__init__.py", line 427, in handle
result = yield from result
File "/usr/src/app/homeassistant/components/api.py", line 312, in post
data = json.loads(body) if body else None
File "/usr/local/lib/python3.5/json/__init__.py", line 319, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.5/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/lib/python3.5/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
hass@home-server:~/.homeassistant$
It seems to me as though Home Assistant does not accept UTF-8.
Update 2:
And I almost forgot. This is what I have so far:
plex_webhook:
alias: "Plex Webhooks"
sequence:
- condition: template
value_template: '{{ Player.uuid == "..." }}'
- service: script.turn_on
data:
entity_id: script.plex_webhook_play
- service: script.turn_on
data:
entity_id: script.plex_webhook_stop
plex_webhook_play:
alias: "Plex Webhook - Play"
sequence:
- condition: or
conditions:
- condition: template
value_template: '{{ event == "media.play" }}'
- condition: template
value_template: '{{ event == "media.resume" }}'
- service: light.turn_off
data:
entity_id: light.living_room_floor_lamps
plex_webhook_stop:
alias: "Plex Webhook - Stop"
sequence:
- condition: or
conditions:
- condition: template
value_template: '{{ event == "media.pause" }}'
- condition: template
value_template: '{{ event == "media.stop" }}'
- service: light.turn_on
data:
entity_id: light.living_room_floor_lamps
brightness: 128