Sonos album art visible on Dashboard
Posted: Thursday 05 March 2020 13:47
As requested by Lokonli, repeating this topic as feature request here (from: https://www.domoticz.com/forum/viewtopi ... rt#p235211 )
Having Sonos largely integrated into Dashtiz, the last fun part is still missing: AlbumArt
I have the (dynamic) URL to the current AlbumArt in a Domoticz variable (As I have for album, artist and title).
In Domoitcz Events, I have:
Than later in my script:
Does anyone have an ideas how I can get this variable from Domoticz into my frames block, something like:
url : sonos_album_art
Also I noticed the images vary in size, do they need to get scaled somehow to be placed properly into a frame?
Thanks - Jeroen
Having Sonos largely integrated into Dashtiz, the last fun part is still missing: AlbumArt
I have the (dynamic) URL to the current AlbumArt in a Domoticz variable (As I have for album, artist and title).
In Domoitcz Events, I have:
Code: Select all
json = (loadfile "/home/pi/domoticz/scripts/lua/JSON.lua")()
local sonos=assert(io.popen('curl http://192.168.178.55:5005/Woonkamer/state'))
local status = sonos:read('*all')
sonos:close()
local jsonStatus = json:decode(status)
local sonos_woonkamer = 'Sonos Woonkamer'
playerstate = jsonStatus['playbackState']
artist = jsonStatus['currentTrack']['artist']
title = jsonStatus['currentTrack']['title']
nexttitle = jsonStatus['nextTrack']['title']
album = jsonStatus['currentTrack']['album']
albumart = jsonStatus['currentTrack']['absoluteAlbumArtUri']
Code: Select all
commandArray['Variable:Sonos_album'] = album
commandArray['Variable:Sonos_artist'] = artist
commandArray['Variable:Sonos_title'] = title
commandArray['Variable:Sonos_nexttitle'] = nexttitle
commandArray['Variable:Sonos_album_art'] = albumart
url : sonos_album_art
Also I noticed the images vary in size, do they need to get scaled somehow to be placed properly into a frame?
Thanks - Jeroen