HI,
actually I have a openhab running, combined with rules running on HABApp/Python, and everything is fine.
Now I have my first Devices that needs a MQTT.
So I installed zigbee2mqtt and it is running on openhab side
Now I want to use the mqtt things/items in HabApp/Rules.
Connection from HabAtt to mqtt works fine.
Then I tried to switch a SmartPlug On/Off from a rule an my confusion begins:
Doing this from a mqtt client i did:
mosquitto_pub -h X.X.X.X -u user -P 'pw' -t zigbee2mqtt/SPOS_1/set -m "OFF"
or
mosquitto_pub -h X.X.X.X -u user -P 'pw!' -t zigbee2mqtt/SPOS_1/set -m "{\"state\": \"ON\"}"
The same i tried from the rule:
self.my_mqtt_item = MqttItem.get_create_item("zigbee2mqtt/SPOS_1")
self.my_mqtt_item.publish("{\"STATE\": \"OFF\"}")
self.my_mqtt_item.publish("ON")
Both commands were not working → No error, but no result on the smartplug
The only thing that works
self.mqtt.publish("zigbee2mqtt/SPOS_1/set", "OFF")
So even after reading the docs I’m not clear where the problem is.
I thought the behaviour is the the same as with openhab items:
self.Presence = SwitchItem.get_item(PRESENCE_ITEM)
After that i can send commands or post updates to the openhab item
So what did I wrong?