Publish sensor values as JSON over MQTT

Hello!

I want to have most of the data from my homey published to MQTT, sorted as JSON pr device/room.

The flow below works, but it is a bit of work to do this for every device in my home. I assume there is a better/easier way of doing this. Also it would be nice to replace “airquality” with the actual devicename in the topic string if possible.

I know of the MQTT Hub, that pukes out all my data, but it looks like a mess. I want the data sorted as described above :slight_smile:

Any help is very appreciated :slight_smile:

Probably better to send the values every xx Minutes all together in 1 message:
image