OH2 iOS Client button behavior w/ MQTT


I’ve recently setup OepHAB2 on a Pi3. I also installed Mosquitto. The 2 are playing nicely together. On the other end, I have a Particle Photon connected to a 2-channel relay.

I have 2 buttons set-up to mimic the wall switch that controls a garage door opener. They’re set-up to publish a command to mqtt for any switch command. The Photon is subbed to the same topic and is able to receive and process these commands.

Overall, everything is working a treat. Especially from a web browser. I click on a garage door button, the corresponding channel on the relay toggles.

The only fly in the ointment comes from the iOS client. The same buttons behave slightly different from the web page equivalents. When the app is first launch and I navigate to the garage page, the buttons are “active” (pretty blue color). When I touch one, it’s state changes (it becomes white with a thin blue border), but nothing is published to mqtt, and thus the relay is not triggered. If I touch the button again, everything works perfectly. The command is published, the Photon receives it, and the relay is triggered. All subsequent button presses work perfectly.

So it’s a small annoyance, but I’d still like to sort it out. Relevant snipets from items file and sitemap are below. I’ve tried adding autoupdate=“false”, but the button behavior remains the same.


/**** Garage Doors ***********************************************/
String ga_Pod_Bay_1_Status	"Door: [%s]"				<garagedoor-closed>	(gGarage)	{http="<[https://api.particle.io/v1/devices/220035001847353236343033/PodBay1-stat?access_token=c4e9498c202c0b5ac98b93d05c3d32c4ca62d58a:60000:JSONPATH($.result)]"}
Switch ga_Pod_Bay_1_switch	"Toggle"							(gGarage)	{mqtt=">[BloodSucker:TogglePodBay:command:*:1]"}
String ga_Pod_Bay_2_Status	"Door: [%s]"				<garagedoor-open>	(gGarage)	{http="<[https://api.particle.io/v1/devices/220035001847353236343033/PodBay2-stat?access_token=c4e9498c202c0b5ac98b93d05c3d32c4ca62d58a:60000:JSONPATH($.result)]"}
Switch ga_Pod_Bay_2_switch	"Toggle"							(gGarage)	{mqtt=">[BloodSucker:TogglePodBay:command:*:2]"}


	Group item=gGarage
		Frame label="Pod Bay 1"
			Text item=ga_Pod_Bay_1_Status
			Switch item=ga_Pod_Bay_1_switch	label="" mappings=[ON="Open/Close"]
		Frame label="Pod Bay 2"
			Text item=ga_Pod_Bay_2_Status
			Switch item=ga_Pod_Bay_2_switch	label="" mappings=[ON="Open/Close"]

Screenshot from iOS app is attached. This shows the garage page. I’ve touched the door 1 button once. Nothing was published to mqtt, but the button changed state: