Customize Device State Payload Structure

I use some devices that do not allow the total free modification of the payload structure (more specifically Weintek iE series HMIs), but the format is close enough to the standard structure, only having “d” instead of “data” and “ts” instead of “time” and I was able to handle it in the workflow by changing the string, but this consumes two messages per update.

If there is a way to allow editing the structure or avoid duplicating the consumption of messages, it would help me a lot!

Payload example:

	"d" : {
	"myvalue1" : 0,
	"myvalue2" : 0,
	"ts" : "2022-10-31T10:25:02.555170"

Hi @Denys_Willian and welcome to the Losant Forums!

Unfortunately there is no way to modify that device state payload structure to accommodate different object shapes. I assume what you are doing right now is publishing the message to a custom MQTT topic and then using a workflow to save the values in that message as device state properties? If so, you are correct, that will consume two payloads: one for the custom MQTT topic message and one for the state writing.

Please let us know if you have any other questions.

Yes, that’s right, no problem!
Thanks for the quick response!