Hi,
I have flashed my sonoff 4ch pro with tasmota firmware and using mqtt.fx i can flawlessly control my sonoff switches but i am having trouble with configuring in openhab2 items and sitemaps as the switches wont work though they are displaying in the sitemap. Any help is appreciated
What mqtt binding are you using, 1.x or 2.x? If using 2.x are you trying to configure the Things, Items via files or PaperUI?
I am using mqtt 2.4 binding and i am using the files to configure not the paper UI
We got the same issue like thats although we already install 1.x and 2.x, hope any helpđ
@Karunya_Atluri
Please show the related contents of your files (.things, .items and .sitemap)
Did you read This?
My items file :
//My Switch
Switch Pwr_B_1 âMaster Bedroom Lightâ (LR,gLight) { mqtt=">[mqtth2:cmnd/msterbd/POWER1:command:*:default],<[mqtth2:stat/masterbd/POWER1:state:default]" }
Switch Pwr_B_2 âMaster Bedroom Fanâ (LR,gLight) { mqtt=">[mqtth2:cmnd/masterbd/POWER2:command:*:default],<[mqtth2:stat/masterbd/POWER2:state:default]" }
Switch Pwr_B_3 âMaster Bedroom CFL Lightâ (LR,gLight) { mqtt=">[mqtth2:cmnd/masterbd/POWER3:command:*:default],<[mqtth2:stat/masterbd/POWER3:state:default]" }
Switch Pwr_B_4 âMaster Bedroom Ceiling Lightâ (LR,gLight) { mqtt=">[mqtth2:cmnd/masterbd/POWER4:command:*:default],<[mqtth2:stat/masterbd/POWER4:state:default]" }
My sitemap:
sitemap home label=âAtluri SmartHouseâ
{
Frame
{
Group item=gFF label=âMaster Bedroomâ
{
Switch item=Pwr_B_1 icon=âlightâ
Switch item=Pwr_B_2 icon=âFanâ
Switch item=Pwr_B_3 icon=âlightâ
Switch item=Pwr_B_4 icon=âlightâ
}
}
}
My things file:
Bridge mqtt:broker:myUnsecureBroker [ host=â192.168.1.81â, secure=false ]
{
Thing topic mything {
Channels:
Type switch : Light âMaster Bedroom Lightâ [ stateTopic=âsonoff/masterbd/state/POWER1â, commandTopic=âsonoff/masterbd/command/POWER1â, on=âi-am-onâ, off=âi-am-offâ ]
Type switch : Fan âMaster Bedroom Fanâ [ stateTopic=âsonoff/masterbd/state/POWER2â, commandTopic=âsonoff/masterbd/command/POWER2â, on=âi-am-onâ, off=âi-am-offâ ]
}
}
The items file is using the MQTT1 syntax! Look into the documentation linked above!
On your thing setup, the use of the custom on and off strings looks suspicious.
@opus I am new to this and started learning it if you can guide me that would be very helpful. I will look into the documentation and please tell me what do i need to change for the things file. I hope you do the needful
after looking at the documentation which you have provided there are 2 demo.things files I am confused which format to use can you tell me which is comfortable. I guess the one which i posted previously was similar to the demo1.things format in the documentation
In your things file I would ddelete only this : " on=âi-am-onâ, off=âi-am-offâ" part.
Have you changed the items file?
Working with the documentation