Homebridge Plug-in

Interesting. How do you find out what that known capabilities of a device are so you're certain you have the correct syntax in the config.json file? For example, my terminal only shows me unknown capabilities when I start Homebridge. It doesn't show me the known capabilities.

[11/7/2018, 9:06:59 PM] [Hubitat] Unknown Capabilities: ["SmokeDetector","PowerSource","ChangeLevel"]

You look to be using a text id not the device id (a number).

in logs, for example, there's the dev:# -- it's that #

dev:8 2018-11-17 11:10:51.664 am info MultiSensor6C (office) is active

8 in my example.

I would think both would be viable. I'm just not sure about the capabilities @walksonair has listed in the config.json file. I see Presence Sensor, but two word capabilities never have a space as per my example of the Unknown Capabilities in my installation.

https://docs.smartthings.com/en/latest/capabilities-reference.html#presence-sensor

metadata {
	definition (name: "Virtual Presence Sensor", namespace: "csteele", author: "C Steele") {
		capability "Presence Sensor"
		capability "Sensor"
		capability "Switch"
 
 		command    "arrived"
 		command    "departed"
       
	}

From Hubtiat's github example driver:

metadata {
    definition (name: "Generic Z-Wave CentralScene Dimmer",namespace: "hubitat", author: "Mike Maxwell") {
        capability "Actuator"
        capability "Switch"
        capability "Switch Level"
        capability "ChangeLevel"
        capability "Configuration"
        capability "PushableButton"

So you may or may not know I'm not a developer, so forgive my ignorance. Isn't this a difference between groovy and the javascript runtime in Node.js ?

this.knownCapabilities = [
    'Switch',
    'Light',
    'LightBulb',
    'Bulb',
    'Color Control',
    'Door',
    'Window',
    'Battery',
    'Polling',
    'Lock',
    'Refresh',
    'Lock Codes',
    'Sensor',
    'Actuator',
    'Configuration',
    'Switch Level',
    'Temperature Measurement',
    'Motion Sensor',
    'Color Temperature',
    'Illuminance Measurement',
    'Contact Sensor',
    'Acceleration Sensor',
    'Door Control',
    'Garage Door Control',
    'Relative Humidity Measurement',
    'Presence Sensor',
    'Carbon Dioxide Measurement',
    'Carbon Monoxide Detector',
    'Water Sensor',
    'Window Shade',
    'Valve',
    'Energy Meter',
    'Power Meter',
    'Thermostat',
    'Thermostat Cooling Setpoint',
    'Thermostat Mode',
    'Thermostat Fan Mode',
    'Thermostat Operating State',
    'Thermostat Heating Setpoint',
    'Thermostat Operating State',
    'Thermostat Heating Setpoint',
    'Thermostat Setpoint',
    'Fan Speed',
    'Fan Control',
    'Fan Light',
    'Fan',
    'Speaker',
    'Tamper Alert',
    'Alarm',
    'Alarm System Status',
    'AlarmSystemStatus',
    'Mode',
    'Routine',
    'Button'
];

That's what Homebridge knows about.

It's going to receive the values from the Homebridge app, which can only be values from Groovy code.

Thanks very much for the response thus far! I changed the ID to what @csteele mentioned. One issue was that I didnt know how to find this out other than looking in logs and there was nothing there. I added some trace lines and got a number ID. Thanks!

So it looks like the plugin is able to remove one of the two capabilities I want removed (see SS below). Any idea how to trouble shoot the inability to remove the second capability?

Oh and I should also add that the "Presence Sensor" capability thats being difficult to remove isnt really doing anything when I change the state of the virtual device (meaning, it wont show as present when I switch it to that).

My own Virtual Presence Sensor driver is a "Hybrid" driver attempting to allow it to be seen as EITHER a switch or a sensor, depending on the app's selection criteria. None of us have access to Hubitat's source for that driver, but I thought that the ordinary Virtual Presence driver was only a presence sensor. It would therefore have two capabilities: "Presence Sensor" and "Sensor".

Yet you're trying to exclude both...

Don't you end up with a zero, a nothing, and therefore the best way to exclude it is to not add it to Homebridge ? :slight_smile:

@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?