FHEM Forum

FHEM - Hausautomations-Systeme => MQTT => Thema gestartet von: appi am 17 März 2025, 19:56:44

Titel: notify mqtt publish mit Variable in Hochkomma
Beitrag von: appi am 17 März 2025, 19:56:44
Hallo
nach längerer Suche wäre ich um einen weiteren Tip sehr dankbar.

in eine notify will ich eine mqtt message  publischen
set my_extern_Broker publish -r hasp/plate_2/command/p1b81.jsonl {"text":$EVTPART1}
im Broker kommt dann
p1b81.jsonl = {"text":7891.000}

Ich brauche aber :

p1b81.jsonl = {"text":"7891.000"}
Also die Variabel in Hochkomma. Allerdings wenn ich Hochkomma im notify setze wird die Variable nicht als soche erkannt......

Bitte um einen Tipp

danke und gruss

Titel: Aw: notify mqtt publish mit Variable in Hochkomma
Beitrag von: rudolfkoenig am 17 März 2025, 21:29:54
ZitatAllerdings wenn ich Hochkomma im notify setze wird die Variable nicht als soche erkannt......

Bei mir scheint es zu funktionieren:
fhem> defmod n notify n set myBroker publish topic { "text":"$EVENT" }
fhem> trigger n myText
liefert
topic { "text":"myText" }
Titel: Aw: notify mqtt publish mit Variable in Hochkomma
Beitrag von: appi am 18 März 2025, 07:13:20
Besten Dank Rudi

ja, es funktioniert.......  sorry.

Auch nach geschätzten 15 Jahren mit FHEM immer noch glücklich mit der SW, danke Rudi