I tried localhost, 127.0.0.1 and the dynamic dns address that I have set up. None of those worked but using the 192.168.2.37 address that is assigned by my router lets all the other functions of the binding work except getting the cover url. I did have to add 192.168.2.37 to the list of IPs that can bypass authentication in Plex. Just to be clear Plex and OpenHAB run on the same PC so I expected localhost to work.
just tested on a PI3 with OH2 latest snapshot and it’s working. Web ui doesn’t refresh automatically (I think it is a known problem anyway) so you have to manually refresh in order to display a new cover.
Thank you for the information. I actually haven’t tried doing it from the rule, but I’ve tried simply replacing the file in Windows, and it wouldn’t let me do it. I’ll try your approach, because it looks much better to have the cover in Image widget, than displaying web page in Webview widget.
No openHAB/ESH UI currently does anything with the item= attribute on an Image widget in the sitemap, but it would be great to finally add support for string items providing the URL dynamically to the image to display. This would make the url= attribute optional. In ESH, there is a new Image item that is to contain raw image data, but I see potential issues tunnelling this through HTTP instead of using HTTP as the native transport.
I think both should be supported: Image item=StringItem would interpret the item’s state as a URL, but proxy the image through the server so it can be viewed everywhere that the current url= attribute does. Whenever the item’s state is changed or the refresh cycle has come around again, the image would update in the client. There are a few more bindings besides the Plex binding that could immediately benefit from this enhancement.
Image item=ImageItem would convey the raw image payload to the client as it changed, but would ignore the refresh= attribute as it would be meaningless.
I just spent the best part of a day getting something to work and Rod’s ‘rules’ nearly worked but I’m on osx and no wget caused me no end of problems (until I found out no wget on osx). So instead this does work:
rule "DownloadPlexcover "
Item PlexPCover changed
executeCommandLine("curl -o /Users/richardjohn/openhab2/conf/html/Plex_Cover.png " + PlexPCover.state.toString