Sonos album art visible on Dashboard

Moderators: leecollings, htilburgs, robgeerts

Post Reply
JeroenL
Posts: 53
Joined: Sunday 27 December 2015 19:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Sonos album art visible on Dashboard

Post 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
krizzz
Posts: 200
Joined: Wednesday 20 November 2013 20:36
Target OS: Linux
Domoticz version:
Location: The Netherlands
Contact:

Re: Sonos album art visible on Dashboard

Post by krizzz »

Great topic, also very curious about this!


Verzonden vanaf mijn iPhone met Tapatalk
nfuse
Posts: 32
Joined: Thursday 26 March 2020 11:37
Target OS: -
Domoticz version:
Contact:

Re: Sonos album art visible on Dashboard

Post 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
docker with sonos http api / mosquitto / zigbee2mqtt assistant / portainer / dashticz / nodeJS on windows with Zigbee2Mqtt, and some flask builds of my own
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest