Homekit & Openhab Button status on Iphone

I’m wondering…

I have an item:

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.

thanks much C

For the sitemap that’s easy:

Switch item=light_scene1 [mappings=[ON="ON"]

In HABpanel:
Use a button widget:
image

I have the same issue with the Iphone app as commented here:

no solution yet

Yup, I had already got that, that was the easy part :slight_smile: 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. :slight_smile: 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.

BAsically, wondering if there is a way to make the homekit button stateless.

Is that in the homekit app or the openHAB app?

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.

Again, in the homlekit app or the openHAB app?

I thought I was clear there, but perhaps not. :slight_smile:

Meaning that the button in the Homekit app on the iphone does not correspond, i’m not using the openhab app.

No, because you used postUpdate. Using sendCommand will push the state out to the binding.

You have no control over what the homekit app displays because it’s 3rd party.

You have 3 choices here.

  • Try the sendCommand instead of the postUpdate as mentioned above
  • Use the openHAB app not the homekit app
  • Get a better phone

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.