z2m_set_state
Send state commands to Zigbee devices or groups (e.g., turn ON/OFF, set brightness). Use 'get' mode to request a value without changing anything; confirm device action by reading state afterward.
Instructions
Send a state command to a device or group, e.g. {"state":"ON"} or {"brightness":128}. Physically changes what the device is doing, and is reversible by sending the opposite command. mode='get' instead requests a value without changing anything. The command is published without waiting for the device, so success here means the message was sent, not that the device acted — read z2m_get_device afterwards to confirm. Consult z2m_get_device exposes for valid properties.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | Default 'set'. | |
| device | Yes | Device or group friendly_name, or ieee_address. | |
| payload | Yes | Command payload, e.g. {"state": "ON"}. |