But I don’t want to turn something on. I want to make the value available to display later on
So something like
mqtt:
id: example_id
if (x.containsKey("example_value"))
value = x["example_value"];
return value;
Sensor:
Id: example_id:
(Where value is from MQTT json)
it.printf(0, 0, id(sz_13), "The data is: %s", id(example_id).state.c_str());
//default display setup code for reference not shown
pages:
- id: page1
lambda: |-
it.image(20, 30, id(spinning_fan));
- id: page2
lambda: |-
it.printf(10, 10, id(sz_13), “IDX is: %s”, id(itho_mode).c_str());
it.printf(10, 20, id(sz_13), “The data is: %s”, id(itho_state).c_str());
’ ’ ’ ’
This does work but crahes a lot probably because it messes up the heap and stack. But maybe someone finds a improved way of doing this?
I don’t see an obvious reason why it would crash. Does it get lots and lots of messages on that topic or are those message to big for the memory of your device?
Other then that I don’t think it messes in any way with the heap or stack. Can you provide the log (over USB) of such a crash?