Anzeige MPD optimieren

Begonnen von NewbieNew, 24 Juli 2021, 09:05:26

Vorheriges Thema - Nächstes Thema

NewbieNew

Moin,
ich habe gerade einen MPD eingebunden. Funktioniert auch super.

Internals:
   CFGFN     
   DEF        192.168.1.8 6600
   DeviceName 192.168.1.8:6600
   FUUID      60fbb27b-f33f-2a92-224a-3eee0ebff3c7e602
   HOST       192.168.1.8
   IPID       1763
   NAME       myMPD
   NR         517
   PORT       6600
   PRESENCE   present
   STATE      <div style='color:green'><b>FLIPPERS - SOMMERWIND</b></div></div>
<div style='color:red'> <b>Absolut Bella</b><br>
<div style='color:red'> Volume: <b>11</b></div>
   SUBVERSION 21
   TIMEOUT    2
   TYPE       MPD
   VERSION    0.21.4
   mute       -1
   READINGS:
     2021-07-24 08:39:11   Album           
     2021-07-24 08:57:48   Artist          FLIPPERS
     2021-07-24 08:39:11   Cover           
     2021-07-24 08:39:11   Date           
     2021-07-24 08:39:11   Genre           
     2021-07-24 08:57:48   Id              4
     2021-07-24 08:39:11   Last-Modified   
     2021-07-24 08:57:48   Name            Absolut Bella
     2021-07-24 08:57:48   Pos             0
     2021-07-24 08:57:48   Title           SOMMERWIND
     2021-07-24 08:39:11   Track           
     2021-07-24 08:57:48   album_image     
     2021-07-24 08:57:48   album_image_html
     2021-07-24 08:57:48   albums          220
     2021-07-24 08:57:48   artist_image    https://lastfm.freetls.fastly.net/i/u/174s/2a96cbd8b46e442fc41c2b86b821562f.png
     2021-07-24 08:57:48   artist_image_html <img src='https://lastfm.freetls.fastly.net/i/u/174s/2a96cbd8b46e442fc41c2b86b821562f.png' width='174' height='174' />
     2021-07-24 08:57:48   artists         242
     2021-07-24 08:30:59   attribute0      dop=0
     2021-07-24 08:57:48   audio           44100:24:2
     2021-07-24 08:57:48   bitrate         128
     2021-07-24 08:57:48   consume         0
     2021-07-24 08:57:48   currentTrackProvider Radio
     2021-07-24 08:57:48   db_playtime     117411
     2021-07-24 08:57:48   db_update       1586594665
     2021-07-24 08:57:48   elapsed         1110.884
     2021-07-24 08:57:48   file            https://absolutradio.stream24.net/absolut-bella.mp3#Absolut Bella
     2021-07-24 08:30:47   last_error      IdleStart: Connection refused
     2021-07-24 08:57:48   mixrampdb       0.000000
     2021-07-24 08:57:48   mpd_event       playlist+player
     2021-07-24 08:26:11   mute            off
     2021-07-24 08:30:59   outputenabled0  1
     2021-07-24 08:30:59   outputname0     My ALSA Device
     2021-07-24 08:57:48   playlist        423
     2021-07-24 08:57:48   playlist_crc    11259
     2021-07-24 08:30:59   playlist_json   
     2021-07-24 08:39:11   playlist_num    0
     2021-07-24 08:30:59   playlistcollection [Radio Streams]:Garten Sonne:Radio:Favorites:Radio-RSA
     2021-07-24 08:57:48   playlistinfo    [{"Artist":"FLIPPERS","Title":"SOMMERWIND","Album":"","Time":"","File":"https://absolutradio.stream24.net/absolut-bella.mp3#Absolut Bella","Track":"","Cover":"/fhem/icons/1px-spacer"}]
     2021-07-24 08:57:48   playlistlength  1
     2021-07-24 08:39:11   playlistname    [Radio Streams]
     2021-07-24 08:57:48   playtime        42041
     2021-07-24 08:30:59   plugin0         alsa
     2021-07-24 08:57:48   presence        present
     2021-07-24 08:57:48   random          0
     2021-07-24 08:57:48   rawTitle        FLIPPERS - SOMMERWIND
     2021-07-24 08:57:48   repeat          0
     2021-07-24 08:57:48   single          0
     2021-07-24 08:57:48   song            0
     2021-07-24 08:57:48   songid          4
     2021-07-24 08:57:48   songs           431
     2021-07-24 08:57:48   state           play
     2021-07-24 08:57:48   time            1111:0
     2021-07-24 08:57:48   uptime          2236012
     2021-07-24 08:57:48   volume          11
   helper:
     RUNNING_PID:
       abortArg   
       abortFn   
       arg        myMPD
       bc_pid     452
       finishFn   MPD_IdleDone
       fn         MPD_IdleStart
       pid        1763
       timeout   
     playlistcollection:
       0          [Radio Streams]
       1          Garten Sonne
       2          Radio
       3          Favorites
       4          Radio-RSA
       val        4
Attributes:
   devStateIcon play:rc_PLAY:stop stop:rc_STOP:play pause:rc_PAUSE:pause
   event-on-change-reading state,error
   icon       it_radio
   image_size 2
   loadPlaylists 0
   player     mpd
   room       Musik
   stateFormat <div style='color:green'><b>rawTitle</b></div></div>
<div style='color:red'> <b>Name</b><br>
<div style='color:red'> Volume: <b>volume</b></div>
   titleSplit 1
   unknown_artist_image /fhem/icons/1px-spacer
   volumeStep 2


Nur die Anzeige ist nicht so optimal. Mir fehlen die Bedienungstasten (Volume, Play, Pause usw.) und die Anzeige der Playlisten ist viel zu breit.

Hat das schon mal jemand etwas besser hinbekommen?

Dankeschön

Beta-User

...da das schon eine Weile unbeantwortet geblieben ist...:

a) Das Modul bringt ein eigenes grafisches Bedienelement mit:
define <name> weblink htmlCode {fhem("get <name> webrc", 1)}b) Man kann das ganze selbstredend auch mit den "üblichen Methoden" aufhübschen, z.B.:attr myMPD cmdIcon play:audio_play stop:audio_stop pause:audio_pause
attr myMPD webCmd play:pause:stop
oder
attr myMPD devStateIcon play:rc_PLAY:stop stop:rc_STOP:play pause:rc_PAUSE:pause error:icoBlitz

Man kann es auch noch spezieller gestalten, wenn man devStateIcon iVm. Perl-Code verwendet; (sehr komplexe) Anregungen sind z.B. für das (insoweit ähnliche) sonos2mqtt zu finden.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files