When I reset a Osram smart bulb doing the on-5-sec/off-5-sec sequence four or five…
- User
When I reset a Osram smart bulb doing the on-5-sec/off-5-sec sequence four or five times, I see it pairing with zigbee2mqtt and I can see its binary friendly name (0x7cb03eaa0a043be1) equal to its ieee_address. Using mosquitto, how do I write a command to toggle the light on and off?
Assistant
Here is how you can toggle the Osram smart bulb on and off via MQTT using its IEEE address:
// Turn light on mosquitto_pub -h mqtt_broker_host -t "zigbee2mqtt/0x7cb03eaa0a043be1/set" -m "{\"state\": \"ON\"}" // Turn light off mosquitto_pub -h mqtt_broker_host -t "zigbee2mqtt/0x7cb03eaa0a043be1/set" -m "{\"state\": \"OFF\"}"The key things:
- The topic uses the IEEE address of the device:
zigbee2mqtt/0x7cb03eaa0a043be1/set - The message payload sets the state to either
"ON"or"OFF"
So by publishing to the
settopic with the state, you can toggle the light on and off.- The topic uses the IEEE address of the device:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.