Read 2 value from a MQTT message?

I have mqtt message that have 2 values in;

{"NSPanel":{"id":"7","params":{"switch":"on","switches":[{"switch":"on","outlet":0}]}}}

From this I would like to get id and switch.

Is could create 8 channels and filter each by id to get the switch out, but i really don’t like that. Is there a way I can read the whole json into a script and have that do the logic is the script generically for all 8?

Use a text Channel linked to a String Item. Trigger a rule when the Item receives an update and parse it in that rule.

ofc! I didn’t really think that through did I? :slight_smile: