Since my first installation of openHAB1 i was looking for a solution to display some informations like current track title, artist and album played with iTunes (under MacOS) not only on Apple TV but also within oH.
After waisting a lot of time (and money for useless tools) i found A simple server providing a RESTful service for controlling iTunes
By installing this simple server on the same place as my oH-Server as described on the Github-Page some things started to work.
Sample of .items-file (iTunes.items):
String Artist "Artist [%s]" { http="<[http://192.XXX.XXX.XX:8181/now_playing:6000:JS(Artist.js)]" }
String Title "Titel [%s]" { http="<[http://192.XXX.XXX.XX:8181/now_playing:6000:JS(Title.js)]" }
String Album "Album [%s]" { http="<[http://192.XXX.XXX.XX:8181/now_playing:6000:JS(Album.js)]" }
String Playlist "Playlist [%s]" { http="<[http://192.XXX.XXX.53:8181/now_playing:6000:JS(Playlist.js)]" }
Sample of title-transformation (Title.js):
(function(i) {
var json = JSON.parse(i);
return json['name'];
})(input)
Log-entries:
20:40:56.956 [INFO ] [marthome.event.ItemStateChangedEvent] - Playlist changed from null to Musik
20:40:58.124 [INFO ] [marthome.event.ItemStateChangedEvent] - Album changed from null to Die Ärzte (1986)
20:40:58.276 [INFO ] [marthome.event.ItemStateChangedEvent] - Title changed from null to Mysteryland
20:40:58.478 [INFO ] [marthome.event.ItemStateChangedEvent] - Artist changed from null to Die Ärzte
oH-GUI-adaption with the great HABPanel:
Next “easy” step is to control iTunes not only via itself, the remotes, the ios-devices but also with oH.
After reading some postings about Sonos, Plex, XBMC and so on today it seems not so easy to let oH display the cover of current song like the A simple server providing a RESTful service for controlling iTunes provides:
Maybe someone have a solution to refresh this image-item like the text-items above inside oH, especially version 2?