2 devices (Power 1 and Power 2) as 2 toggle icons

Begonnen von kroonen, 31 Januar 2023, 21:38:07

Vorheriges Thema - Nächstes Thema



I have a device with 2 sockets. With one socket , I can create a device with only and icon to toggle it. Is this also possible with 2 sockets in one entry

I have this, but I can't click the icons

   IODev      mqtt2
   autocreate 0
   comment    no
   devStateIcon 1.ON:message_socket@orange 1.OFF:message_socket 2.ON:message_socket@orange 2.OFF:message_socket
   icon       outside_socket
   model      tasmota_2ch_unified
   readingList tele/b\Buitenwcd/LWT:.* LWT
  tele/Buitenwcd/STATE:.* { json2nameValue($EVENT,'',$JSONMAP) }
  stat/Buitenwcd/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }
  stat/Buitenwcd/POWER1:.* POWER1
  stat/Buitenwcd/POWER2:.* POWER2
   room       Buiten
   setList    1:noArg cmnd/Buitenwcd/POWER1 2
2:noArg cmnd/Buitenwcd/POWER2 2

   setStateList 1 2
   stateFormat 1:POWER1
   webCmd     :


Hi, seems you used a rather old version of the "unified"attrTemplate. The newer one assigns especially attr DEVICE devStateIcon Online:10px-kreis-gruen Offline:10px-kreis-rot 1.on:on:POWER1+off 1.off:off:POWER1+on 2.on:on:POWER2+off 2.off:off:POWER2+on
Pls. note the third argument, so if you want to keep the coloured message_socket-icons, you will just have to adopt that part.
Server: HP-T620@Debian 11, 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


Thnx. I had to modify a bit, but I got it working