Page 1 of 1

Sonos album art visible on Dashboard

Posted: Thursday 05 March 2020 13:47
by JeroenL
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:

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']
Than later in my script:

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
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

Re: Sonos album art visible on Dashboard

Posted: Thursday 05 March 2020 21:15
by krizzz
Great topic, also very curious about this!


Verzonden vanaf mijn iPhone met Tapatalk

Re: Sonos album art visible on Dashboard

Posted: Tuesday 14 April 2020 16:34
by nfuse
@Lokonli i know you are a busy man but is there an update for this thread?

i also have Sonos integrated and like the stream player layout

nice things to have are

- better buttons (like streamplayer)
- song name (scrolled in title bar?)
- playlist selection

i have the sonos api from jishi (node-sonos-http-api) and i can do almost everything within dashtics with this great plugin but it is not that good looking :)

my example:

Image