Code Monkey home page Code Monkey logo

homebridge-hubitat-tonesto7's Introduction

homebridge-hubitat-tonesto7

verified-by-homebridge npm npm npm GitHub repo size

GitHub issues GitHub pull requests

CodeFactor Grade Known Vulnerabilities

GitHub Workflow Status (branch)

Donate

About

V2 of this plugin is a complete rewrite of the homebridge-hubitat-tonesto7 plugin using modern Javascript structure with classes, promises, and arrow functions.

GitHub tag (latest SemVer)

Credits

Big thanks for @Areson for his help/motivation in rewriting this. Another shout out to @nh.schotfam for your help on the optimizations for hubitat.

I also wanted to mention the following projects I referenced for inspiration for a few minor items and fixes:

Change Log:

Hubitat App:

Homebridge Plugin:

Direct Updates from Hubitat

  • Device/location events are almost real-time.
  • This option allows the hub to send updates directly to your homebridge-hubitat-tonesto7 installation.
  • The hub must be able to send an http packet to your device so make sure to allow incoming traffic on the applicable port.
  • The port used for this can be configured by the direct_port setting and defaults to 8000.
  • The program will attempt to determine your IP address automatically, but that can be overridden by direct_ip which is useful if you have multiple addresses.
  • The plugin and hubitat will continue to function when you lose internet (with the exception of controlling any cloud based devices).

When properly setup, you should see something like this in your Homebridge startup immediately after the PIN:

[11/25/2019, 4:44:46 PM] [Hubitat-v2] Devices to Remove: (0) []
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Devices to Update: (40)
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Devices to Create: (0) []
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Total Initialization Time: (2 seconds)
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Unknown Capabilities: ["Power Source"]
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Hubitat DeviceCache Size: (40)
[11/25/2019, 4:44:46 PM] [Hubitat-v2] WebServer Initiated...
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Sending StartDirect Request to Hubitat | SendToLocalHub: (false)
[11/25/2019, 4:44:46 PM] [Hubitat-v2] Direct Connect Enabled and Listening on 10.0.0.163:8000

Installation

Installation comes in two parts:

1. Hubitat App Installation

Option 1: Automated Install

Option 2: Import from GitHub URL

  • Open the Hubitat UI in your web browser
  • Click on Apps Code in left navigation panel
  • Click New App on the top right of page
  • Click the Import button:
    • Paste in this URL: https://raw.githubusercontent.com/tonesto7/homebridge-hubitat-tonesto7/master/apps/homebridge-v2.groovy
  • Click the Import button
    • Click OK on the confirmation prompt
  • Click Save and wait for the spining wheel to disappear and the page refreshes
  • Click on the OAUTH button:
    • Click Enable OAuth in App
    • Click Update at the bottom.
    • (If you are upgrading from a previous version of this project, OAuth will likely already be enabled and you can safely disregard this step)

2. Hubitat App Configuration

  • In the Hubitat UI, click on Apps in the left navigation panel and click Add User App.

  • Select Homebridge v2 from the choices on the list.

  • Configuring the App:

    In Define Device Types there are 8 inputs that can be used to force a device to be discovered as a specific type in HomeKit. NOTE: Do not select the same device in more that one input. If you select a device here, do not select that same device in the other device inputs on the previous page.

    For any other devices you would like to add that weren't added in the previous step, just tap on the input next to an appropriate device group and then select each device you would like to use. (The same devices can be selected in any of the Sensor, Switch, Other inputs)

    • There are several categories here because of the way Hubitat assigns capabilities. You might not see your device in one, but might in another.
    • Almost all devices contain the Refresh capability and are under the "Other Devices" group.
    • Some sensors don't have a refresh and are under the "Sensor Devices" group.
    • Some devices, mainly Virtual Switches, only have the Switch Capability and are in the "Switch Devices" group.

    If you select the same device in multiple categories, it will only be shown once in HomeKit. You can safely check them all in all groups, aside from the NOTICE above.

  • Tap Done

  • Tap Done You are finished with the App configuration!


3. Homebridge Plugin Installation:

NOTICE: I highly recommend using homebridge-config-ui-x to manage your homebridge instance, plugin and configs. This will allow you to use the web based form to configure this plugin.

  1. Install homebridge using: npm i -g homebridge (For Homebridge Install: Homebridge Instructions)
  2. Install Hubitat plugin using: npm i -g homebridge-hubitat-tonesto7
  3. Update your configuration file using the config generator inside the Hubitat App as the template to copy/paste into platform section of the Homebridge config.json.

Config.json Settings Example

Example of all settings. Not all settings are required. Read the breakdown below.

   {
      "platform": "Hubitat-v2",
      "name": "Hubitat-v2",
      "app_url_local": "http://10.0.0.40/apps/api/",
      "app_url_cloud": "https://cloud.hubitat.com/api/561d981e-f986-4f7f-941d-5d43d1d0e0e1/apps/",
      "app_id": 436,
      "app_platform": "Hubitat",
      "use_cloud": true,
      "access_token": "1888d2bc-7792-1114-9f32-e4724e388a26",
      "communityUserName": "tonesto7",
      "direct_ip": "10.0.0.15",
      "direct_port": 8000,
      "temperature_unit": "F",
      "validateTokenId": false,
      "adaptive_lighting": true,
      "adaptive_lighting_offset": 0,
      "excluded_capabilities": {
         "HUBITAT-DEVICE-ID-1": [
            "Switch",
            "Temperature Measurement"
         ]
      },
      "logConfig": {
         "debug": false,
         "showChanges": true
      }
   }
  • platform & name Required

    This information is used by homebridge to identify the plugin and should be the settings above.

  • app_url_local & app_url_cloud & app_id & access_token Required

    NOTICE: The app_url's in the example will be different for you.

    To get this information, open the installed Hubitat Homebridge V2 App the Hubitat Web UI, and tap on View Configuration Data for Homebridge

  • use_cloud Required | Default: false

    This will enable the plugin to communicate with the hubitat app via the cloud url. (Mostly useful for troubleshooting local communication issues via ports)

  • communityUserName Optional | Default: ''

    Only needed when you are having issues with the plugin and you want me to be able to identify your reported exception errors.

  • direct_ip Optional | Default: 'First available IP on your computer'

    Most installations won't need this, but if for any reason it can't identify your ip address correctly, use this setting to force the IP presented to Hubitat for the hub to send to.

  • direct_port Optional | Default: 8000

    This is the port that the homebridge-hubitat-tonesto7 plugin will listen on for traffic from your hub. Make sure your firewall allows incoming traffic on this port from your Hubitat hub IP address to your HomeBridge instance.

  • temperature_unit Optional | Default: F

    This will allow you to define the temp unit to use. This can also be set in the HUbitat App

  • validateTokenId Optional | Default: false

    This forces the plugin to validate the Hubitat app token and location with that defined in the plugin configuration

  • adaptive_lighting Optional | Default: true

    This enables support for bulbs with Color Temp and Brightness to use HomeKit's new Adaptive Lighting features.

  • adaptive_lighting_offset Optional | Default: 0

    Defines a custom temperature adjustment factor. This can be used to define a linear deviation from the HomeKit Controller defined ColorTemperature schedule. For example supplying a value of -10 will reduce the ColorTemperature, which is calculated from the transition schedule, by 10 mired for every change.

  • consider_fan_by_name Optional | Default: true

    By default the plugin will identify a fan device by using a devices label, and whether it has Fan in the label.

  • consider_light_by_name Optional | Default: false

    By default the plugin will identify a light device by using a devices label, and whether it has Light in the label.

  • excluded_capabilities Optional | Default: '{}' (None)

    NOTICE: The Hubitat app offers many inputs to help filter out device capabilities. Only use this if the available inputs don't meet your needs. Specify the Hubitat device by ID and the associated capabilities you want the plugin to ignore. This prevents a Hubitat device creating unwanted or redundant HomeKit accessories.

  • logConfig Optional

    Define log output format options as well as enable the log file output.

    • debug Optional | Default: false

      Enables Debug log output.

    • showChanges Optional | Default: true

    Logs device event changes received from Hubitat.

Frequently Asked Question:

Q: Can this support Axis Blinds? A: Maybe, it can support any device that has the windowShade capability and/or level attributes.

Known Issues:

  • None reported yet...

DONATIONS:

PayPal Donations

homebridge-hubitat-tonesto7's People

Contributors

beeeswax avatar dantapps avatar dependabot[bot] avatar devenbj avatar imnotbob avatar jorhett avatar snyk-bot avatar spectre3ooo avatar tonesto7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homebridge-hubitat-tonesto7's Issues

500 Error when turning lights on/off using Cloud API

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • That OAuth is Enabled for the SmartApp under the IDE.
  • The SmartApp and Device Handler are using the latest code available.
  • That Both the SmartApps and Device Handlers have been Published for You in the IDE.

About Your Setup

  • How many devices are detected?: 12
  • Mobile App Version(Not required):
  • Hubitat App Version: 2.0.8
  • Homebridge Version: v1.1.6
  • NodeJS Version: v12.18.4
    --

Expected Behavior

Tell us what you think should be happening

When I turn off a light, it should turn off IRL
When I turn on a light, it should turn on IRL

Current Behavior

What happens instead of the expected behavior?

The change shows up in Apple Home app, the change is logged on Hubitat... but it doesn't actually happen.

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. Tap light switch to turn on or off does not work
  2. Set level does work

Please include a copy of any relevant log output to assist in tracking down the bug

Logs on Homebridge show a 500 error for on/off operations but not for setlevel

11/7/2020, 5:06:44 am] [Hubitat-v2] NOTICE: Sending Device Command: on | Name: (Living Room Backlights) | DeviceID: (42) | LocalCommand: (false)
[11/7/2020, 5:06:45 am] [Hubitat-v2] ERROR: sendDeviceCommand Error: [object Object] | Message: Request failed with status code 500
[11/7/2020, 5:06:45 am] [Hubitat-v2] NOTICE: Sending Device Command: setLevel | Value: {"value1":92} | Name: (Living Room Backlights) | DeviceID: (42) | LocalCommand: (false)
[11/7/2020, 5:06:47 am] [Hubitat-v2] INFO: [Device Event]: (Living Room Backlights) [LEVEL] is 92

Logs on Hubitat show only the setLevel event:

app:712 2020-11-07 05:07:46.063 am debugHomebridge (v2.0.8) | Code versions: [plugin:2.0.8, mainApp:2.0.8]
app:712 2020-11-07 05:06:47.835 am debugHomebridge (v2.0.8) | Sending DEVICE Event (Living Room Backlights | LEVEL: 92%)  to Homebridge at (172.31.2.128:8000)
app:712 2020-11-07 05:06:47.745 am info Homebridge (v2.0.8) | Command Successful for Device Living Room Backlights | Command [setLevel(92)]
dev:42 2020-11-07 05:06:47.736 am infoLiving Room Backlights level was set to 92%
app:712 2020-11-07 05:06:47.681 am info Homebridge (v2.0.8) | Process Command | DeviceId: 42 | Command: (setLevel) | Param1: (92)

(BUG) Single selected Thermostat name and checkbox not showing in Device Selection

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • [x ] That OAuth is Enabled for the SmartApp under the IDE.
  • [x ] The SmartApp and Device Handler are using the latest code available.
  • [x ] That Both the SmartApps and Device Handlers have been Published for You in the IDE.

About Your Setup

  • How many devices are detected?:32
  • Mobile App Version(Not required):
  • SmartApp Version:2.1.6
  • Device Handler Version:
  • Homebridge Version:
  • NodeJS Version:

Expected Behavior

Tell us what you think should be happening
I selected a Thermostat device in the modal drop down and saved all the way through and the thermostat shows in the Home app. I now want to unselect that thermostat in Device Selection and the modal drop down should show the single Thermostat with the check box checked.

Current Behavior

What happens instead of the expected behavior?
The modal drop down appears but is not very tall and there is no device or check box.

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

Context

**How has this issue affected you? What are you trying to accomplish?
Providing context helps us come up with a solution that is most useful in the real world
I inspected the element in order to mess with the CSS to try to get the check box to show. To get the thermostat out of the selected devices, I removed 'type="hidden"' from the line immediately above the HTML for the modal drop down. This showed a numerical input field which allowed me to delete the value and save, thus removing the device.


Please include a copy of any relevant log output to assist in tracking down the bug

Update 1.5.4 causes Homebridge to quit

Just updated Hubitat plugin to 1.5.4 and tried unlocking...HomeKit started saying the lock was not responding. Then, as I was checking my terminal, homebridge looked like it quit. here is the output:

/usr/local/lib/node_modules/homebridge-hubitat-tonesto7/accessories/he_st_accessories.js:261
                        platform.clientApi.runCommand(callback, device.deviceid, 'unlock');
                                           ^

TypeError: Cannot read property 'runCommand' of undefined
    at Characteristic.LockTargetState.<anonymous> (/usr/local/lib/node_modules/homebridge-hubitat-tonesto7/accessories/he_st_accessories.js:261:44)
    at Characteristic.LockTargetState.emit (events.js:182:13)
    at Characteristic.LockTargetState.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:320:10)
    at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:871:22)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:811:8)
    at HAPServer.emit (events.js:182:13)
    at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:972:10)
    at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
    at IncomingMessage.emit (events.js:182:13)
    at endReadableNT (_stream_readable.js:1098:12)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)

Reran w/ DEBUG=* homebridge -D and the following preceded the same error as above:

Accessory [Homebridge] Getting value for Characteristic "Lock Target State" +1ms
  Accessory [Homebridge] Got Characteristic "Lock Target State" value: 1 +0ms
  Accessory [Homebridge] Getting value for Characteristic "Lock Current State" +0ms
  Accessory [Homebridge] Got Characteristic "Lock Current State" value: 1 +0ms
  EventedHTTPServer [::ffff:10.0.0.4] HTTP Response is finished +1ms
  EventedHTTPServer [::ffff:10.0.0.4] HTTP request: /characteristics +40s
  HAPServer [34:12:6D:13:BE:29] HAP Request: PUT /characteristics +1ms
  Accessory [Homebridge] Processing characteristic set: [{"aid":4,"iid":10,"value":0}] +1ms
  Accessory [Homebridge] Setting Characteristic "Lock Target State" to value 0 +0ms
/usr/local/lib/node_modules/homebridge-hubitat-tonesto7/accessories/he_st_accessories.js:261
                        platform.clientApi.runCommand(callback, device.deviceid, 'unlock');
                                           ^

TypeError: Cannot read property 'runCommand' of undefined
    at Characteristic.LockTargetState.<anonymous> (/usr/local/lib/node_modules/homebridge-hubitat-tonesto7/accessories/he_st_accessories.js:261:44)
    at Characteristic.LockTargetState.emit (events.js:182:13)
    at Characteristic.LockTargetState.Characteristic.setValue (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Characteristic.js:320:10)
    at Bridge.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:871:22)
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._handleSetCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:811:8)
    at HAPServer.emit (events.js:182:13)
    at HAPServer._handleCharacteristics (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:972:10)
    at HAPServer.<anonymous> (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:209:39)
    at IncomingMessage.emit (events.js:182:13)
    at endReadableNT (_stream_readable.js:1098:12)
    at process.internalTickCallback (internal/process/next_tick.js:72:19)

(BUG) Smartthings button not showing up in list under "Buttons"

I have a Smartthings button with driver of Samsung Zigbee Button configured as a device in HE.
After I installed the Homebridge app and go to the Device Selection UI, I click on the Buttons section but there are no devices shown under that list.

Are buttons supported?


About Your Setup

  • How many devices are detected?: I am not sure what this means?
  • SmartApp Version: plugin=2.1.3, mainApp=2.1.6}
  • Device Handler Version: I don't know how to find the version of the Samsung Zigbee button driver version
  • Homebridge Version: v1.1.7
  • NodeJS Version: v15.2.1

Expected Behavior

I would have expected the Samsung smartthings button to show up under the buttons list.

Current Behavior

the list of buttons is empty

Steps to Reproduce (for bugs)

  1. have a zigbee button installed on HE and verify that it is recognized and that button presses register with HE
  2. install the homebridge app
  3. got to the configuration and select the buttons to select
    4.the list is empty

Context

**How has this issue affected you? What are you trying to accomplish?
I am trying to trigger my TV scene by pressing the samsung button.


Please include a copy of any relevant log output to assist in tracking down the bug

Light bulbs not registering under 5%

I recently installed this plug-in and have gotten everything working really well. It seems to be a great plug-in. The only thing I can't figure out is if I set my light bulbs to anything less than 5% it reads 0% in Homebridge but the switch status is still "On". The logs show the correct percentage being read but it just doesn't show up in Homebridge or in the Homekit app on my phone. If I try to set the bulbs to less than 5% using Homekit it won't do it or it will dim it down to 5% instead of the actual request. In the logs is shows a value of zero. I am on Hubitat version 2.2.6.130 so maybe that has something to do with it? They are all Sengled light bulbs. I attached a screenshot of the log file when I give the command to dim through Hubitat (Log1) and a screenshot of how the bulb looks on the accessories page. I dimmed the basement light to 2% and that just shows "On" I also attached a screenshot of the log file when I try to dim the light using homebridge (log2). Sorry if I am missing something obvious but nothing is popping out at me as to what might be the issue. Thank you for all your hard work on this!

Log1
Accessories page
Log2

(BUG) - Homebridge log shows plugin update available but latest version is installed

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • That OAuth is Enabled for the SmartApp under the IDE.
  • The SmartApp and Device Handler are using the latest code available.
  • That Both the SmartApps and Device Handlers have been Published for You in the IDE.

About Your Setup

  • How many devices are detected?: 2
  • Mobile App Version(Not required):
  • SmartApp Version: v2.1.1
  • Device Handler Version:
  • Homebridge Version: 1.1.6 (MacOS - High Sierra)
  • NodeJS Version: 12.1.0

Expected Behavior

There should be no warning displayed if a newer version is not available

Current Behavior

Log displays a warning that a new version is available

Steps to Reproduce (for bugs)

Log entry (also see file attached(

[11/11/2020, 1:40:06 am] [WARN]: ---------------------------------------------------------------
[11/11/2020, 1:40:06 am] [WARN]: NOTICE: New version of homebridge-hubitat-tonesto7 available: 2.1.1
[11/11/2020, 1:40:06 am] [WARN]: ---------------------------------------------------------------
[11/11/2020, 1:40:06 am] [NOTICE]: Sending Plugin Status to Hubitat | UpdateAvailable: true | newVersion: 2.1.1
[11/11/2020, 2:40:04 am] [GOOD]: Refreshing All Device Data

  1. Log into Homebridge (Config-UI-X)
  2. Also review plug-in log file

Context

Does not seem to have any adverse impact, but should not happen
homebridge-hubitat-tonesto7-2020-11-11.log
Screen Shot 2020-11-11 at 10 31 40 AM


Please include a copy of any relevant log output to assist in tracking down the bug

(BUG) Null device cannot be removed.

Looks like I managed to delete a switch from my system without removing it from Homebridge v2 first, which has resulted in this:

image

Rebooting doesn't help, adding or removing other devices also no help. And, of course, there's no null device for me to go and tinker with.

It's largely a cosmetic issue as it's not affecting the operation of the app in any way that I can ascertain.

Switch status in Home App

Followed instructions as explained in the readme. All is working well and issuing commands from the Home.app in iphone ios 13 arrives to Hubitat and the switch acts, using Fibaro switches, however the status in Home App is not pervasive, as in, when switching to another app and returning to Home.app in the device shows the status of the switch as Off, regardless if the device is ON in hubitat.

CO Sensor issue from Hubitat to Hoobs

  • That OAuth is Enabled for the Hubitat App under the Homebridge v2 App under App Code.
  • The Hubitat App and Homebridge Plugin are updated to the latest code available.

About Your Setup

  • How many devices are detected?: 32
  • Hubitat App Version: 2.2.6.130
  • Homebridge Plugin Version: 2.5.0
  • Homebridge Version: Hoobs 3.3.5 (official Docker container)
  • NodeJS Version: N/A

Expected Behavior
CO Sensor in Hubitat seen as a single sensor is seen as a single sensor in Hoobs.

Current Behavior
Single CO Sensor in Hubitat seen as a single sensor is seen as two sensors in Hoobs.

Steps to Reproduce (for bugs)

  1. Install Konnected.io panel and connect CO sensor
  2. Install and config Konnected Pro App and Drivers in Hubitat
  3. Verify only one CO sensor is seen in Hubitat and the Konnected mobile app
  4. Configure homebridge-hubitat-tonesto7 to expose the CO sensor to Hoobs
  5. Restart the Hoobs service. Confim CO sensor is discovered as 2 sensors

Context
In HomeKit there are 2 CO sensors seen form Hoobs. One is a stand alone and shows no alter. The other is grouped with a smoke detector which shows no smoke present, but a CO alarm. Need to be able to arm the system and send alerts and to do so need to eliminate the ghost CO sensor with an alarm present.


Hoobs log where device discovery occurs
https://pastebin.com/Zad9Pawy

Virtual Contact Sensor Not showing in Home

With HE Platform 2.2.1.116, I wanted to make a Virtual switch I created not able to be "controlled" from homekit since that wouldn't serve any purpose. So i created a Virtual Contact Sensor but when i go to add the contact sensor into the Homebridge app it doesn't show. If i change it to a vCO sensor, i can add it to Homebridge. The Ring Virtual Contact sensors show up in HB, but not the baked in hubitat ones. Is there an issue with the Virtual Contact's? or is there something i should dig into to try and get them hooked in? I am fully open to me being dense ... lol

--Ryan

Issue with Yale Lock

I have a Yale Smartlock that is connected via Hubitat (version 2.2.4.156). The lock will lock and unlock properly using Hubitat and HomeKit and will update its status (locked vs. unlocked) but will not show any status other than unlocked in HomeKit. I can control the lock via HomeKit without issue, it is just the reporting.

update breaks homebridge-hubitat

The new 2.0 homebridge-hubitat-tonesto7 plugin appears to require information not available in hubitat configuration such as "App-ID":

App ID *
To get this information, open Homebridge (Hubitat) App, and tap on 'View Configuration Data for Homebridge'

This information is not available on hubitat.

on homebridge:
Homebridge (Hubitat)
Copyright© 2018 Anthony Santilli
Version: 1.5.2

Missing Groovy for V2

Option 2: Import from GitHub URL
Open the Hubitat UI in your web browser
Click on Apps Code in left navigation panel
Click New App on the top right of page
Click the Import button:
Paste in this URL: https://raw.githubusercontent.com/tonesto7/homebridge-hubitat-tonesto7/master/apps/homebridge-v2.groovy
Click the Import button
Click OK on the confirmation prompt
Click Save and wait for the spining wheel to disappear and the page refreshes
Click on the OAUTH button:
Click Enable OAuth in Smartapp
Click Update at the bottom.
(If you are upgrading from a previous version of this project, OAuth will likely already be enabled and you can safely disregard this step)

https://raw.githubusercontent.com/tonesto7/homebridge-hubitat-tonesto7/master/apps/homebridge-v2.groovy is a dead link.

[Feature Request] Outlet / Power Point support

Is your feature request related to a problem? Please describe.

Currently, Homebridge-Hubitat lacks support for outlets / power points and users must add these as switches.

On the surface, this appears to be the same functionality, but it's not quite the same. HomeKit responds to these differently. Under Home.app an outlet / power point may be displayed as:

  • Fan
  • Light
  • Power Point

While a Switch may be displayed as:

  • Fan
  • Light
  • Switch

This affects the following Home.app functionality:

  • Icons that can be used for the outlet / power point are incorrect (switch and power point icons differ)
  • Grouping of outlet / power point statuses in Home.app is now incorrect, any outlets / power points used via Homebridge-Hubitat are grouped as switches instead of outlets / power points. This is important if using Homebridge-Hubitat along with native HomeKit outlets / power points.

Describe the solution you'd like

Support for Outlets / Power Points so that the Home.app sees these devices correctly.

Describe alternatives you've considered

Currently just employing the workaround of adding outlets / power points as switches.

Additional context

Thanks for the work on these plugins, it's great to be able to add Hubitat devices to HomeKit 👍

Inovelli Fan Switches

Good morning,

After updating the app. My fan switches behavior changed. I used to have 3 tiles. One for fan light, one for fan speed and one that turned off both fan and light with one click. This is no longer the case. on the fan light tile i now see the fan speed as well but it doesnt do anything. Anyway to revert back?

Koogeek lightswitch doesn't show up

Hey,

I have a two gang smart light switch from koogeek (https://www.koogeek.com/p-kh02cn.html).

I have set up Homebridge and I am getting a successful connection message, but the light switch is not showing up. I can, however, control it fine, via my iPhone.

[4/16/2020, 10:49:06 AM] Homebridge is running on port 51220.
[4/16/2020, 10:49:06 AM] [Hubitat] Direct Connect Is Listening On 192.168.188.68:8005
[4/16/2020, 10:49:06 AM] [Hubitat] Hubitat Hub Communication Established

(BUG) Argument Type Mismatch on v2.2.0

Just updated Homebridge to latest version (no issues), and then Hubitat to the latest... After updating Hubitat, attempted to validate configuration when I received an error:
2020-12-28 11:49:06.520 pm errorjava.lang.IllegalArgumentException: argument type mismatch on line 340 (mainPage)
This occurred after clicking past the release notes. Did not have the ability to see the main app page... immediately displayed error.

Deleted my instance of Homebridge to recreate. Was able to get to the configuration page. After adding my lights and clicking Update, the same error occurred again.

Deleted my instance, and removed Homebdidge v2 Hubitat app (I use HPM to install). Installed it again, and went to create my instance again (same error).

Downgraded to 2.1.7 (manually from github - thought it was the previous version, fairly certain I grabbed Dec 7th code). Same error / different line number:
2020-12-29 12:15:46.208 am errorjava.lang.IllegalArgumentException: argument type mismatch on line 328 (deviceSelectPage)

Downgraded to 2.1.6 (manually from github). No errors. Homebridge is working as it did before (old Hubitat groovy app, new homebridge plugin, no issues).

Let me know if there is any additional troubleshooting I can do to assist... Thanks!

Unable to disable fan / cooling from thermostat

Please can I request the option to disable type ‘Fan’ in the filter menu?

background - One of the nest thermostats in my house supports fan function - but we don’t have a fan. All Nest thermostats in hubitat are currently exposed to homebridge as thermostats with fans.

thanks

Getting "{"error":"Permission denied"}" when trying to get Plug-In Configuration Data

Just updated to your latest release and how nothing is working and I'm getting this error when selecting the Plugin Config Button in the app in Hubitat.

{"error":"Permission denied"}

Also seeing this in the Homebridge logs:
"[10/8/2018, 2:51:01 PM] [Hubitat] Direct Connect Is Listening On 10.0.0.79:8000
error at req: write EPROTO 1995477520:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794:"

Request to filter out leak Sensor

Is your feature request related to a problem? Please describe.

I have an Aqara Motion Sensor that exposes as all sensors...I can filter out all capabilities except leak sensor and it exposes to homekit as both a motion and a leak sensor with a leak detected... I have 4 other sensors I want to add so this could be problematic...
Describe the solution you'd like
Can u add the ability to filter out the leak sensor or suggest a possible solution?

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context

image

(BUG) Shades behaving the opposite

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • [x ] That OAuth is Enabled for the SmartApp under the IDE.
  • [x ] The SmartApp and Device Handler are using the latest code available.
  • [x ] That Both the SmartApps and Device Handlers have been Published for You in the IDE.

About Your Setup

  • How many devices are detected?: 3
  • Mobile App Version(Not required):
  • SmartApp Version: Version: v2.2.2, Plugin: v2.2.2
  • Device Handler Version: homebridge-hubitat-tonesto7 v2.2.2
  • Homebridge Version: v1.2.5
  • NodeJS Version: v12.20.1

Expected Behavior

When I tell the shades to close, they should go to 100% and close. When opening, go to 0%. Also, anything in between.

Current Behavior

When I tell the shades to close, it opens. When I say 60% open, it's 60% closed.

Steps to Reproduce (for bugs)

  1. open HomeKit and try to open the shade
  2. that's it.

Context

I have Ikea Fyrtur shades and they work properly when I set the level in Hubitat device screen. When I try through home bridge or HomeKit, they behave the opposite: it shows like 10% open but it's in fact 10% closed. Also, it doesn't understand closed and open as a status (for 0 or 100%). It looks like the level could be sent as 100-level (I may try to change the code on my end to test, but not sure if I got everything right yet).


Please include a copy of any relevant log output to assist in tracking down the bug

"This plugin generated a warning from the characteristic 'Target Fan State': characteristic was expected valid number and received NaN.

Plugin Version: 2.4.1

[homebridge-hubitat-tonesto7] This plugin generated a warning from the characteristic 'Target Fan State': characteristic was expected valid number and received NaN. See https://git.io/JtMGR for more info.

Per the website suggestion, I'm reaching out:

"If you see this message in the log, the plugin threw an unhandled exception while processing the SET or GET request for the characteristic.

👤 If you're an end user, you should report this issue to the plugin developer.

Run Homebridge in debug mode (-D) to provide the developer with the full stack trace.

🧑‍💻 If you're the plugin developer:

Make sure you catch and handle any potential exception that may be thrown while processing your plugin's GET or SET handlers.
You can get a full stack trace to see where this exception was thrown by starting Homebridge in debug mode (-D)."

Unable to access lights after 2.3.3 update.

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • [ Yes] That OAuth is Enabled for the Hubitat App under the Homebridge v2 App under App Code.
  • [Yes ] The Hubitat App and Homebridge Plugin are updated to the latest code available.

About Your Setup

  • How many devices are detected?: 10
  • Hubitat App Version: 2.2.5.131
  • Homebridge Plugin Version: 2.3.3
  • Homebridge Version: 1.3.1
  • NodeJS Version: 14.16.0

Expected Behavior

Tell us what you think should be happening
Should be able to control all lights from HOME app. or Homebridge accessories.

Current Behavior

What happens instead of the expected behavior?

Unable to control any of my lights. I can see their status (EX> off or on) but unable to turn them off or on. I can control them from the hubitat app.

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. After rebooting both hubitat and homebridge, a question came up asking if I wanted to link the adaptive lights. I defaulted to no and now no lights work.

Context

**How has this issue affected you? What are you trying to accomplish?
Providing context helps us come up with a solution that is most useful in the real world

Need to be able to control the lights in the house.
homebridge.log (2).txt


Please include a copy of any relevant log output to assist in tracking down the bug

Hubitat-v2 Plugin is not Configured | Skipping...

I've configured it on both sides, loaded, reloaded, reconfigured, and repeated the process several times.

11/20/2020, 8:16:30 AM > [11/20/2020, 8:16:30 AM] [Hubitat-v2] Hubitat-v2 Plugin is not Configured | Skipping...
11/20/2020, 8:16:30 AM > [11/20/2020, 8:16:30 AM] Loading 1 accessories...

I'm new to the version, but I've never had a problem with earlier versions

latest errors noted in hubitat token, ap id, and IP address are XXXX for security purposes:

app:912020-11-20 15:13:28.721 errorHomebridge (v2.1.6) | sendHttpPost: no plugin server configured src: sendDeviceRefreshCmd path: refreshDevices [app_id:xx, access_token:xxxxxxxxxxxxxxxxx]

app:912020-11-20 15:13:25.710 errorHomebridge (v2.1.6) | sendHttpPost: no plugin server configured src: updateServicePrefs path: updateprefs [app_id:xx, access_token:xxxxxxxxxxxxxxxxx, use_cloud:false, validateTokenId:false, local_hub_ip:xxx.xxx.xxx.xxx]

Update 2020-11-20 19:16 (US CST) Just ran a test Firewalls off, with all ports from the computer on which Homebridge resides monitored, nothing from Homebridge-hubitat is going out to query the hubitat, so it is not a firewall issue, or router issue. All other communications from Homebridge to hubitat appear to be operating normally.

Update 2020-11-22 17:03 (US CST) Same results running on another computer, but same hubitat. Your Smartings plug-in is still working fine

FIXED using Chrome vs. Safari Browser copy and paste functions.

[Feature Request] Remove 'Fan' capability from Thermostat (UK)

In the UK we typically don't have 'air conditioning' based heating systems, at the moment when integrating a Thermostat into HomeKit 2 types of devices are added, a thermostat and a fan. This seems to only apply to the Hubitat integration, not the ST integration.

It would be great if there was an option to remove the 'fan' capability from any Hubitat thermostats integrated into HomeKit via this Homebridge plugin (similar to how we can select 'Heat only' thermostats).

(BUG) Motion Sensors not reporting into Homebridge from Hubitat

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • [x ] That OAuth is Enabled for the SmartApp under the IDE.
  • [x ] The SmartApp and Device Handler are using the latest code available.
  • [ ??] That Both the SmartApps and Device Handlers have been Published for You in the IDE.

About Your Setup

  • How many devices are detected?:
    12

  • SmartApp Version:
    Not sure what this means so I will spray information
    homebridge-hubitat-tonesto7 v2.2.1
    @field static final String appVersionFLD = "2.1.6"

  • Device Handler Version:
    Not sure where to find this.

  • Homebridge Version:
    v1.1.7

  • NodeJS Version:
    v12.18.3
    --

Expected Behavior

I have Konnected Apps installed on Hubitat. They successfully register. I have two boards, one with Reed switches (Konnected Connect app) , the other board has motion (Konnected Pro app). These require different apps.
I am able to see them in Hubitat. They all trigger when they are supposed to.
I can see all the devices be put in the default room in homekit.
I would expect the reed switches to show when the doors open and the motion sensors to indicated motion.

Current Behavior

The reed switches work in Homekit, but the motion sensors do not. In Hubitat I see the motion sensor show movement. In the device page the current states switches from motion: inactive to motion: active when I make my children jump in front of them. This happens to all of them.

Context

**How has this issue affected you? What are you trying to accomplish? Just trying to see motion detected in homekit.

Two things I noticed, 1. Homebridge v2 app in hubitat says Code Update Available app v2.2.1. I have no idea how to update it.

  1. This is the problem I think: When I go to Apps->Homebridge and click the settings cog (in Hubitat) I see in sensorlist all the sensors. But in Event subscriptions, I see only the set of sensors working.

Love the app. When looking for an answer, your "Hey how about a donation" popped up, which I did. sorry it wasn't more.

image

image

[Feature Request]

Could it be possible to be able to select contact sensors for the garage door category? Thanks

Hubitat Siren triggered status support in Homebridge

Is your feature request related to a problem? Please describe.
Currently the plugin only shares Home, Away Night or off, but HomeKit supports the status "triggered" it would be awesome if this app can update the status of the HomeKit alarm system with triggered when HSM status = triggered

why bother? it's a sensible question! basically I want to use my Sonos speakers as the siren and I have more customisation of which audio file to play in HomeKit. I also use HomeKit as the sole UI for my home automation systems for day to day use as its just a bit more intuitive for everyone else in the house.

Describe the solution you'd like
If we could have triggered data exposed to the HomeKit alarm system in method to the homebridge app homebridge-securitysystem https://github.com/MiguelRipoll23/homebridge-securitysystem#readme

example of the implemented capability:
Screenshot 2021-03-13 at 09 38 37

Describe alternatives you've considered
using homebridge as the home alarm hub = but this doesn't benefit from the high level of customisation in Hubitat.

Additional context
Add any other context or screenshots about the feature request here.

Plugin won't launch on Hoobs

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • That OAuth is Enabled for the SmartApp under the IDE.
  • The SmartApp and Device Handler are using the latest code available.
  • That Both the SmartApps and Device Handlers have been Published for You in the IDE.

Expected Behavior

Plugin launches

Current Behavior

Logs show the following:

11/15/2020, 9:53:16 PM [Hubitat-v2] Initializing Hubitat-v2 platform...
11/15/2020, 9:53:16 PM [Hubitat-v2] Hubitat-v2 Plugin is not Configured | Skipping...

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. Install Plugin on Hoobs (latest)

Update 1.5.5 causes Homebridge to not start.

sudo npm i -g homebridge-hubitat-tonesto7

Results in:

$ homebridge
fs.js:675
return binding.read(fd, buffer, offset, length, position);
^

Error: EISDIR: illegal operation on a directory, read
at Object.fs.readSync (fs.js:675:18)
at tryReadSync (fs.js:540:20)
at Object.fs.readFileSync (fs.js:583:19)
at LocalStorage.parseDirSync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/local-storage.js:637:35)
at LocalStorage.parseDataDirSync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/local-storage.js:572:21)
at LocalStorage.initSync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/local-storage.js:145:14)
at Object.nodePersist.initSync (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/node_modules/node-persist/src/node-persist.js:41:29)
at Object.init (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/index.js:31:13)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:28:7)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)

Ability to rename the Homebridge app after installation

Is your feature request related to a problem? Please describe.
I installed the app in Hubitat with the default name (Homebridge v2). After I had configured it, I wanted to change the name to something more descriptive (e.g. Homebridge - Dev) but I cannot rename the app. Another reason for re-naming was that I was going to switch from MakerAPI to the app and I have 2 instances of Homebridge running (Prod and Dev), so I wanted to be able to differentiate between the two (they will have different devices being exposed).

Describe the solution you'd like
User should be able to rename the app

Describe alternatives you've considered
Deleting the app and then reconfiguring it. Since this is a development instance of the app, it's not a big deal but if I had configured it with all devices, it would have been a pain to delete and reconfigure.

Additional context
Add any other context or screenshots about the feature request here.

The plugin "homebridge-hubitat-tonesto7" requires a Homebridge version of >=1.2.0

Running Hoobs 3.3.2 node 14.15.4. I update to 2.3.3 ( both Hoobs plugin and Habitat App ). Everything seems to be working fine but getting this in the log now. I did not get this on the last version 2.3.2.

The plugin "homebridge-hubitat-tonesto7" requires a Homebridge version of >=1.2.0 which does not satisfy the current Homebridge version of 1.1.7. You may need to update this plugin (or Homebridge) to a newer version. You may face unexpected issues or stability problems running this plugin.

(BUG) {Unable to add Xiaomi Light Sensor to HE app}

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • That OAuth is Enabled for the SmartApp under the IDE.
  • The SmartApp and Device Handler are using the latest code available.
  • That Both the SmartApps and Device Handlers have been Published for You in the IDE.

About Your Setup

  • How many devices are detected?: 3
  • Mobile App Version(Not required):
  • SmartApp Version: HE app v2.2.2
  • Device Handler Version:
  • Homebridge Version: 1.3.0
  • NodeJS Version:

Expected Behavior

I should be able to add the Xiaomi Light Sensor under either "Sensors" or "Other"

Current Behavior

Unable to add the device - get a "remove duplicate device" (null) error

Steps to Reproduce (for bugs)

  1. Pair a Xiaomi Light Sensor (Zigbee 3.0) to HE
  2. Attempt to add the sensor (either under Sensors or Other) section in the Homebridge 2.0 app
  3. I was able to select the device but as soon as I clicked update, I got the error (screenshots attached)
  4. I turned on debug log but there were no entries in the log

Context

**How has this issue affected you? What are you trying to accomplish? I can publish this device via MakerAPI and the MakerAPI Homebridge plugin can see it. I wanted to migrate all my devices to the app and the new plug-in but I am not able to do this.
Providing context helps us come up with a solution that is most useful in the real world


Please include a copy of any relevant log output to assist in tracking down the bug
See attached screenshots
Screen Shot 2021-02-22 at 7 37 31 PM
Screen Shot 2021-02-22 at 7 28 06 AM
Screen Shot 2021-02-22 at 7 27 58 AM

Device state doesn't get updated in Homebridge

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • [x ] That OAuth is Enabled for the Hubitat App under the Homebridge v2 App under App Code.
  • [x ] The Hubitat App and Homebridge Plugin are updated to the latest code available.

About Your Setup

  • How many devices are detected?:25
  • Hubitat App Version: v2.4.1
  • Homebridge Plugin Version: v2.4.1
  • Homebridge Version: 1.2.5, 1.3.2
  • NodeJS Version: 13.11.0

Expected Behavior

Turn on switch (setup in Homebridge v2 app) in Hubitat dashboard, the accessory switch in Homebridge should turn on.
Turn off switch in Hubitat dashboard, the accessory switch in Homebridge should turn off.

Current Behavior

What happens instead of the expected behavior?
Turning on the switch from Hubitat works ok. I can see in the homebridge logs that the switch is on:
[3/7/2021, 11:18:46 am] [Hubitat-v2] INFO: [Device Event]: (Master Desk Lamp) [SWITCH] is on

Turning off the switch from Hubitat isn't working. I can see in the homebridge logs that the switch was turned off:
[3/7/2021, 11:18:50 am] [Hubitat-v2] INFO: [Device Event]: (Master Desk Lamp) [SWITCH] is off

But the status change isn't reflected in the homebridge accessory - it still shows on. However, if I refresh the Accessories page in homebridge, the status of the accessory will correctly update to off.

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. Turn switch on from hubitat, observe status of corresponding accessory in homebridge (device state changes correctly)
  2. Turn switch off from hubitat, observe status of accessory. (device state doesn't change)
  3. Check homebridge logs to see if on/off events were received (both on and off events appear in logs)
  4. Refresh homebridge accessory page from broswer and observe that device status updates correctly

Context

**How has this issue affected you? What are you trying to accomplish?
I am using the Homebridge v2 plugin to control several iHome outlets from Hubitat. This setup was working correctly until the recent updates to homebridge and homebridge-hubitat. I have downgraded homebridge back to 1.2.5 yet this behavior still exists. I'm still not sure if this is an issue with homebridge or the changes that were made to homebridge-hubitat to accommodate the latest homebridge update. Any help would be GREATLY appreciated as this has caused a number of automations to fail. Thank you!

Providing context helps us come up with a solution that is most useful in the real world


Please include a copy of any relevant log output to assist in tracking down the bug

(BUG) Negative temperatures report as 200degC

Now that it's winter, some of my external devices on Hubitat are reporting negative values. However, when these values are sent to HomeKit via homebridge-hubitat-tonesto7 they appear as 200degC at all times. The temperatures are reported correctly in the Homebridge logs.

Perhaps it is related to this issue reported on the homebridge-hue project?

image

image

sendStartDirect Error: Request failed with status code 405

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • That OAuth is Enabled for the SmartApp under the IDE.
  • The SmartApp and Device Handler are using the latest code available.
  • That Both the SmartApps and Device Handlers have been Published for You in the IDE.

About Your Setup

  • How many devices are detected?: 12
  • Mobile App Version(Not required):
  • SmartApp Version: 2.0.2
  • Device Handler Version:
  • Homebridge Version:
  • NodeJS Version:

Expected Behavior

Tell us what you think should be happening

It should connect with working IPs.

Current Behavior

What happens instead of the expected behavior?

In Homebridge logs I see:

[11/7/2020, 4:18:06 am] [Hubitat-v2] INFO: Sending StartDirect Request to Hubitat | LocalCommand: (true)
[11/7/2020, 4:18:06 am] [Hubitat-v2] INFO: Direct Connect Active | Listening at 172.31.2.128:8000
[11/7/2020, 4:18:06 am] [Hubitat-v2] ERROR: sendStartDirect Error: [object Object] | Message: Request failed with status code 405
[11/7/2020, 4:18:08 am] [Hubitat-v2] INFO: INFO: Your plugin version is up-to-date
[11/7/2020, 4:18:08 am] [Hubitat-v2] NOTICE: Sending Plugin Status to Hubitat | UpdateAvailable: false
[11/7/2020, 4:18:08 am] [Hubitat-v2] ERROR: sendUpdateStatus Error: [object Object] | Message: Request failed with status code 405

In Hubitat logs I see:

app:7122020-11-07 04:18:35.085 am debugHomebridge (v2.0.8) | Code versions: null
app:7122020-11-07 04:16:59.889 am warnConnection refused (Connection refused)
app:7122020-11-07 04:16:59.879 am traceHomebridge (v2.0.8) | sendDeviceRefreshCmd: null:null
app:7122020-11-07 04:16:56.920 am warnConnection refused (Connection refused)
app:7122020-11-07 04:16:56.872 am traceHomebridge (v2.0.8) | updateServicePrefs: null:null
app:7122020-11-07 04:16:51.798 am debugHomebridge (v2.0.8) | -----------------------------------------------
app:7122020-11-07 04:16:51.795 am debugHomebridge (v2.0.8) | Registered (12 Devices)

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. Install as documented
  2. copy-pasta config items from Hubitat UI to Homebridge
  3. Save Hubitat app config
  4. Save Homebridge config

(BUG) Characteristic Warning

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • That OAuth is Enabled for the Hubitat App under the Homebridge v2 App under App Code.
  • The Hubitat App and Homebridge Plugin are updated to the latest code available.

About Your Setup

  • How many devices are detected?: 112
  • Hubitat App Version: 2.5.0
  • Homebridge Plugin Version: 2.5.2
  • Homebridge Version:
  • NodeJS Version:

Expected Behavior

No repetitive warning messages in log

Current Behavior

Repetitive warning messages in log. Not sure it's causing any actual problems.

Steps to Reproduce (for bugs)

I think it may have something to do with my thermostat? It's a centralite Pearl.

Context

No specific problems identified as a result of this log message, yet.


Please include a copy of any relevant log output to assist in tracking down the bug

log

RGBW Color not setting correctly

Every time I attempt to change the color of an RGBW bulb it is changes to an inaccurate color. For example, I asked Siri to change the color to red and it was set to orange. I checked the log for the change and noticed that there is an error. I am using Sylvania Smart+ RGBW bulbs. This is the log from that color change:

app:65 2019-02-25 12:20:54.010 pm debug Sending DEVICE Event (Living Room Lamp | SWITCH: on) to Homebridge at (192.168.86.222:8005)
dev:2 2019-02-25 12:20:53.956 pm info Living Room Lamp was turned on
app:65 2019-02-25 12:20:53.422 pm debug Sending DEVICE Event (Living Room Lamp | COLORMODE: RGB) to Homebridge at (192.168.86.222:8005)
app:65 2019-02-25 12:20:53.416 pm debug Sending DEVICE Event (Living Room Lamp | COLORNAME: Orange) to Homebridge at (192.168.86.222:8005)
dev:2 2019-02-25 12:20:53.366 pm info Living Room Lamp colorMode is RGB
dev:2 2019-02-25 12:20:53.363 pm info Living Room Lamp color is Orange
dev:2 2019-02-25 12:20:53.169 pm info Living Room Lamp saturation is 100%
app:65 2019-02-25 12:20:53.121 pm debug Sending DEVICE Event (Living Room Lamp | HUE: 11%) to Homebridge at (192.168.86.222:8005)
dev:2 2019-02-25 12:20:53.059 pm info Living Room Lamp hue was set to 11%
app:65 2019-02-25 12:20:53.056 pm info Command Successful for Device Living Room Lamp | Command setHue()
dev:2 2019-02-25 12:20:53.053 pm error java.lang.NullPointerException: Cannot invoke method multiply() on null object (setHue)
app:65 2019-02-25 12:20:53.050 pm info Command Successful for Device Living Room Lamp | Command on()
app:65 2019-02-25 12:20:53.035 pm info Command Successful for Device Living Room Lamp | Command setSaturation(100)
app:65 2019-02-25 12:20:53.030 pm info Process Command | DeviceId: 2 | Command: (setHue)
app:65 2019-02-25 12:20:53.022 pm info Process Command | DeviceId: 2 | Command: (setSaturation) | Param1: (100)
app:65 2019-02-25 12:20:52.991 pm info Process Command | DeviceId: 2 | Command: (on)

isValidRequestor incorrectly fails messages with the correct app id and token

I've added some additional logging in the platform code, and it shows the problem is mismatched types:

[11/7/2020, 2:49:08 pm] [Hubitat-v2] ERROR: (initial) | We received a request from a client that didn't provide a valid access_token and app_id
[11/7/2020, 2:49:08 pm] [Hubitat-v2] DEBUG: Supplied app id 512 != 512, token 1a2b3c4d-9f8e-1a2b-3c4d-9f8e7d6d5c4b1f != 1a2b3c4d-9f8e-1a2b-3c4d-9f8e7d6d5c4b1f
[11/7/2020, 2:49:08 pm] [Hubitat-v2] DEBUG: Supplied app id 512 type number original type undefined
[11/7/2020, 2:49:08 pm] [Hubitat-v2] DEBUG: API ID match: false
[11/7/2020, 2:49:08 pm] [Hubitat-v2] DEBUG: Supplied access token 1a2b3c4d-9f8e-1a2b-3c4d-9f8e7d6d5c4b1f type string original type string
[11/7/2020, 2:49:08 pm] [Hubitat-v2] DEBUG: Access token match: true

This is the fix, with additional debug logging:

diff --git a/src/HE_Platform.js b/src/HE_Platform.js
index 23af0ec..9c003a9 100644
--- a/src/HE_Platform.js
+++ b/src/HE_Platform.js
@@ -217,8 +217,11 @@ module.exports = class HE_Platform {
         if (this.configItems.validateTokenId !== true) {
             return true;
         }
-        if (app_id && access_token && access_token === this.getConfigItems().access_token && app_id === this.getConfigItems().app_id) return true;
+        if (app_id && access_token && access_token === this.getConfigItems().access_token && Number(app_id) === Number(this.getConfigItems().app_id)) return true;
         this.log.error(`(${src}) | We received a request from a client that didn't provide a valid access_token and app_id`);
+        if (this.logConfig.debug === true) {
+            this.log.debug(`Supplied app id ${app_id} != ${this.getConfigItems().app_id}, token ${access_token} != ${this.getConfigItems().access_token}`);
+        }
         return false;
     }

(BUG) {error 500 sending commands from homekit}

Verify the following before opening an trouble issue

Go over all the following points, and put an x in all the boxes that apply.
If you're unsure about any of these, don't hesitate to ask. We're here to help!

  • [x ] That OAuth is Enabled for the Hubitat App under the Homebridge v2 App under App Code.
  • [ x] The Hubitat App and Homebridge Plugin are updated to the latest code available.

About Your Setup

  • How many devices are detected?: 120 selected, more available
  • Hubitat App Version: 2.33
  • Homebridge Plugin Version: 2.33
  • Homebridge Version: 1.3.1
  • NodeJS Version: 15.10.0

Expected Behavior

Tell us what you think should be happening
homekit commands sending to hubitat should activate same commands in hubitat

Current Behavior

What happens instead of the expected behavior?
no change, homebridge logging showing error in send command of 500

Steps to Reproduce (for bugs)

Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant

  1. in home.app ios turn off switch

Context

**How has this issue affected you? What are you trying to accomplish?
Providing context helps us come up with a solution that is most useful in the real world
homekit <> homebridge <> hubitat communications have been fine. updated nodejs after icu4j updated caused failure, after updating no longer able to send commands from homekit thru homebridge. showing an error 500 in logs. logs are showing communication from hubitat to homebridge are working as various sensor devices are updating.

running on os x catalina

Please include a copy of any relevant log output to assist in tracking down the bug

[2/28/2021, 1:12:37 pm] [INFO]: [Device Event]: (Network Rack Sensor) [TEMPERATURE] is 82.5 [2/28/2021, 1:12:40 pm] [INFO]: [Device Event]: (Stoop Sensor) [ILLUMINANCE] is 1349 [2/28/2021, 1:12:50 pm] [INFO]: [Device Event]: (Stoop Sensor) [ILLUMINANCE] is 971 [2/28/2021, 1:13:00 pm] [INFO]: [Device Event]: (Stoop Sensor) [ILLUMINANCE] is 721 [2/28/2021, 1:13:25 pm] [NOTICE]: Sending Device Command: off | Name: (Kitchen Display Cases) | DeviceID: (357) | UsingCloud: (false) [2/28/2021, 1:13:25 pm] [ERROR]: sendDeviceCommand Connection failure | Message: Request failed with status code 500 [2/28/2021, 1:13:25 pm] [NOTICE]: Sending Device Command: off | Name: (Kitchen Counter) | DeviceID: (358) | UsingCloud: (false) [2/28/2021, 1:13:25 pm] [ERROR]: sendDeviceCommand Connection failure | Message: Request failed with status code 500 [2/28/2021, 1:13:26 pm] [NOTICE]: Sending Device Command: off | Name: (Bar Shelves) | DeviceID: (37) | UsingCloud: (false) [2/28/2021, 1:13:26 pm] [ERROR]: sendDeviceCommand Connection failure | Message: Request failed with status code 500 [2/28/2021, 1:13:29 pm] [NOTICE]: Sending Device Command: off | Name: (Upper Landing Steplight) | DeviceID: (242) | UsingCloud: (false) [2/28/2021, 1:13:29 pm] [ERROR]: sendDeviceCommand Connection failure | Message: Request failed with status code 500 [2/28/2021, 1:13:29 pm] [NOTICE]: Sending Device Command: off | Name: (Lower Landing Steplight) | DeviceID: (243) | UsingCloud: (false) [2/28/2021, 1:13:30 pm] [ERROR]: sendDeviceCommand Connection failure | Message: Request failed with status code 500 [2/28/2021, 1:13:32 pm] [INFO]: [Device Event]: (Garage Sensor) [ILLUMINANCE] is 35 [2/28/2021, 1:13:40 pm] [INFO]: [Device Event]: (Stoop Sensor) [ILLUMINANCE] is 1377

Disconnecting issue

Seems like after a few days or so for me, the integration between Homekit and Hubitat disconnects.

I have to reboot the home bridge service to get it going again.

Any one have issues?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.