@andrew said in which sensor and msg type for switch/dimmer node (sender only)?:
by browsing the API documentation I did not find mapping details between the message type enums and their corresponding data representing format.
so, from where should I know that e.g. V_PERCENTAGE messages needs uint8_t and not anything else? as I see it is possible to send any data format for any message type.
I have not seen a list , there was a post that asked the same thing but it did not seem to go anywhere.
if I have to handle the messages between my nodes then it is not that problematic, but if it has to be forwarded to the controller then it would be nice to have it standardized.
If I am unsure I usually just get the data type from the serial data during construction/testing. Just look at the send data, the payload type (pt) will be shown there. The send message below for a binary device shows pt=1 which is a byte.
The definitions for pt are
P_STRING = 0, P_BYTE = 1, P_INT16 = 2, P_UINT16 = 3, P_LONG32 = 4,
P_ULONG32 = 5, P_CUSTOM = 6, P_FLOAT32 = 7
Be mindful that the receive message is different:
You can see the message sent from the controller for the same switch arrives as pt=0 which is a string.
You can also use the handy Log Parser to decode the serial data. here is the readout for the previous two lines.