FHEM Forum

FHEM => Sonstiges => Thema gestartet von: thymjan am 01 Juni 2019, 17:23:43

Titel: mehrere devStateIcons in einem device: Icons werden nicht angezeigt
Beitrag von: thymjan am 01 Juni 2019, 17:23:43
Habe das Beispiel aus
https://forum.fhem.de/index.php/topic,97586.msg908277.html#msg908277 (https://forum.fhem.de/index.php/topic,97586.msg908277.html#msg908277)
nachgebaut.

Leider werden bei mir keine Icons angezeigt (siehe Anlage).

defmod iconDemo dummy
attr iconDemo devStateIcon 1.on:FS20.on:on1+off 1.off:FS20.off:on1+on 2.on:on:on2+off 2.off:off:on2+on 3.on:on:on3+off 3.off:off:on3+on ok:batterie@green low:batterie@red
attr iconDemo readingList on1 on2 on3 battery
attr iconDemo room iconDemo
attr iconDemo setList on1:on,off on2:on,off on3:on,off battery:low,ok
attr iconDemo stateFormat 1:on1\ 2:on2\ 3:on3\ <br>\ temperature&deg;;C\ battery
attr iconDemo webCmd on1:on2:on3:battery

setstate iconDemo 1:off\ 2:off\ 3:off\ <br>\ 21.2&deg;;C\ ok
setstate iconDemo 2019-06-01 17:03:58 battery ok
setstate iconDemo 2019-06-01 17:03:41 on1 off
setstate iconDemo 2019-06-01 17:03:45 on2 off
setstate iconDemo 2019-06-01 17:03:51 on3 off
setstate iconDemo 2019-02-19 10:14:32 temperature 21.2


Was mache ich falsch?
Titel: Antw:mehrere devStateIcons in einem device: Icons werden nicht angezeigt
Beitrag von: amenomade am 01 Juni 2019, 17:38:19
Zeig bitte ein "list iconDemo" und zwar noch in "code" Tags (das # Zeichen im Editor Menü)
Titel: Antw:mehrere devStateIcons in einem device: Icons werden nicht angezeigt
Beitrag von: thymjan am 01 Juni 2019, 17:42:59
list iconDemo
Internals:
   FUUID      5cf02b92-f33f-b597-dc39-e207bd6795562349
   NAME       iconDemo
   NR         24
   STATE      1:off\ 2:off\ 3:off\ <br>\ 21.2&deg;C\ ok
   TYPE       dummy
   Helper:
     DBLOG:
       battery:
         sundb:
           TIME       1559401438.80481
           VALUE      ok
       on1:
         sundb:
           TIME       1559401421.24653
           VALUE      off
       on2:
         sundb:
           TIME       1559401425.56641
           VALUE      off
       on3:
         sundb:
           TIME       1559401431.95715
           VALUE      off
   READINGS:
     2019-06-01 17:03:58   battery         ok
     2019-06-01 17:03:41   on1             off
     2019-06-01 17:03:45   on2             off
     2019-06-01 17:03:51   on3             off
     2019-02-19 10:14:32   temperature     21.2
Attributes:
   devStateIcon 1.on:FS20.on:on1+off 1.off:FS20.off:on1+on 2.on:on:on2+off 2.off:off:on2+on 3.on:on:on3+off 3.off:off:on3+on ok:batterie@green low:batterie@red test:FS20.off
   readingList on1 on2 on3 battery
   room       iconDemo
   setList    on1:on,off on2:on,off on3:on,off battery:low,ok
   stateFormat 1:on1\ 2:on2\ 3:on3\ <br>\ temperature&deg;C\ battery
   webCmd     on1:on2:on3:battery
Titel: Antw:mehrere devStateIcons in einem device: Icons werden nicht angezeigt
Beitrag von: amenomade am 01 Juni 2019, 17:46:21
Dein stateFormat ist falsch. Das \ gehört zu raw Definition, aber wenn Du das Attribut direkt in der Weboberfläsche eingibst, sollst Du ein Zeilenumbruch schreiben. Am Ende soll es so aussehen:

Attributes:
   devStateIcon 1.on:on:on1+off 1.off:off:on1+on 2.on:on:on2+off 2.off:off:on2+on 3.on:on:on3+off 3.off:off:on3+on ok:batterie@green low:batterie@red
   readingList on1 on2 on3 battery
   setList    on1:on,off on2:on,off on3:on,off battery:low,ok
   stateFormat 1:on1
2:on2
3:on3
<br>
temperature&deg;C
battery
   webCmd     on1:on2:on3:battery

Die mehrere gleichzeitige devStateIcon Feature benutzt tatsächlich diese Carriage Return im stateFormat
Titel: Antw:mehrere devStateIcons in einem device: Icons werden nicht angezeigt
Beitrag von: thymjan am 01 Juni 2019, 17:54:11
Super! Das war's. Vielen Dank für die schnelle Hilfe!

Also statt \ im Editorfeld einfach nur Enter/Return drücken.
Jetzt funktioniert's.
Titel: Antw:mehrere devStateIcons in einem device: Icons werden nicht angezeigt
Beitrag von: amenomade am 01 Juni 2019, 17:55:17
Man sieht es nicht sofort in dem Bild ;)

Aber gut, dass es funktioniert :)
Titel: Antw:mehrere devStateIcons in einem device: Icons werden nicht angezeigt
Beitrag von: thymjan am 01 Juni 2019, 17:58:07
Im Eifer des Gefechts... hab den Anhang korrigiert...  :-X

Ups, nochmal falsch gewesen. Das <br> für den Zeilenumbruch muss zu Beginn der Zeile stehen!