I am currently using an EM3588 gateway USB stick that is connected to a light demo board and a capacitive sense dimmer switch. I want to be able to send a MQTT CLI command asking whether the light is on or off and have it publish its on/off (I only seem to be able to tell if device state (if its joined, active, etc)). Is this possible?
There is a way using the ZCL CLI commands and to read the cluster's attributes. For a light the notable clusters are the on-off cluster (0x0006) and the level cluster (0x0008). You'll also need to determine the index number (indexNum) of the target device.
To read you'll want to use this command format:
zcl global read [cluster] [attribute]
To read the on-off cluster of a device with index 1, here are the two commands:
zcl global read 0x0006 0
custom send 1
To read the level cluster of a device with index 6, here are the two commands:
zcl global read 0x0008 0
custom send 6
Using v1.1.0 you'll then need to pack it into the MQTT publish command structure:
MQTT topic: gw/<eui64_id>/command
postDelayMs: <time> // optional
With v1.1.0 to see the command execute, subscribe to MQTT topic:
MQTT topic: gw/<eui64_id>/executed
For more options, you'll want to look for the AF CLI document within your ZNET stack release to read more on the available ZCL commands.