Platform information:
- Hardware: Resp pi 4
- OS: openhabian 2.5.1
Hi All
I’m trying to bind a sonoff device to openhab with mqtt.
There are lots of posts on the net and I am kind of lost in the forest of the information…
I would be more than appreciate if someone can light my way…
My current state:
I flashed Tasmota on sonoff basic module.
The module is up and running and I can access it by the IP address.
Via paper UI I installed
- MQTT Broker Moquette
- MQTT Binding
I can see in “Things” the MQTT Broker online.
I also can see the broker via MQTT.fx software.
I can send commands ON and OFF to the sonoff via MQTT.fx.
I configured the mqtt configuration as follow:
I put at the host IP the IP of the Resp Pi - is that correct?
I put at the client “openhab2” - is that correct?
What should I put at the rest of the fields?
In the item.things I created a bridge:
Bridge mqtt:systemBroker:embedded-mqtt-broker "MqttBroker" [ host="localhost", port=1883, secure=false , clientID="openhab2"/* username="", password="", clientID="openHAB2"/*/ ]
{
Thing mqtt:topic:sonoffbridg {
Channels:
Type switch : PowerSwitch [ stateTopic="stat/sonoff1/POWER" , transformationPattern="JSONPATH:$.POWER" , commandTopic="cmnd/sonoff1/POWER", on="ON", off="OFF" ]
}
}
I added an item:
Switch Sonoff1 "Sonoff1" { channel="mqtt:topic:sonoffbridg:PowerSwitch" }
I am sure that I am doing something wrong as the switch is not changing the module state.
Can anyone share with his knowledge?
Thanks a lot,
Inmar