@wutu Well, I can’t comment on the problem regarding pimatic hap versus pimatic-mqtt.
I think Mqtt has a big advantage or disadvantage depending on how you look at this: “MQTT provides no support for labelling messages with types or other metadata to help clients understand it. MQTT messages can be used for any purpose, but all clients must know the message formats up-front to allow communication.” [MQTT and CoAP, IoT Protocols]. Efforts have been undertaken to augmenting MQTT, i.e. OASIS “MQTT and Message Metadata”, but I don’t think this has been implemented so far.
To fill the gaps you can publish some meta data along with the payload to let the subscriber map data to a given type. The disadvantage, however, is a significant overhead in data published. You may need more bytes for the meta data than the actual payload. Another possibilty is to use a topic per variable and to have some implicit knowledge about the associated type. But I think this is not very flexible.
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law