Skip Navigation

Parse multiple devices from a single mqtt topic?

I have a single mqtt topic that contains all my humidity/temperature sensors. Each message is simply a json containing the sensor values, a timestamp and sensor ID.

HA can read the topic just fine, but seems to have problems parsing out the device names. I managed to split humidity and tempature into to sensors (by the magic of defining the sensor twice), but I can't really distinguish between the different devices.

Is there a way to dynamically parse the device IDs and create sensors based on that? If necessary, I could do a bit of magic in Telegraf, but I assume HA can do that itself?

1
1 comments