I´m using a manual MQTT approach from an ESP8266
(Using the PubSUb library), and btw everything is working fine.
The actual Cayenne mqtt message payload (Actuator Command) consists of:
a Sequence Identifier followed by the actual Value (0 = Off, 1 = On)
For example: “2etaExGxnMJz1NQ,0”.
(I´ve “grabbed” it using MQTT.fx)
Is that “Sequence Identifier” permanent and unique?
Or it might change with time?
I´m just disregarding that part of the string, and it does the trick!
Just read they payload´s character position number 17, which is the “state” value, using an IF function…
if ((char)payload[16] == ‘0’)
or
if ((char)payload[16] == ‘1’)
What language are you using? I would recommend using a split to ensure if the length of the sequence ever changes you don’t get errors. In python this is what I use: