FHEM Forum

FHEM - Hausautomations-Systeme => MQTT => Thema gestartet von: Beta-User am 03 Februar 2020, 12:04:42

Titel: MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 03 Februar 2020, 12:04:42
Hallo zusammen,

nachdem ich per pm nach support für Espurna gefragt wurde:

Als MQTT_DEVICE sah das so aus:
define sonoffswitchS20 MQTT_DEVICE
attr sonoffswitchS20 IODev myBroker
attr sonoffswitchS20 alias [1] S20 - WZ Light (front)
attr sonoffswitchS20 devStateIcon 1:on:0 0:off:1
attr sonoffswitchS20 eventMap 1:on 0:off
attr sonoffswitchS20 publishSet ON OFF sonoffswitchS20/relay/0/set
[...]
attr sonoffswitchS20 subscribeReading_state sonoffswitchS20/relay/0


Per MQTT kommt wohl für relay "0" oder "1" zurück.
Damit sollte folgende readingList und setList funktionieren:
attr <DEVICE> readingList sonoffswitchS20/relay/0 { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }
attr <DEVICE> setList on sonoffswitchS20/relay/0/set 1\
  off sonoffswitchS20/relay/0/set 0


Bitte mal prüfen, ob man (wie bei Tasmota) ändern kann, was die firmware für on/off senden kann, und ob ggf. auch on bzw. off als Befehl genutzt werden können (ist nicht so wichtig, da wir für setExtensions sowieso getrennte Befehle benötigen).

Ansonsten wäre mir sehr geholfen, wenn ich RAW-Definitionen erhalten könnte und eventuell Infos dazu, wie der MQTT-Verkehr aussieht (betrifft dann aber eher weitere Readings, Statusmeldungen usw.).
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: HM Krause am 03 Februar 2020, 12:22:21
Wenn ich mit MQTTfx "off" oder "on" sende an sonoffswitchS20/relay/0/set geht es ebenso wie mit "0" oder "1" auch.
In der subscription sonoffswitchS20/relay/0 hingegen steht nur "0" oder "1" als result.
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 03 Februar 2020, 12:41:16
Also: Nach https://github.com/xoseperez/espurna/wiki/MQTT#relays kann man umstellen, was für on und off gesendet wird:
Zitat(1) Relay command payloads accept both numbers (0 for off, 1 for on and 2 for toggle) or words (on, off, toggle or query; case insensitive). Accepted and sent payload strings are configured by the relayPayloadOn, relayPayloadOff and relayPayloadToggle settings and
Bin nur nicht recht schlau draus geworden, wohin das genau zu senden sein soll...
Kannst du mal testen, ob ein publish auf "sonoffswitchS20/relay/0/set" mit der Payload "relayPayloadOn on" was sinnvolles bewirkt (und für off genauso)?

Ansonsten bitte mal RAW-Definitionen von dem MQTT2-Device, das du bis dahin hast bzw. die Info, ob das mit MQTT2_CLIENT laufen soll oder ob du den MQTT2_SERVER im Einsatz ist?
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: HM Krause am 03 Februar 2020, 15:47:33
Ein publish auf "sonoffswitchS20/relay/0/set" mit der Payload "relayPayloadOn on" oder allen möglichen anderen Versuchen bringt nichts, habe lange probiert. Es laufen nur 0 1 2 on off toggle.

Hier mal ein raw Code mit dem FHEM soweit läuft:
defmod SonoffswitchS20 MQTT2_DEVICE
attr SonoffswitchS20 IODev MQTT2_FHEM_Server
attr SonoffswitchS20 readingList sonoffswitchS203/relay/0 { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }
attr SonoffswitchS20 room POWER
attr SonoffswitchS20 setList on sonoffswitchS203/relay/0/set 1\
  off sonoffswitchS203/relay/0/set 0

setstate SonoffswitchS20 on
setstate SonoffswitchS20 2020-02-03 15:30:51 state on


Und noch

defmod MQTT2_sonoffswitchS203 MQTT2_DEVICE sonoffswitchS203
attr MQTT2_sonoffswitchS203 IODev MQTT2_FHEM_Server
attr MQTT2_sonoffswitchS203 readingList sonoffswitchS203:sonoffswitchS203/relay/0:.* relay_0\
sonoffswitchS203:sonoffswitchS203/app:.* app\
sonoffswitchS203:sonoffswitchS203/version:.* version\
sonoffswitchS203:sonoffswitchS203/board:.* board\
sonoffswitchS203:sonoffswitchS203/host:.* host\
sonoffswitchS203:sonoffswitchS203/ssid:.* ssid\
sonoffswitchS203:sonoffswitchS203/ip:.* ip\
sonoffswitchS203:sonoffswitchS203/mac:.* mac\
sonoffswitchS203:sonoffswitchS203/rssi:.* rssi\
sonoffswitchS203:sonoffswitchS203/uptime:.* uptime\
sonoffswitchS203:sonoffswitchS203/datetime:.* datetime\
sonoffswitchS203:sonoffswitchS203/freeheap:.* freeheap\
sonoffswitchS203:sonoffswitchS203/vcc:.* vcc\
sonoffswitchS203:sonoffswitchS203/status:.* status\
sonoffswitchS203:sonoffswitchS203/loadavg:.* loadavg
attr MQTT2_sonoffswitchS203 room MQTT2_DEVICE

setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 app ESPURNA
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 board ITEAD_S20
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 datetime 2020-02-03 15:34:19
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 freeheap 21568
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 host Sonoff-S20-3
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 ip 192.168.178.78
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 loadavg 1
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 mac 80:7D:3A:67:B3:E0
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 relay_0 1
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 rssi -55
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 ssid Skynet-basic
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 status 1
setstate MQTT2_sonoffswitchS203 2020-02-03 15:30:15 subscriptions sonoffswitchS203/action/set sonoffswitchS203/led/+/set sonoffswitchS203/pulse/+/set sonoffswitchS203/relay/+/set
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 uptime 4354
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 vcc 3230
setstate MQTT2_sonoffswitchS203 2020-02-03 15:34:20 version 1.13.5


wenn Du das meinst. Ansonsten ist hier testweise FHEM "mit ohne alles" auf Ubuntu und mit MQTT2_SERVER.

Links im FHEM sind jetzt Einträge MQTT2_DEVICE mit FileLog_MQTT2_sonoffswitchS203 und MQTT2_sonoffswitchS203 mit 3Fragezeichen
Müssen die da sein, die tragen sich ja da allein ein?

und ansonsten Eintrag für den Room POWER (mit dem SonoffS20 darin, ist ok)
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 03 Februar 2020, 16:14:18
Hmm, vielleicht hat sonst jemand eine Idee, wie man das umkonfiguriert, wie gesagt, ich werde aus der Doku auch nicht schlau, am ehesten könnte es noch sein, dass die Konfiguration über "sonoffswitchS203/action/set" beeinflußt werden kann..?

Ansonsten hilft mir die RAW-Definition ziemlich weiter. Dass autocreate erst mal alles im Raum MQTT2_DEVICE erstellt, ist normal. Die Devices kannst du beliebig verschieben.

Im Prinzip kannst du mit den kleinen Bausteinchen, die in dem ersten Device SonoffswitchS20 drin sind das andere Device erweitern/ändern. Wird etwas dauern, bis ich daraus ein erstes attrTemplate basteln kann, vorher bitte nochmal einen Versuch, das mit dem anderen Pfad umzukonfigurieren.
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: HM Krause am 05 Februar 2020, 18:12:41
Ich kann unter "sonoffswitchS203/action/set" mit MQTTfx senden was ich will, es kommt immer nur in der Konsole ohne Reaktion, alsoz.B.
089223] [MQTT] Received sonoffswitchS203/action/set => payload_on: "1"
[096731] [MQTT] Received sonoffswitchS203/action/set => 1
[103873] [MQTT] Received sonoffswitchS203/action/set => 0n
[109698] [MQTT] Received sonoffswitchS203/action/set => on


also das hier beschriebene
(1) Relay command payloads accept both numbers (0 for off, 1 for on and 2 for toggle) or words (on, off, toggle or query; case insensitive). Accepted and sent payload strings are configured by the relayPayloadOn, relayPayloadOff and relayPayloadToggle settings and RELAY_MQTT_ON, RELAY_MQTT_OFF, RELAY_MQTT_TOGGLE string definitions.

(2) The special query payload does not change the relay state but triggers a state topic message.


funktioniert nicht. Hat aber auch Zeit mit dem MQTT2, momentan laufen die Dinger ohnehin mit Mosquitto MQTT und da funktioniert alles.
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 06 Februar 2020, 10:55:20
Hm, wäre natürlich schöner, wir würden das irgendwie mit den on/off-rückmeldungen besser hingebogen bekommen, aber auch so wird das notfalls gehen.

Hier mal ein erster Wurf ohne große desc:, und mit der Doppelung von relay_0 und state, die man eigentlich nicht braucht:
###########################################
# ESPurna
#
# ESP8266 devices using ESPurna firmware.
# See project page for details: https://github.com/xoseperez/espurna/wiki
name:ESPurna_single_relay
filter:TYPE=MQTT2_DEVICE
par:DEVNAME;Device's name in the topic tree;{ AttrVal("DEVICE","readingList","") =~ m,([^:/]+)/([^/]+)/, ? $1 : undef }
order:A_30
attr DEVICE readingList DEVNAME/relay/0:.* relay_0\
  DEVNAME/relay/0:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }\
  DEVNAME/app:.* app\
  DEVNAME/version:.* version\
  DEVNAME/board:.* board\
  DEVNAME/host:.* host\
  DEVNAME/ssid:.* ssid\
  DEVNAME/ip:.* ip\
  DEVNAME/mac:.* mac\
  DEVNAME/rssi:.* rssi\
  DEVNAME/uptime:.* uptime\
  DEVNAME/datetime:.* datetime\
  DEVNAME/freeheap:.* freeheap\
  DEVNAME/vcc:.* vcc\
  DEVNAME/status:.* status\
  DEVNAME/loadavg:.* loadavg
attr DEVICE setList on DEVNAME/relay/0/set 1\
  off DEVNAME/relay/0/set 0\
  toggle DEVNAME/relay/0/set 2
attr DEVICE setStateList on off toggle
set DEVICE attrTemplate mqtt2_speech_recognition_type_switch
attr DEVICE model ESPurna_single_relay


Bitte vor dem Testen noch ein FHEM-update, sonst wirft das mit der Spracherkennung einen Fehler...

Rückmeldung wäre nett, ansonsten würde ich das mal auf Verdacht und mit einem Link hierher bei Gelegenheit mit Einchecken.
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: HM Krause am 06 Februar 2020, 11:10:08
Sorry, da komm ich nicht ganz mit, soll das in die Befehlszeile?
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 06 Februar 2020, 11:16:17
Sorry, das ist Code, der als attrTemplate zu verwenden ist. Hinweise dazu sind hier zu finden: https://wiki.fhem.de/wiki/AttrTemplate#Eigene_Templates_entwickeln
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: HM Krause am 06 Februar 2020, 11:19:46
Kaum macht man es richtig schon geht's - ist immer wieder erstaunlich. chapeau. Alle Achtung.

defmod MQTT2_sonoffswitchS203 MQTT2_DEVICE sonoffswitchS203
attr MQTT2_sonoffswitchS203 IODev MQTT2_FHEM_Server
attr MQTT2_sonoffswitchS203 model ESPurna_single_relay
attr MQTT2_sonoffswitchS203 readingList sonoffswitchS203/relay/0:.* relay_0\
  sonoffswitchS203/relay/0:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }\
  sonoffswitchS203/app:.* app\
  sonoffswitchS203/version:.* version\
  sonoffswitchS203/board:.* board\
  sonoffswitchS203/host:.* host\
  sonoffswitchS203/ssid:.* ssid\
  sonoffswitchS203/ip:.* ip\
  sonoffswitchS203/mac:.* mac\
  sonoffswitchS203/rssi:.* rssi\
  sonoffswitchS203/uptime:.* uptime\
  sonoffswitchS203/datetime:.* datetime\
  sonoffswitchS203/freeheap:.* freeheap\
  sonoffswitchS203/vcc:.* vcc\
  sonoffswitchS203/status:.* status\
  sonoffswitchS203/loadavg:.* loadavg
attr MQTT2_sonoffswitchS203 room MQTT2_DEVICE
attr MQTT2_sonoffswitchS203 setList on sonoffswitchS203/relay/0/set 1\
  off sonoffswitchS203/relay/0/set 0\
  toggle sonoffswitchS203/relay/0/set 2
attr MQTT2_sonoffswitchS203 setStateList on off toggle

setstate MQTT2_sonoffswitchS203 on
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:46 app ESPURNA
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 board ITEAD_S20
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 datetime 2020-02-06 12:01:46
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 freeheap 16512
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 host Sonoff-S20-3
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 ip 192.168.178.78
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 loadavg 1
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 mac 80:7D:3A:67:B3:E0
setstate MQTT2_sonoffswitchS203 2020-02-06 12:04:10 relay_0 1
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 rssi -53
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 ssid Skynet-basic
setstate MQTT2_sonoffswitchS203 2020-02-06 12:04:10 state on
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 status 1
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:46 subscriptions sonoffswitchS203/action/set sonoffswitchS203/led/+/set sonoffswitchS203/pulse/+/set sonoffswitchS203/relay/+/set
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 uptime 19811
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 vcc 3233
setstate MQTT2_sonoffswitchS203 2020-02-06 12:01:47 version 1.13.5



Was ist denn mit dem neuen entstehenden log-File?
Das wird bei jedem Schalten immer länger.

2020-02-06_11:16:37 MQTT2_sonoffswitchS203 app: ESPURNA
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 version: 1.13.5
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 board: ITEAD_S20
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 host: Sonoff-S20-3
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 ssid: Skynet-basic
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 ip: 192.168.178.78
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 mac: 80:7D:3A:67:B3:E0
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 rssi: -56
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 uptime: 17101
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 datetime: 2020-02-06 11:16:37
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 freeheap: 16512
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 vcc: 3238
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 status: 1
2020-02-06_11:16:37 MQTT2_sonoffswitchS203 loadavg: 2
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 app: ESPURNA
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 version: 1.13.5
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 board: ITEAD_S20
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 host: Sonoff-S20-3
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 ssid: Skynet-basic
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 ip: 192.168.178.78
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 mac: 80:7D:3A:67:B3:E0
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 rssi: -59
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 uptime: 17401
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 datetime: 2020-02-06 11:21:37
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 freeheap: 21560
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 vcc: 3234
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 status: 1
2020-02-06_11:21:37 MQTT2_sonoffswitchS203 loadavg: 1
2020-02-06_11:23:47 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_11:23:48 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 app: ESPURNA
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 version: 1.13.5
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 board: ITEAD_S20
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 host: Sonoff-S20-3
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 ssid: Skynet-basic
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 ip: 192.168.178.78
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 mac: 80:7D:3A:67:B3:E0
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 rssi: -62
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 uptime: 17701
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 datetime: 2020-02-06 11:26:37
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 freeheap: 21560
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 vcc: 3230
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 status: 1
2020-02-06_11:26:37 MQTT2_sonoffswitchS203 loadavg: 1
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 app: ESPURNA
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 version: 1.13.5
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 board: ITEAD_S20
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 host: Sonoff-S20-3
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 ssid: Skynet-basic
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 ip: 192.168.178.78
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 mac: 80:7D:3A:67:B3:E0
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 rssi: -61
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 uptime: 18001
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 datetime: 2020-02-06 11:31:37
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 freeheap: 21560
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 vcc: 3234
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 status: 1
2020-02-06_11:31:37 MQTT2_sonoffswitchS203 loadavg: 1
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 app: ESPURNA
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 version: 1.13.5
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 board: ITEAD_S20
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 host: Sonoff-S20-3
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 ssid: Skynet-basic
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 ip: 192.168.178.78
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 mac: 80:7D:3A:67:B3:E0
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 rssi: -56
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 uptime: 18301
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 datetime: 2020-02-06 11:36:37
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 freeheap: 21560
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 vcc: 3237
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 status: 1
2020-02-06_11:36:37 MQTT2_sonoffswitchS203 loadavg: 1
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 app: ESPURNA
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 version: 1.13.5
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 board: ITEAD_S20
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 host: Sonoff-S20-3
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 ssid: Skynet-basic
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 ip: 192.168.178.78
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 mac: 80:7D:3A:67:B3:E0
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 rssi: -57
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 uptime: 18601
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 datetime: 2020-02-06 11:41:37
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 freeheap: 21560
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 vcc: 3233
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 status: 1
2020-02-06_11:41:37 MQTT2_sonoffswitchS203 loadavg: 1
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 app: ESPURNA
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 version: 1.13.5
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 board: ITEAD_S20
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 host: Sonoff-S20-3
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 ssid: Skynet-basic
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 ip: 192.168.178.78
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 mac: 80:7D:3A:67:B3:E0
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 rssi: -52
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 uptime: 18901
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 datetime: 2020-02-06 11:46:37
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 freeheap: 21560
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 vcc: 3237
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 status: 1
2020-02-06_11:46:37 MQTT2_sonoffswitchS203 loadavg: 1
2020-02-06_12:01:46 MQTT2_sonoffswitchS203 app: ESPURNA
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 version: 1.13.5
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 board: ITEAD_S20
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 host: Sonoff-S20-3
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 ssid: Skynet-basic
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 ip: 192.168.178.78
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 mac: 80:7D:3A:67:B3:E0
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 rssi: -53
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 uptime: 19811
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 datetime: 2020-02-06 12:01:46
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 freeheap: 16512
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 vcc: 3233
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 status: 1
2020-02-06_12:01:47 MQTT2_sonoffswitchS203 loadavg: 1
2020-02-06_12:03:23 MQTT2_sonoffswitchS203 attrTemplate mqtt2_speech_recognition_type_switch
2020-02-06_12:03:40 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:03:40 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:03:40 MQTT2_sonoffswitchS203 on
2020-02-06_12:03:41 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:03:41 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:03:41 MQTT2_sonoffswitchS203 off
2020-02-06_12:03:42 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:03:42 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:03:42 MQTT2_sonoffswitchS203 on
2020-02-06_12:03:43 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:03:43 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:03:43 MQTT2_sonoffswitchS203 off
2020-02-06_12:03:45 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:03:45 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:03:45 MQTT2_sonoffswitchS203 on
2020-02-06_12:03:48 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:03:48 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:03:48 MQTT2_sonoffswitchS203 off
2020-02-06_12:03:49 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:03:49 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:03:49 MQTT2_sonoffswitchS203 on
2020-02-06_12:04:07 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:04:07 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:04:07 MQTT2_sonoffswitchS203 off
2020-02-06_12:04:08 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:04:08 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:04:08 MQTT2_sonoffswitchS203 on
2020-02-06_12:04:10 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:04:10 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:04:10 MQTT2_sonoffswitchS203 off
2020-02-06_12:04:10 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:04:10 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:04:10 MQTT2_sonoffswitchS203 on
2020-02-06_12:06:39 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:06:39 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:06:39 MQTT2_sonoffswitchS203 off
2020-02-06_12:06:40 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:06:40 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:06:40 MQTT2_sonoffswitchS203 on
2020-02-06_12:06:41 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:06:41 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:06:41 MQTT2_sonoffswitchS203 off
2020-02-06_12:06:42 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:06:42 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:06:42 MQTT2_sonoffswitchS203 on
2020-02-06_12:06:44 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:06:44 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:06:44 MQTT2_sonoffswitchS203 off
2020-02-06_12:06:45 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:06:45 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:06:45 MQTT2_sonoffswitchS203 on
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 off
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 app: ESPURNA
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 version: 1.13.5
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 board: ITEAD_S20
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 host: Sonoff-S20-3
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 ssid: Skynet-basic
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 ip: 192.168.178.78
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 mac: 80:7D:3A:67:B3:E0
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 rssi: -52
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 uptime: 20111
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 datetime: 2020-02-06 12:06:46
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 freeheap: 19264
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 off
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 vcc: 3236
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 status: 1
2020-02-06_12:06:46 MQTT2_sonoffswitchS203 loadavg: 1
2020-02-06_12:08:27 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:08:27 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:08:27 MQTT2_sonoffswitchS203 on
2020-02-06_12:08:28 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:08:28 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:08:28 MQTT2_sonoffswitchS203 off
2020-02-06_12:08:39 MQTT2_sonoffswitchS203 set_on
2020-02-06_12:08:39 MQTT2_sonoffswitchS203 relay_0: 1
2020-02-06_12:08:39 MQTT2_sonoffswitchS203 on
2020-02-06_12:08:41 MQTT2_sonoffswitchS203 set_off
2020-02-06_12:08:41 MQTT2_sonoffswitchS203 relay_0: 0
2020-02-06_12:08:41 MQTT2_sonoffswitchS203 off
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 06 Februar 2020, 12:45:25
Danke für die Rückmeldung, dann checke ich das mal ein*.

Was das LogFile angeht, ist das soweit klar: Jeder Event wird geloggt, das ist kein spezielles MQTT-Thema ;D .

(Mind. zwei) (kombinierbare) Ansätze:
2. https://fhem.de/commandref_modular.html#FileLog => "<regexp>" setzen...
1. event-on-change-reading (am MQTT2-Device) verwenden!
3. In diversen firmwares kann man die Wiederholungszeit einstellen, nach der bestimmte Statusmeldungen gesendet werden => ESPurna-Doku wälzen ;)

Ziff. 1 ist zu 2. vorzugswürdig bzw. in jedem Fall sinnvoll. *Werde das ins attrTemplate noch mit aufnehmen.
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: HM Krause am 06 Februar 2020, 13:39:03
Mit den Statusmeldungen bei Espurna gibt es was, ich hab das schon mal gelesen.

Meine Sonoff-RF-Bridge ist übrigens auch Espurnaed, schon lange, sie läuft auch über Mosquitto. Hab sie mal dem MQTT2 eben vertickert..

defmod MQTT2_RFbridge MQTT2_DEVICE RFbridge
attr MQTT2_RFbridge IODev MQTT2_FHEM_Server
attr MQTT2_RFbridge readingList RFbridge:RFbridge/app:.* app\
RFbridge:RFbridge/version:.* version\
RFbridge:RFbridge/board:.* board\
RFbridge:RFbridge/host:.* host\
RFbridge:RFbridge/ssid:.* ssid\
RFbridge:RFbridge/ip:.* ip\
RFbridge:RFbridge/mac:.* mac\
RFbridge:RFbridge/rssi:.* rssi\
RFbridge:RFbridge/uptime:.* uptime\
RFbridge:RFbridge/datetime:.* datetime\
RFbridge:RFbridge/freeheap:.* freeheap\
RFbridge:RFbridge/relay/0:.* relay_0\
RFbridge:RFbridge/relay/1:.* relay_1\
RFbridge:RFbridge/relay/2:.* relay_2\
RFbridge:RFbridge/relay/3:.* relay_3\
RFbridge:RFbridge/relay/4:.* relay_4\
RFbridge:RFbridge/relay/5:.* relay_5\
RFbridge:RFbridge/relay/6:.* relay_6\
RFbridge:RFbridge/relay/7:.* relay_7\
RFbridge:RFbridge/vcc:.* vcc\
RFbridge:RFbridge/status:.* status\
RFbridge:RFbridge/loadavg:.* loadavg
attr MQTT2_RFbridge room MQTT2_DEVICE

setstate MQTT2_RFbridge 2020-02-06 13:33:47 app ESPURNA
setstate MQTT2_RFbridge 2020-02-06 13:33:47 board ITEAD_SONOFF_RFBRIDGE
setstate MQTT2_RFbridge 2020-02-06 13:33:47 datetime 2020-02-06 13:33:46
setstate MQTT2_RFbridge 2020-02-06 13:33:47 freeheap 13352
setstate MQTT2_RFbridge 2020-02-06 13:33:47 host RFbridge
setstate MQTT2_RFbridge 2020-02-06 13:33:47 ip 192.168.178.70
setstate MQTT2_RFbridge 2020-02-06 13:33:47 loadavg 2
setstate MQTT2_RFbridge 2020-02-06 13:33:47 mac 60:01:94:CC:2C:56
setstate MQTT2_RFbridge 2020-02-06 13:33:47 relay_0 0
setstate MQTT2_RFbridge 2020-02-06 13:33:47 relay_1 1
setstate MQTT2_RFbridge 2020-02-06 13:33:47 relay_2 0
setstate MQTT2_RFbridge 2020-02-06 13:33:47 relay_3 1
setstate MQTT2_RFbridge 2020-02-06 13:33:47 relay_4 0
setstate MQTT2_RFbridge 2020-02-06 13:33:47 relay_5 0
setstate MQTT2_RFbridge 2020-02-06 13:33:47 relay_6 0
setstate MQTT2_RFbridge 2020-02-06 13:33:47 relay_7 0
setstate MQTT2_RFbridge 2020-02-06 13:33:47 rssi -40
setstate MQTT2_RFbridge 2020-02-06 13:33:47 ssid Skynet-basic
setstate MQTT2_RFbridge 2020-02-06 13:33:47 status 1
setstate MQTT2_RFbridge 2020-02-06 13:33:47 subscriptions RFbridge/action/set RFbridge/led/+/set RFbridge/pulse/+/set RFbridge/relay/+/set RFbridge/rflearn/+/set RFbridge/rfout/set
setstate MQTT2_RFbridge 2020-02-06 13:33:47 uptime 2321950
setstate MQTT2_RFbridge 2020-02-06 13:33:47 vcc 3238
setstate MQTT2_RFbridge 2020-02-06 13:33:47 version 1.13.5

Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 06 Februar 2020, 13:49:14
Hm, das RF-Zeug ist immer etwas speziell.

Hier sieht das so aus, als wäre jedem RF-Paar (für ein/aus) einer von 8 "relays" zugeordnet?

Dann würde ich ein "Hauptdevice" anlegen, das die ganzen Statusreadings bekommt und den ersten Kanal als "state", und dann für alle weiteren je manuell ein Sub-Device (eigenes MQTT2_DEVICE), das nur die setList- und readingList-Einträge für je einen Kanal enthält (und das dann nach "state" mappt).

Soweit klar?

Ansonsten, falls da auch erkannte RF-Codes weitergeben werden: Tasten drücken und den MQTT-Verkehr dazu mitschneiden und mal das tasmota-rf-Beispiel ansehen... (und/oder OpenMQTTBridge-rf).

Ist viel "Handarbeit"...
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: HM Krause am 06 Februar 2020, 14:20:54
Das läuft ja momentan auch schon alles länger mit Mosquitto. Im Gegensatz zur Tasmota FW kann die RF-Bridge mit Espurna hier auch autonom RF Codes lernen, also über das eigene Webinterface..Verwendung für die Bedienung der Sonoff-S20s mit einer Intertechno Fernbedienung. Also 8 Kanäle AN-AUS = 16 Befehle einlernbar. Andersrum WLAN zu RF habe ich es früher auch mal verwendet, aber da die Intertechnos keinen Status melden können, habe ich die nicht mehr. Im Moment verwende ich nur ein paar Readings der Bridge und setze damit notifys zum Schalten ab.
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 06 Februar 2020, 14:41:54
Na ja, wenn ich das richtig im Kopf habe, kann auch Tasmota (zwischenzeitlich?) RF-Codes paarweise für einige RF-Geräte speichern.

Wie dem auch sei, falls du ein template entwickeln wolltest, wäre das mMn. eine "Kreuzung" zwischen dem 1. ESPurna-template und dem shelly4pro_split, (getList-Einträge gäbe es nicht, die dortigen readingList und setList-Formate wären anzupassen, that's it more or less). (Aber grundsätzlich sind wir beieinander: Es macht nicht mehr den großen Sinn, Energie auf 433MHz-Zielgeräte zu verwenden; es sei denn, es ist was spezielles, das man nicht einfach so gegen bidirektionale Hardware ersetzen kann... Als Input-Device kann man das aber durchaus nutzen, mache ich bei MiLight ähnlich ;) ).
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: joelinux am 13 Februar 2020, 19:55:58
Zitat von: Beta-User am 03 Februar 2020, 16:14:18
Hmm, vielleicht hat sonst jemand eine Idee, wie man das umkonfiguriert, wie gesagt, ich werde aus der Doku auch nicht schlau, am ehesten könnte es noch sein, dass die Konfiguration über "sonoffswitchS203/action/set" beeinflußt werden kann..?

Ich habe meine ESPURNA 4-fach Steckdose über eine Telnet Verbindung angesprochen und mit den Terminal Kommandos

set relayPayloadOff off
set relayPayloadOn on
set relayPayloadToggle toggle
reload

umkonfigurieren können. Danach liefert MQTT als Status für die Relais anstatt 0,1 die Werte on oder off zurück.
Was relayPayloadToggle bewirkt habe ich noch nicht erkannt.

Konfiguration soll auch mit einem http upload zum internen Webserver der Steckdose möglich sein.
Dazu ist die gewünschte Konfiguration als JSON String zu formatieren


{
"app": "ESPURNA",
"relayPayloadOff": "off",
"relayPayloadOn": "on",
"relayPayloadToggle": "toggle"
}

und kann dann laut Espurna Wiki mit curl hochgeladen werden.

$ curl -F "file=@my-settings.json" -u admin:eigenes_passwort http://192.168.xxx.yyy/config

Ob die Konfiguration auch über MQTT möglich ist habe ich noch nicht herausgefunden.
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 15 Februar 2020, 07:58:18
Danke mal für diese Zwischeninfo; damit ist zumindest klar: Es geht, und man kann irgendwelche "Umetikettierungen" vermeiden :) .

Dann könnte man versuchen, den JSON mal via MQTT zu senden. Hal mal jemand ein list (ausnahmsweise bitte _kein_ RAW), in dem man die subscriptions sieht (müßte iVm. MQTT2_SERVER zu sehen sein) - da sollte der Zweig auftauchen, wenn es überhaupt geht... bzw. kann genau diesen JSON mal durchtesten?

(den curl-Befehl sollte man in den attrTemplate wohl eher nicht verwenden, sonst müßte ich die Zugangsdaten abfragen...). Evtl. kann es ja zwei attrTemplate geben. Jemand müßte dann halt erklären, wie man von "a) nach b)" kommt...)

Da "toggle" in der Regel nicht versendet wird, sondern nur das Ergebnis, finde ich es logisch, dass das "toggle" via MQTT nicht auftaucht, sondern nur die "on" & "off".
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: joelinux am 16 Februar 2020, 08:32:45
Hallo Beta-User,

in einer Debug Sitzung des ESPURNA Web Interfaces habe ich entdeckt, daß die von ESPURNA vorgenommenen MQTT subscriptions sichtbar werden. Die Informationen passen mit einen verbose 5 log des MQTT2 Servers zusammen.

Das Root Topic meiner 4-fach Steckerleiste ist Espurna-Arbeit.

[288849] [MQTT] Will topic: Espurna-Arbeit/status
[288891] [MQTT] Connected!
[288892] [MQTT] Unsubscribing to # (PID 1)
[288892] [MQTT] Subscribing to Espurna-Arbeit/relay/+/set (PID 2)
[288892] [MQTT] Subscribing to Espurna-Arbeit/pulse/+/set (PID 3)
[288895] [MQTT] Subscribing to Espurna-Arbeit/led/+/set (PID 4)
[288895] [MQTT] Subscribing to Espurna-Arbeit/action/set (PID 5)
[
 


Das action/set Topic nimmt nur die Payload reboot an.

Daraus entnehme ich, das die Konfiguration der MQTT Antworten nicht über MQTT Mittel geändert werden können.
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: joelinux am 16 Februar 2020, 08:58:50
Die aus zuvor erwähnter Debug Sitzung gewonnen Erkennnisse sind in eine neue Konfiguration eines
unified Espurna MQTT2 Gerätes eingeflossen.

Darf ich die hier mal zeigen?

Die Espurna Firmware ist dabei im Auslieferungszustand. Insbesondere ist in den MQTT Einstellungen
die Verwendung von JSON ausgeschaltet. (Key: mqttUseJson => "0"). Mit eingeschalteten JSON ändern
sich die MQTT Rückmeldungen und verlangen eine andere readingList. Weiterhin sind die Parameter (Keys)
relayPayloadOff, relayPayloadOn und relayPayloadToggle nicht gesetzt.

Ist sicher nicht perfekt. Meine Tasmota Mehrfach Steckerleisten sehen ähnlich aus.
Allerdings überlege ich, ob 'split' Geräte insgesamt besser zu handhaben sind.


define MQTT2_ESPURNA_556530 MQTT2_DEVICE ESPURNA_556530
attr MQTT2_ESPURNA_556530 DbLogExclude .*
attr MQTT2_ESPURNA_556530 IODev MQTT2_FHEM_Server
attr MQTT2_ESPURNA_556530 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 3.on:on:POWER3+off 3.off:off:POWER3+on 4.on:on:POWER4+off 4.off:off:POWER4+on 5.on:on:POWER5+off 5.off:off:POWER5+on
attr MQTT2_ESPURNA_556530 event-on-change-reading .*
attr MQTT2_ESPURNA_556530 genericDeviceType switch
attr MQTT2_ESPURNA_556530 model ESPurna_single_relay
attr MQTT2_ESPURNA_556530 readingList Espurna-Arbeit/relay/0:.* { $EVENT ? {"POWER1"=>"on"} : {"POWER1"=>"off"} }\
Espurna-Arbeit/relay/1:.* { $EVENT ? {"POWER2"=>"on"} : {"POWER2"=>"off"} }\
Espurna-Arbeit/relay/2:.* { $EVENT ? {"POWER3"=>"on"} : {"POWER3"=>"off"} }\
Espurna-Arbeit/relay/3:.* { $EVENT ? {"POWER4"=>"on"} : {"POWER4"=>"off"} }\
Espurna-Arbeit/relay/4:.* { $EVENT ? {"POWER5"=>"on"} : {"POWER5"=>"off"} }\
Espurna-Arbeit/status:.*  { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\
  Espurna-Arbeit/app:.* app\
  Espurna-Arbeit/version:.* version\
  Espurna-Arbeit/board:.* board\
  Espurna-Arbeit/host:.* host\
  Espurna-Arbeit/ssid:.* ssid\
  Espurna-Arbeit/ip:.* ip\
  Espurna-Arbeit/mac:.* mac\
  Espurna-Arbeit/rssi:.* rssi\
  Espurna-Arbeit/uptime:.* uptime\
  Espurna-Arbeit/datetime:.* datetime\
  Espurna-Arbeit/freeheap:.* freeheap\
  Espurna-Arbeit/vcc:.* vcc\
  Espurna-Arbeit/loadavg:.* loadavg\
  Espurna-Arbeit/desc:.* desc
attr MQTT2_ESPURNA_556530 room MQTT2_DEVICE
attr MQTT2_ESPURNA_556530 setList on Espurna-Arbeit/relay/0/set 1\
off Espurna-Arbeit/relay/0/set 0\
toggle Espurna-Arbeit/relay/0/set 2\
POWER1:on,off,toggle Espurna-Arbeit/relay/0/set $EVTPART1\
POWER2:on,off,toggle Espurna-Arbeit/relay/1/set $EVTPART1\
POWER3:on,off,toggle Espurna-Arbeit/relay/2/set $EVTPART1\
POWER4:on,off,toggle Espurna-Arbeit/relay/3/set $EVTPART1\
POWER5:on,off,toggle Espurna-Arbeit/relay/4/set $EVTPART1\
Reboot:reboot Espurna-Arbeit/action/set $EVTPART1
attr MQTT2_ESPURNA_556530 setStateList on off toggle
attr MQTT2_ESPURNA_556530 stateFormat LWT\
1:POWER1\
2:POWER2\
3:POWER3\
4:POWER4\
5:POWER5\
<br>\
<a href="http://ip" target="_blank">ip</a>

setstate MQTT2_ESPURNA_556530 Online\
1:off\
2:off\
3:off\
4:off\
5:off\
<br>\
<a href="http://192.168.x.xxx" target="_blank">192.168.x.xxx</a>
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:12 LWT Online
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:11 POWER1 off
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:11 POWER2 off
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:11 POWER3 off
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:11 POWER4 off
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:11 POWER5 off
setstate MQTT2_ESPURNA_556530 2020-02-16 08:03:00 Reboot set reboot
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:10 app ESPURNA
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:10 board ZHILDE_EU44_W
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:11 datetime 2020-02-16 15:03:09
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:10 desc 4-fach Steckerleiste
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:11 freeheap 20104
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:10 host Espurna-Arbeit
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:10 ip 192.168.x.xxx
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:12 loadavg 1
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:10 mac xx:xx:xx:xx:xx:xx
setstate MQTT2_ESPURNA_556530 2020-02-16 08:01:15 reboot set
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:10 rssi -86
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:10 ssid Snoopy
setstate MQTT2_ESPURNA_556530 2020-02-16 07:49:52 state set_on
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:11 uptime 25208
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:12 vcc 3189
setstate MQTT2_ESPURNA_556530 2020-02-16 15:03:10 version 1.14.0
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 17 Februar 2020, 10:54:06
Klar darfst du zeigen!

Hat mir geholfen, das besser in attrTemplate-Form zu bringen:

name:ESPurna_single_relay
filter:TYPE=MQTT2_DEVICE
desc:ESPurna is a alternative firmware comparable to tasmota, see <a href="https://github.com/xoseperez/espurna/wiki">project page wiki</a>. <br>NOTE: First experimental version, to contribute see <a href="https://forum.fhem.de/index.php/topic,108058.0.html">Forum Thread</a>. Template is for use without further configuration on ESP side, so especially no JSON is sent or relayPayload-xy is set!
order:A_30
par:DEVNAME;Device's name in the topic tree;{ AttrVal("DEVICE","readingList","") =~ m,([^:/]+)/([^/]+)/, ? $1 : undef }
par:ICON;ICON as set, defaults to on;{ AttrVal("DEVICE","icon","on") }
attr DEVICE icon ICON
attr DEVICE devStateIcon Online:10px-kreis-gruen Offline:10px-kreis-rot
attr DEVICE readingList DEVNAME/relay/0:.* relay_0\
  DEVNAME/relay/0:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }\
  DEVNAME/app:.* app\
  DEVNAME/version:.* version\
  DEVNAME/board:.* board\
  DEVNAME/host:.* host\
  DEVNAME/ssid:.* ssid\
  DEVNAME/ip:.* ip\
  DEVNAME/mac:.* mac\
  DEVNAME/rssi:.* rssi\
  DEVNAME/uptime:.* uptime\
  DEVNAME/datetime:.* datetime\
  DEVNAME/freeheap:.* freeheap\
  DEVNAME/vcc:.* vcc\
  DEVNAME/status:.* { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\\
  DEVNAME/loadavg:.* loadavg
attr DEVICE setList on DEVNAME/relay/0/set 1\
  off DEVNAME/relay/0/set 0\
  toggle DEVNAME/relay/0/set 2
attr DEVICE setStateList on off toggle
attr DEVICE event-on-change-reading .*
attr DEVICE stateFormat <a href="http://ip" target="_blank">\
LWT\
</a>\
state

set DEVICE attrTemplate mqtt2_speech_recognition_type_switch
attr DEVICE model ESPurna_single_relay

name:ESPurna_4relay_unified
filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*/relay/0.*
desc:ESPurna is a alternative firmware comparable to tasmota, see <a href="https://github.com/xoseperez/espurna/wiki">project page wiki</a>. <br>NOTE: First experimental version, to contribute see <a href="https://forum.fhem.de/index.php/topic,108058.0.html">Forum Thread</a>. Template is for use without further configuration on ESP side, so especially no JSON is sent or relayPayload-xy is set!
order:A_30b
par:DEVNAME;Device's name in the topic tree;{ AttrVal("DEVICE","readingList","") =~ m,([^:/]+)/([^/]+)/, ? $1 : undef }
par:ICON;ICON as set, defaults to on;{ AttrVal("DEVICE","icon","on") }
attr DEVICE icon ICON
attr DEVICE devStateIcon Online:10px-kreis-gruen Offline:10px-kreis-rot 0.on:on:POWER0+off 0.off:off:POWER0+on 1.on:on:POWER1+off 1.off:off:POWER1+on 2.on:on:POWER2+off 2.off:off:POWER2+on 3.on:on:POWER3+off 3.off:off:POWER3+on 4.on:on:POWER4+off 4.off:off:POWER4+on
attr DEVICE event-on-change-reading .*
attr DEVICE readingList DEVNAME/relay/0:.* { $EVENT ? {"POWER0"=>"on"} : {"POWER0"=>"off"} }\
  DEVNAME/relay/1:.* { $EVENT ? {"POWER1"=>"on"} : {"POWER1"=>"off"} }\
  DEVNAME/relay/2:.* { $EVENT ? {"POWER2"=>"on"} : {"POWER2"=>"off"} }\
  DEVNAME/relay/3:.* { $EVENT ? {"POWER3"=>"on"} : {"POWER3"=>"off"} }\
  DEVNAME/status:.*  { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\
  DEVNAME/app:.* app\
  DEVNAME/version:.* version\
  DEVNAME/board:.* board\
  DEVNAME/host:.* host\
  DEVNAME/ssid:.* ssid\
  DEVNAME/ip:.* ip\
  DEVNAME/mac:.* mac\
  DEVNAME/rssi:.* rssi\
  DEVNAME/uptime:.* uptime\
  DEVNAME/datetime:.* datetime\
  DEVNAME/freeheap:.* freeheap\
  DEVNAME/vcc:.* vcc\
  DEVNAME/loadavg:.* loadavg\
  DEVNAME/desc:.* desc
attr DEVICE setList on DEVNAME/relay/0/set 1\
  off DEVNAME/relay/0/set 0\
  toggle DEVNAME/relay/0/set 2\
  POWER0:on,off,toggle DEVNAME/relay/0/set $EVTPART1\
  POWER1:on,off,toggle DEVNAME/relay/1/set $EVTPART1\
  POWER2:on,off,toggle DEVNAME/relay/2/set $EVTPART1\
  POWER3:on,off,toggle DEVNAME/relay/3/set $EVTPART1\
  Reboot:reboot DEVNAME/action/set $EVTPART1
attr DEVICE setStateList on off toggle
attr DEVICE stateFormat LWT\
0:POWER0\
1:POWER1\
2:POWER2\
3:POWER3\
<br>\
<a href="http://ip" target="_blank">ip</a>
set DEVICE attrTemplate mqtt2_speech_recognition_type_switch
attr DEVICE model ESPurna_4relay_unified

name:ESPurna_4relay_split
filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*/relay/0.*
desc:ESPurna is a alternative firmware comparable to tasmota, see <a href="https://github.com/xoseperez/espurna/wiki">project page wiki</a>. <br>NOTE: First experimental version, to contribute see <a href="https://forum.fhem.de/index.php/topic,108058.0.html">Forum Thread</a>. Template is for use without further configuration on ESP side, so especially no JSON is sent or relayPayload-xy is set!
order:A_30a
par:DEVNAME;Device's name in the topic tree;{ AttrVal("DEVICE","readingList","") =~ m,([^:/]+)/([^/]+)/, ? $1 : undef }
par:ICON;ICON as set, defaults to on;{ AttrVal("DEVICE","icon","on") }
attr DEVICE icon ICON
attr DEVICE event-on-change-reading .*
attr DEVICE setStateList on off toggle
set DEVICE attrTemplate mqtt2_speech_recognition_type_switch
attr DEVICE model ESPurna_4relay_split
deletereading -q DEVICE (?!associatedWith).*
copy DEVICE DEVICE_CH1
copy DEVICE DEVICE_CH2
copy DEVICE DEVICE_CH3
setreading DEVICE_CH1 associatedWith DEVICE,DEVICE_CH2,DEVICE_CH3
setreading DEVICE_CH2 associatedWith DEVICE,DEVICE_CH1,DEVICE_CH3
setreading DEVICE_CH3 associatedWith DEVICE,DEVICE_CH1,DEVICE_CH2
attr DEVICE_CH1 readingList DEVNAME/relay/1:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }
attr DEVICE_CH2 readingList DEVNAME/relay/2:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }
attr DEVICE_CH3 readingList DEVNAME/relay/3:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }
attr DEVICE readingList DEVNAME/relay/0:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }\
  DEVNAME/app:.* app\
  DEVNAME/version:.* version\
  DEVNAME/board:.* board\
  DEVNAME/host:.* host\
  DEVNAME/ssid:.* ssid\
  DEVNAME/ip:.* ip\
  DEVNAME/mac:.* mac\
  DEVNAME/rssi:.* rssi\
  DEVNAME/uptime:.* uptime\
  DEVNAME/datetime:.* datetime\
  DEVNAME/freeheap:.* freeheap\
  DEVNAME/vcc:.* vcc\
  DEVNAME/status:.* { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\\
  DEVNAME/loadavg:.* loadavg
attr DEVICE_CH1 setList on DEVNAME/relay/1/set 1\
  off DEVNAME/relay/1/set 0\
  toggle DEVNAME/relay/1/set 2
attr DEVICE_CH2 setList on DEVNAME/relay/2/set 1\
  off DEVNAME/relay/2/set 0\
  toggle DEVNAME/relay/2/set 2
attr DEVICE_CH3 setList on DEVNAME/relay/3/set 1\
  off DEVNAME/relay/3/set 0\
  toggle DEVNAME/relay/3/set 2
attr DEVICE setList on DEVNAME/relay/0/set 1\
  off DEVNAME/relay/0/set 0\
  toggle DEVNAME/relay/0/set 2\
  Reboot:reboot DEVNAME/action/set $EVTPART1
attr DEVICE devStateIcon Online:10px-kreis-gruen Offline:10px-kreis-rot
attr DEVICE stateFormat <a href="http://ip" target="_blank">\
LWT\
</a>\
state
setreading DEVICE associatedWith DEVICE_CH1,DEVICE_CH2,DEVICE_CH3


Ein paar Anmerkungen:
- Das "ummappen" der Kanal-Zahlen finde ich tendenziell verwirrend; ich hatte das mal bei den Shelly's, habe dort aber dann gemerkt, dass es die user spätestens dann verwirrt, wenn "plötzlich" weitere Readings zu den Kanälen dazukommen (dort waren es Verbrauchswerte).
- Ich gehe davon aus, dass JSON per default aus ist.
- Da das Ändern der payload ziemlich tricky ist, verzichten wir eben drauf, geht ja auch anders...
- "split" ist v.a. dann besser, wenn man die Kanäle wirklich separat verwendet, weil dann z.B. die setExtensions "ootb" funktionieren. Anders sollte man das nur machen, wenn man z.B. Rollläden darüber steuert und FHEM eher die "logische Kontrolle" über alle Kanäle übernimmt (z.B. via ROLLO). (Aber hier hat Tasmota mAn. dann die Nase vorn: Da gibt es direkt in der firmware eine shutter-Einstellung, die zumindest vom Konzept her dann DIE Lösung ist).

Wäre natürlich super, wenn ihr mir Rückmeldung geben könntet, ob das funktioniert wie es soll, sonst muß ich "auf Verdacht" einchecken (ggf. einfach eine Kopie eurer Geräte zum Testen verwenden, dann sollte das nebenwirkungsfrei gehen...!)
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: joelinux am 17 Februar 2020, 17:29:17
Das war jetzt aber superschnell.  :)

Aktuell habe ich nur eine 4-fach Steckerleiste mit ESPurna laufen.
Nun, und da geht es schon los mit Verwirrung von Bezeichnungen. Die Steckerleiste ist mit 5 Relays bestückt. Vier davon fungieren als
Steckdosen. Das 5. Relay schaltet ein USB Netzteil mit 4 USB Anschlüssen. In anderen Darstellungen wird auch von 4 x AC+USB gesprochen.
Sorry für die Ungenauigkeit.

Ich habe daher deine Templates genommen und diese als ESPurna_4socketUSB_unified und ESPurna_4socketUSB_split nach
/opt/fhem/FHEM/lib/AttrTemplate/espurna.template abgelegt. Mit reichlich { AttrTemplate_Initialize() } und Verprobung möchte
ich diese beiden Templates zur Ansicht geben.

Motivation für das remapping der relay Kanal-Zahlen ist mein Wunsch ESPurna so ähnlich wie möglich wie Tasmota zu steuern.
Tasmota liefert für eine 4 x AC+USB Steckerleiste die Werte POWER1 bis POWER5.
POWER5 ist in der Regel das USB Netzteil (ist aber über eigene Tasmota Templates auf einen beliebigen Kanal=POWERx konfigurierbar).
ESPurna habe ich im Einsatz weil ich den Eindruck habe das ESPurna auch bei schlechter Wlan Abdeckung eine bessere Verfügbarkeit bereitstellt.
Daher ist hier nur wenig ESPurna und viel Tasmota im Einsatz.

Eine weiterer Wunsch ist die Wlan Erreichbarkeit für jeden Kanal sichtbar zu machen. Eine von Netz getrennte Steckerleiste ist so gut zu erkennen.
Daher liest mein 'split' Template in allen Kanälen das 'Last Will Testament' Topic aus.
Ebenso möchte ich recht einfach das Web Interface des Gerätes aus allen Kanälen erreichen.
Verwaltungs Informationen wie Wlan RSSI oder Versions Informationen sehe ich gerne nur im Stamm Gerät.

Hoffentlich werde ich jetzt nicht zusehr Off Topic. 
 
name:ESPurna_4socketUSB_unified
filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*/relay/0.*
desc:ESPurna is a alternative firmware comparable to tasmota, see <a href="https://github.com/xoseperez/espurna/wiki">project page wiki</a>. <br>NOTE: First experimental version, to contribute see <a href="https://forum.fhem.de/index.php/topic,108058.0.html">Forum Thread</a>. Template is for use without further configuration on ESP side, so especially no JSON is sent or relayPayload-xy is set!
order:A_30b
par:DEVNAME;Device's name in the topic tree;{ AttrVal("DEVICE","readingList","") =~ m,([^:/]+)/([^/]+)/, ? $1 : undef }
par:ICON;ICON as set, defaults to hue_filled_outlet;{ AttrVal("DEVICE","icon","hue_filled_outlet") }
attr DEVICE icon ICON
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 3.on:on:POWER3+off 3.off:off:POWER3+on 4.on:on:POWER4+off 4.off:off:POWER4+on 5.on:on:POWER5+off 5.off:off:POWER5+on
attr DEVICE event-on-change-reading .*
attr DEVICE readingList DEVNAME/relay/0:.* { $EVENT ? {"POWER1"=>"on"} : {"POWER1"=>"off"} }\
  DEVNAME/relay/1:.* { $EVENT ? {"POWER2"=>"on"} : {"POWER2"=>"off"} }\
  DEVNAME/relay/2:.* { $EVENT ? {"POWER3"=>"on"} : {"POWER3"=>"off"} }\
  DEVNAME/relay/3:.* { $EVENT ? {"POWER4"=>"on"} : {"POWER4"=>"off"} }\
  DEVNAME/relay/4:.* { $EVENT ? {"POWER5"=>"on"} : {"POWER5"=>"off"} }\
  DEVNAME/status:.*  { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\
  DEVNAME/app:.* app\
  DEVNAME/version:.* version\
  DEVNAME/board:.* board\
  DEVNAME/host:.* host\
  DEVNAME/ssid:.* ssid\
  DEVNAME/ip:.* ip\
  DEVNAME/mac:.* mac\
  DEVNAME/rssi:.* rssi\
  DEVNAME/uptime:.* uptime\
  DEVNAME/datetime:.* datetime\
  DEVNAME/freeheap:.* freeheap\
  DEVNAME/vcc:.* vcc\
  DEVNAME/loadavg:.* loadavg\
  DEVNAME/desc:.* desc
attr DEVICE setList on DEVNAME/relay/0/set 1\
  off DEVNAME/relay/0/set 0\
  toggle DEVNAME/relay/0/set 2\
  POWER1:on,off,toggle DEVNAME/relay/0/set $EVTPART1\
  POWER2:on,off,toggle DEVNAME/relay/1/set $EVTPART1\
  POWER3:on,off,toggle DEVNAME/relay/2/set $EVTPART1\
  POWER4:on,off,toggle DEVNAME/relay/3/set $EVTPART1\
  POWER5:on,off,toggle DEVNAME/relay/4/set $EVTPART1\
  Reboot:reboot DEVNAME/action/set $EVTPART1
attr DEVICE setStateList on off toggle
attr DEVICE stateFormat LWT\
1:POWER1\
2:POWER2\
3:POWER3\
4:POWER4\
5:POWER5\
<br>\
<a href="http://ip" target="_blank">ip</a>
set DEVICE attrTemplate mqtt2_speech_recognition_type_switch
attr DEVICE model ESPurna_4socketUSB_unified
deletereading -q DEVICE relay_.*

name:ESPurna_4socketUSB_split
filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*/relay/4.*
desc:ESPurna is a alternative firmware comparable to tasmota, see <a href="https://github.com/xoseperez/espurna/wiki">project page wiki</a>. <br>NOTE: First experimental version, to contribute see <a href="https://forum.fhem.de/index.php/topic,108058.0.html">Forum Thread</a>. <br>NOTE: Tested with 5-way multi socket ZHILDE_EU44_W. <br>NOTE: Template is for use without further configuration on ESP side, so especially no JSON is sent or relayPayload-xy is set!
order:A_90a
par:DEVNAME;Device's name in the topic tree;{ AttrVal("DEVICE","readingList","") =~ m,([^:/]+)/([^/]+)/, ? $1 : undef }
par:ICON;ICON as set, defaults to hue_filled_outlet;{ AttrVal("DEVICE","icon","hue_filled_outlet") }
attr DEVICE icon ICON
attr DEVICE event-on-change-reading .*
attr DEVICE setStateList on off toggle
set DEVICE attrTemplate mqtt2_speech_recognition_type_switch
attr DEVICE model ESPurna_4socketUSB_split
attr DEVICE devStateIcon Online:10px-kreis-gruen Offline:10px-kreis-rot
attr DEVICE stateFormat <a href="http://ip" target="_blank">ip\
LWT\
</a>\
state
deletereading -q DEVICE (?!associatedWith).*
copy DEVICE DEVICE_CH2
copy DEVICE DEVICE_CH3
copy DEVICE DEVICE_CH4
copy DEVICE DEVICE_USB
setreading DEVICE_CH2 associatedWith DEVICE,DEVICE_CH3,DEVICE_CH4,DEVICE_USB
setreading DEVICE_CH3 associatedWith DEVICE,DEVICE_CH2,DEVICE_CH4,DEVICE_USB
setreading DEVICE_CH4 associatedWith DEVICE,DEVICE_CH2,DEVICE_CH3,DEVICE_USB
setreading DEVICE_USB associatedWith DEVICE,DEVICE_CH2,DEVICE_CH3,DEVICE_CH4
attr DEVICE_CH2 readingList DEVNAME/relay/1:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }\
  DEVNAME/status:.* { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\
  DEVNAME/ip:.* ip
attr DEVICE_CH3 readingList DEVNAME/relay/2:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }\
  DEVNAME/status:.* { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\
  DEVNAME/ip:.* ip
attr DEVICE_CH4 readingList DEVNAME/relay/3:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }\
  DEVNAME/status:.* { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\
  DEVNAME/ip:.* ip
attr DEVICE_USB readingList DEVNAME/relay/4:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }\
  DEVNAME/status:.* { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\
  DEVNAME/ip:.* ip
attr DEVICE readingList DEVNAME/relay/0:.* { $EVENT ? {"state"=>"on"} : {"state"=>"off"} }\
  DEVNAME/app:.* app\
  DEVNAME/version:.* version\
  DEVNAME/board:.* board\
  DEVNAME/host:.* host\
  DEVNAME/ssid:.* ssid\
  DEVNAME/ip:.* ip\
  DEVNAME/mac:.* mac\
  DEVNAME/rssi:.* rssi\
  DEVNAME/uptime:.* uptime\
  DEVNAME/datetime:.* datetime\
  DEVNAME/freeheap:.* freeheap\
  DEVNAME/vcc:.* vcc\
  DEVNAME/status:.* { $EVENT ? {"LWT"=>"Online"} : {"LWT"=>"Offline"} }\
  DEVNAME/loadavg:.* loadavg\
  DEVNAME/desc:.* desc
attr DEVICE_CH2 setList on DEVNAME/relay/1/set 1\
  off DEVNAME/relay/1/set 0\
  toggle DEVNAME/relay/1/set 2
attr DEVICE_CH3 setList on DEVNAME/relay/2/set 1\
  off DEVNAME/relay/2/set 0\
  toggle DEVNAME/relay/2/set 2
attr DEVICE_CH4 setList on DEVNAME/relay/3/set 1\
  off DEVNAME/relay/3/set 0\
  toggle DEVNAME/relay/3/set 2
attr DEVICE_USB setList on DEVNAME/relay/4/set 1\
  off DEVNAME/relay/4/set 0\
  toggle DEVNAME/relay/4/set 2
attr DEVICE setList on DEVNAME/relay/0/set 1\
  off DEVNAME/relay/0/set 0\
  toggle DEVNAME/relay/0/set 2\
  Reboot:reboot DEVNAME/action/set $EVTPART1
attr DEVICE devStateIcon Online:10px-kreis-gruen Offline:10px-kreis-rot
attr DEVICE stateFormat <a href="http://ip" target="_blank">ip\
LWT\
</a>\
state
setreading DEVICE associatedWith DEVICE_CH2,DEVICE_CH4,DEVICE_CH4,DEVICE_USB
Titel: Antw:MQTT2_DEVICE und Espurna
Beitrag von: Beta-User am 17 Februar 2020, 17:48:48
...überredet...

Zumindest für die USB-Variante dürfte das ok sein, und wir haben hier ja "ausgiebig" diskutiert, dass man das "eigentlich" nicht machen sollte - aber das "Umstiegsargument" von Tasmota ist gut - ebenso der Hinweis, dass evtl. die WLAN-Performance@ESPurna besser ist.

(Und die challenge, das mit dem LWT selbst auf stateFormat-Basis hinzubiegen, hast du ja erfolgreich angenommen ;D ).

Ich schau's nochmal durch, sieht aber (bis auf 1xorder?) erst mal gut aus. Kommt also demnächst per update :) .