And if you want some of that CSS magic edit it to your liking.
if you change
var entity_picture = obj.data.new_state.attributes.entity_picture;
into
var entity_picture = obj.data.new_state.attributes.media_image_url;
it should work for you as well.
This is great! This code actually works mostly as is if you’re running Plex Media Server too. I just tried it, but Home Assistant is running on the same machine as Plex, so I had to replace the localhost in the entity_picture attribute with the IP address of the machine. Also, you just pass in media_duration to the Date object; you don’t multiply by 1000 to get the correct duration.
Yeah the multiply is for the value the Kodi component serves. It converts the duration to seconds so had to convert it back to hh:mm:ss.
Good to hear it works for you on Plex. I had no way of testing it since I do not run Plex.
I just checked the components for differences and figured what to change in the code.
My setup is the same as yours (at the moment, soon to be on a RasPi) so this is good to know! Thanks!
Just copy and past my code into an index.html and save it to the www (local) folder.
Don’t forget to like the topic.
hey @dennisaion,
I think I’m missing something.
I see in the HTML that there’s a reference to a CSS file but I can’t see the link to it.
Am I right? (sorry, I just can’t can’t find it )
Hey @davedan,
The CSS file you can get here (credits @fabaff) https://github.com/fabaff/home-assistant-sse/tree/master/www/css and is to be placed in www/css
You can change colouring and layout to your own liking.
(Don’t forget to like the topic )
Would you mind uploading your code that’s working with Plex.
I don’t see anywhere in the index.html code that mentions ‘localhost’ so not sure where to put this
Cheers
Just copy and past the changed line in here.
That will reduce space occupancy.
Meanwhile pictures to automatically resizing based on device width is working properly. Now looks like this
I’d upload, but it’s just an extra line:
entity_picture = entity_picture.replace(“localhost”, “IP_ADDRESS”);
Where “IP_ADDRESS” is the ip address of the computer running Plex, like “192.168.0.25”
Just put the line in after:
var entity_picture = obj.data.new_state.attributes.entity_picture;
Also, I didn’t mention this before, but you can figure out what attribute names and values are getting sent across on the state change via the Home Assistant log file. This is how I figured out to remove the multiplier on the duration conversion for Plex.
Lastly, I’ve only tested on Safari on my Mac and on my iPhone.
thanks, i tried that but it doesn’t work for me…yet
first error message i got was…
FileNotFoundError: [Errno 2] No such file or directory: '/home/pi/.homeassistant/www/entity_picture'
then when i updated the index.html with your new line i now get error…
homeassistant.components.http: API password missing or incorrect. Source IP: 10.8.0.6
not really sure what that means
cheers!
Means you have to add your hass password
Do http://YOUR_HA_IP:8123/local/index.html?api_password=YOUR_HA_PASSWORD_GOES_HERE
What helps to test is to open a HA in browser on remote machine.
Clear the browsers cache (beginning of time way) first.
You probably have to fill in your HA password if you set one.
Then after open in a second browser instance the DMP page http://10.8.0.6:8123/local/index.html
It should open without issues now.
Next clear your cache again, shut down browser instances, then open new browser instance to open http://10.8.0.6:8123/local/index.html?api_password=YOUR_HASS_PASSWORD
That should also work.
Then finally test by clearing your cache again, shutting down browser instance, then open new browser instance to open http://10.8.0.6:8123/local/index.html
This should not work (if configuration.yaml indeed has password set inside.)
By no you will know you have to open Digital Movie Poster page like this
http://10.8.0.6:8123/local/index.html?api_password=YOUR_HASS_PASSWORD
Yay! The custom frame I ordered came in today. Yaaaaaay!
This is what it looks like with panel in it.
Not sure if I’ll go with or without frosted glass.
Waiting for LVDS controller (China) to come in so I can mount it on the back with a Raspberry Pi 3 or an Intel PC stick in HDMI.
HDMI stick or RPi3 (Chromium) will run the Digital Movie Poster in kiosk mode on startup.
So I installed Chrome OS on a Raspberry and ran the DMP full screen after rotating the screen first.
Works perfect. When you reboot the RPI the screen comes back on rotated and with your page opened.
Now working on a 55" LED TV for fine tuning the layout of the text at the bottom.
Today I learned… @dennisaion has been raiding my movie library…
This is looking fantastic. Have you thought about cycling through movie posters when something isn’t playing? Like a “coming attractions” slide show?
This project should end up on the blog at some point. It’s to good not to share.
Yeah. Working on that. Will have to work with a central place to store the movie posters in though.
I’ve been reading back through this but not sure I completely understand. Has someone gotten this working for Plex? If so, how? I stream from a Plex server to various Chromecasts through the house, but I want the poster to only work for one of the CCs and it would be completely awesome if it rotated random posters when a movie wasn’t playing.