# Customize Device State Payload Structure

**URL:** <https://forums.losant.com/t/customize-device-state-payload-structure/4796>\
**Category:** Feature Request\
**Tags:** mqtt, state, device, device-state\
**Created:** [November 3, 2022, 12:29pm UTC](https://forums.losant.com/t/customize-device-state-payload-structure/4796 "2022-11-03T12:29:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Denys\_Willian](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@Denys\_Willian](https://forums.losant.com/u/Denys_Willian)\
**Post date:** [November 3, 2022, 12:29pm UTC](https://forums.losant.com/t/customize-device-state-payload-structure/4796/1 "2022-11-03T12:29:14Z")

</div>

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:

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

```

---

<div class="post-metadata">

**Author:** ![Dylan\_Schuster](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.losant.com/dylan_schuster/32/2850_2.png) [@Dylan\_Schuster](https://forums.losant.com/u/Dylan_Schuster)\
**Post date:** [November 3, 2022, 12:44pm UTC](https://forums.losant.com/t/customize-device-state-payload-structure/4796/2 "2022-11-03T12:44:25Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Denys\_Willian](https://avatars.discourse-cdn.com/v4/letter/d/5fc32e/32.png) [@Denys\_Willian](https://forums.losant.com/u/Denys_Willian)\
**Post date:** [November 3, 2022, 12:51pm UTC](https://forums.losant.com/t/customize-device-state-payload-structure/4796/3 "2022-11-03T12:51:35Z")

</div>

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