Switch light_scene1 "all on" ["Lighting"] {autoupdate="false"}
with a corresponding rule.
rule "All on"
when
Item Milight_scene1 received command
then
logInfo("Log info", "all on")
light_Kitch_color_sink.sendCommand("36,32,50")
light_Kitch_color.sendCommand("36,32,100")
light_Kitch_color_live.sendCommand("36,32,50")
end
It works swimmingly. I specifically set the autoupdate=false because I don’t want this to be an on/off. just a simple button that when clicked triggers a scene.
this works great on a sitemap or habpanel. but i notice the status of the button on the iphone does not know how to deal with a “autoupdate=false” setting, and shows on/off status when pressed. I really have no desire to display any sort of on off status in either habpanel or the iphone.
Regular on/off buttons sync nicely and status of button is reported across devices.
I’m open to creative suggestions or solutions of course. I’m basically just looking for a way to have a simple button for a homekit item, not an on/off.
I tried another approach instead of using autoupdate = false, and created a rule instead to postUpdate(OFF) to the button after it got pressed, thinking that this might solve the issue, and whilst it works for habpanel, I still don’t get that status pushed to the iphone.
Yup, I had already got that, that was the easy part My question, though, is that when the button is synced to Homekit, the homekit button on the iphone is still an “ON/OFF” type switch, and it still shows on/off status as a switch, as does not behave like a momentary button like in openhab. So,as an example. If I click the button on openhab ui, it behaves as a momentary button, but this causes the iphone button to flip between on and off. pressing the button on the iphone flips from on/off. I’m hoping there is a way to make the iphone switch behave like a momentary button.
The OpenHAB button operates as expected, it is a stateless momentary button in the UI.
But the iphone Homekit button does not correspond, when I press the momentary button in the UI, the button on the iphone goes to ether ON or OFF depending on it’s current state.
This was just a test to create a button in the UI that was just a simple button not on/off. which worked, but homekit did not see it as a stateless button
If I was to click the button and I used sendcommand in a rule to set the Button to off, this would just turn the button back off, status and state. I used postUpdate, as I only wanted to change the status of the button, not the state. I thought perhaps changing the status of the button, would also change the status of the button on the phone, but it does not, this makes sense as the Homekit app is probably just looking at states, not status. anyhoo, i’m not using the rule method anymore…
This is a preferred way to display a stateless button in Openhab.
Switch item=light_scene1 mappings=[ON="ON"]
but of course the above method, Homekit still sees it as a ON/OFF
always an option. but for other reasons the homekit is handy.
for sure. this i’m aware of. but I know that the Homekit app supports stateless buttons, I was just wondering if there was a way to configure a switch item in Openhab so that the Homekit app sees it as a stateless button.