Hi all,
i got a JSON value from MQTT and have no success to pare a value from them.
JSON-MQTT-Message:
{“Time”:“2024-03-23T12:57:47”,“SML”:{“curr_w”:210}}
I am able to find “SML” … but not curr_w or the value …
next problem… if i try to enable the line //id(itho_state) = svalue;
the device crashes.
I am unable to check / list / debug the content while in “lambda”-part
I am grateful for every hint
I’ve tried the following:
globals:
- id: OLEDMessage
type: std::string
mqtt:
....
on_json_message:
topic: fhem/sensors/Tasmota_ORBIS/tele/SENSOR
then:
- lambda: |-
id(OLEDMessage) = "N A N";
if (x.containsKey("SML")){
id(OLEDMessage) = "SMLfound";
const char *svalue = x["SML"];
//id(OLEDMessage) = svalue;
}