[gelöst] MQTT ReadingsList formatieren

Begonnen von SebastianStorb, 15 Januar 2023, 18:44:48

Vorheriges Thema - Nächstes Thema

SebastianStorb

Wie muss ich diese Einträge meiner ReadingsList formatieren, damit für jeder Eintrag ein eigenes Reading erzeugt wird? Derzeit werden z.B. alle */Power in ein Reading (P_value) geschrieben.


CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L1/Current:.* { json2nameValue($EVENT, 'Current_', $JSONMAP) }
CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L1/Power:.* { json2nameValue($EVENT, 'Power_', $JSONMAP) }
CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L2/Current:.* { json2nameValue($EVENT, 'Current_', $JSONMAP) }
CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L2/Power:.* { json2nameValue($EVENT, 'Power_', $JSONMAP) }
CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L3/Current:.* { json2nameValue($EVENT, 'Current_', $JSONMAP) }
CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L3/Power:.* { json2nameValue($EVENT, 'Power_', $JSONMAP) }


Das hat leider nicht zum Ergebnis geführt:
CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L1/Current:.* ConsumptionL1Current
CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L1/Power:.* { ConsumptionL1Power($EVENT, 'Power_', $JSONMAP) }


Vielen Dank

Otto123

#1
Hi,

ganz vereinfacht warst Du an der völlig falschen Stelle :) Du hast den Funktionsaufruf geändert ohne eine neue Funktion zu schreiben?
CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L3/Current:.* { json2nameValue($EVENT, 'L3_Current_', $JSONMAP) }
CerboGxClient:N/c0619ab1e261/system/0/Ac/Consumption/L3/Power:.* { json2nameValue($EVENT, 'L3_Power_', $JSONMAP) }


Aber da gäbe es auch noch mehr Möglichkeiten...
Hier gibt es etwas Beschreibung https://wiki.fhem.de/wiki/MQTT2_DEVICE_-_Schritt_f%C3%BCr_Schritt

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

SebastianStorb