I'm very new to mysensors and home assistant so chances are that I misunderstood something completely.
I've been playing around with one node and one gateway connected via serial to my Raspberry Pi and the entities, one for temperature and one for pressure, are found in home assistant.
The temperature sensor is working fine and i am able to get a nice "line chart" on my home screen but when I try to do the same with my pressure sensor I get an error saying that the sensor does not have a "unit of measurement" and thus the line chart can not be drawn. Another annoying thing is that the pressure sensor creates a message in the log saying something like "sensor 1_0 changed to 954.3" everytime the value changes.
So looking over the integration guide at home assistant's homepage I read the following:
By using V_UNIT_PREFIX, it’s possible to set a custom unit for any sensor. The string value that is sent for V_UNIT_PREFIX will be used in preference to any other unit of measurement, for the defined sensors. V_UNIT_PREFIX can’t be used as a stand-alone sensor value type. Sending a supported value type and value from the tables above is also required. V_UNIT_PREFIX is available with MySensors version 1.5 and later.
Trying this generates an error saying something like "Not a valid message sub-type: 43 for dictionary value @ data['sub-type']"
Reading the Serial Protocol 2.X I find that the variable "V_UNIT_PREFIX" is to be used with the sensor types S_DISTANCE, S_DUST or S_AIR_QUALITY. It does not say anything about the S_BARO being compatible with the V_UNIT_PREFIX.
I'm not at home right now so I can't supply any source code at the moment but I still have some questions you might be able to answer:
Am I doing this the wrong way? I.e. should just skip the V_UNIT_PREFIX from the node and somehow set the unit in home assistant? Is this what you would use Templates for?
Does anyone have a working example to post using a pressure sensor.