Mqtt send two commands same time

Hi Community!
I have a tuya device controlled by mqtt in openhab.
All works perfect, but only one channel makes me crazy.
I must send two commands same time to different channels.
Here is the original code:

[(‘tuya/vento/dps/113/state’, ‘1’), (‘tuya/vento/dps/133/state’, ‘3’)]

How can I send this in openhab?
Any Ideas?

Thanks!

In computers there really is no such thing as at the same time. There is only ever really close together. You can send two commands to two Items one right after the other and they will occur within milliseconds of each other. But they will never be sent at the same time.

Furthermore, the way MQTT works doesn’t support publishing and receiving two messages at the same time, even if they were publishes at the exact same time.

So you just need to send these really close together which is easy enough and you have several options.

  1. Put the two Items linked to the two Channels in a Group and send the command to the Group. Commands sent to a Group get forwarded to all members of the Group.
  2. Use a rule and the publishMQTT action to send the first message and on the next line send the second message.
  3. Link both Channels to the same Item. A command send to the Item will go to both Channels.

In 1 and 3 you may need a transformation to convert the command to the right message top send to the topic.

Without more details it’s impossible to be more specific.

Hi, thanks!

Maybe there is another problem:
When I send letters like : cool, heat, fan the device makes all fine.
When I send numbers like 1,2,3 there is nothing happened.
I send them as string.
Here is the original tuya code:

“code”: “up_down_sweep”,
“custom_name”: “”,
“dp_id”: 113,
“type”: “enum”,
“value”: “1”

Is there another possibility to send numbers?

Without the openHAB configs :person_shrugging:

Certainly but the Channel needs to be a number channel.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.