Homebridge Plug-in

@walksonair What is it that you're trying to accomplish by removing the capabilities? Maybe someone here could offer a suggestion for a better way that wouldn't require removing any capabilities.

Lol, yeah 1-1=0 definitely, @csteele! :slight_smile: The code shows there are three capabilities though and I was aiming to remove the two sensors since I don't need that at this time in Homekit. Here is ss of the code:

So my main goal here is simply to use HomeKit to turn on and off the virtual presence sensor. It would be nice just to have the switch capability without seeing anything else. I know there may be other ways such as RM and other intermediate switches - was hoping for a clean solution w/o anymore overhead.

Yea, you're trying to do the same thing that driver (and mine) are trying to do. Have independent apps detect the same event, independent of capability.

My suggestion, use it as is.. works fine as is.

[Edit] Sorry missed your explanation below the image. Read again.

So you could just create a rule to use a virtual switch to control the state of the virtual presence sensor and then expose the virtual switch to Homebridge, not the virtual presence sensor couldn't you? Am I missing something that would not allow that to work?

Thanks @csteele.
I’ve update the config file with the new lines, followed the instructions to get this all running but when I click the SmartApp link to get api line etc I get the following error message:

{"message": "Internal server error"}

Any suggestions? My home bridge installs are the latest versions

Do you see "Listening on port 8005" in your terminal?

@SmartHomePrimer It's convoluted, of course.

I found the needed to create the exact same hybrid driver @ogiewon did. He did his better/cleaner, but mine works too. The need is there because the Automations in Home iOS App, won't flip a Presence Sensor. To Apple, they are read only. It will flip a switch.

On the Hubitat side, I want the Dashboard to show a present/away when Homekit sets on/off.

OK. Thanks for explaining. I'm a little slow sometimes.

So this works and you can then just expose the switch to HomeKit and the location automation will show presence in the Dashboard.

I know what you mean by those undesirable capabilities, I just create a room in HomeKit called Hubitat and file them away there so they're not hanging out in the Default Room and I definitely turn off the "Show in favorites" option for those.

@SmartHomePrimer, sorry, was that port question to me?

Oops, sorry. Yes, meant to reply to you directly. Just wondering if you have listening on Port 8000 (for ST) and listening on port 8005 (for HE) showing in your terminal?

Hehe no worries @SmartHomePrimer. Yes, ST is 8000. However I can’t pull the token or api code from the home bridge app in HE to complete the config file to get home bridge running again. I haven’t specified a port for HE so it should go to 8005

EDIt. Just rebooted Hubitat box and the codes now show from the app. I should be able to complete this. Thanks for your help

I believe it should print both. Do you startup via init.d or do you startulp manually by typing Homebridge in a terminal?

:grimacing: I’m in windows for homebridge

Unfamiliar with that. I run mine in a Mac and I have run it on a RPi before. Do you get an output when you startup with the devices that are publishing and the QR code?

I have used tail -f /var/log/homebridge.log on the RPi before to see what was going on when I started via init.d - I don't much care for the auto-startup. Prefer to see the output in the terminal.

You should also be able to use tail -f /var/log/homebridge.err for error logs.

Success! Now to try doing the virtual Presence that @csteele was just talking about

1 Like

Not hard at all. So if you don't want the Presence and Sensor capabilities to show up in Homebridge, just do it this way instead. Expose the Virtual Switch to Homebridge, not the Virtual Sensor as Switch.

I tried it and it works. I like to eat the dog food I'm dishing out. :wink:
I used @ogiewon 's driver, but I'm sure @csteele 's will work equally well.

https://raw.githubusercontent.com/ogiewon/Hubitat/master/Drivers/virtual-presence-switch.src/virtual-presence-switch.groovy

2 Likes

I haven't published mine.. because @ogiewon is better and we don't need two. :slight_smile:

3 Likes

@SmartHomePrimer and @csteele Would the sensor code from ST not be usable? In ST I’m using a Presence sensor that has switch capability to it too:

That way I just use Apple Home and automations to flip the switch when people arrive home

@SmartHomePrimer and @csteele I’ve just pasted the code above into a new driver in Hubitat, update HomeBridge with the new sensor and tied my Apple Home automation of going away from home and coming back and tested the automation - it worked! Status in Hubitat changed correctly each time (and in ST)

I noticed the same last on wednesday with the latest iOS 12.1.2

I fixed it in my new v2.0 plugin. I will merge it into the latest v1.5.x and push it up in the next hour

3 Likes