I can’t figure out how to put the result of a MQTT topic into a variable (number, so not a string).
I made a script that parses the temp and hum into a variable for the topic: itho/sensor
This script works fine and the humidity and temperature is put into a variable (number)
The challenge I have with the topic: itho/state is that it is overwritten bij the other MQTT topic itho/sensor.
The first flow is triggered by MQTT: itho/state/sensor. The second flow by: itho/state.
What happend is that the variable of topic: itho/state is switching between a number 11 and {'temp":20,“hum”:41.9}.
Does anybody know how to put the topic: itho/state into a variable (number, not a string) and/or can I add this to my current scripts?