I’m using your setup with sensors for each room. See below. I keep getting an error that a duplicate key exists for these sensors, and only the Great Room sensor shows up sometimes in HA. Using 0.85. Any idea what may be happening? For formatting purposes, I’m using:
sensor: !include_dir_list sensors
Very grateful for the work you’ve done. Very helpful!!
thanks for all the input and ideas here. After combining some of them I got it all working.
Only problem is most of the times it won’t fire from the first play. So I have to pause and play again to get it firing.
It seems that I still have a problem with the media.play.
I think it is because the payload sends a picture with media.play and therfore the parsing fails. (as documented on plex site)
Anyone found a way to parse or evade this problem?
This started bothering me so I wrote a simple custom component that will trigger an event for every webhook! It’s compatible with HACS, just need to add it as a custom repository.
If you guys have an issues right them up in github and I’ll do my best to fix!
Hi thanks for sharing this. i have tried setting up but not sure how to see if it is working - how can i test it, and can you give some automation examples please?
cheers,
james
As you can see all you need to do is use the event platform for a trigger with the event_type of PLEX_EVENT. From there you can filter out the events you care about by using event_data. In my example I filter to only a single player, my living room TVs uuid.
Thank you JBasset! for sharing this ! Tonight I tried to implement it but unfortunately it doesn’t work. Plex can’t deliver the payload to Home Assistant. I think I’ve missed something but don’t know what.
For your information, I’m running home-assistant with docker-compose.
2019-12-18 21:03:03 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for plex_webhooks which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
Plex Media Server.log
Dec 18, 2019 21:07:08.585 [0x7f474d6fb700] WARN - Webhook: Error delivering payload to http://192.168.1.2:8123/api/webhooks/plex_webhook: 404
In case everyone doesn’t read all of the HA release notes in detail, the native Plex integration now uses websockets to update the sensor and media_players. This means instant updates instead of the old polling mechanism. If you were using webhooks for faster updates, give the native integration another shot.
I’ve been using this method of getting the status of plex for quite some time and with the latest updates I am curious to what how the new MQTT trigger would be formatted. I would think it would be something like:
- trigger:
mqtt:
topic: "plex/update"
Anyone have any ideas or have gone through updating their configuration with the MQTT changes?