tonesto7 / homebridge-smartthings

SmartThings Homebridge Plugin
385 stars 767 forks source link

[BUG] Can't Add Homebridge Plugin to Apple Home After V2.1 Upgrade #315

Closed pizzinini closed 4 years ago

pizzinini commented 4 years ago

Any idea? Thank you!

scoobaspeaz commented 4 years ago

Check your app id and access token in your smartapp to make sure it didnt change on you. You need to compare what you have in the app to the config.json file for the Smartthings platform in the homebridge configuration..

edit: also im not sure what you mean by cant add SmartThings homebridge to apple home. You add SmartThings hub to homebridge. Homebridge is what is added to Apple Home app.

pizzinini commented 4 years ago

Communication between Homebridge and SmartThings works fine. All my accessories load in Homebridge and periodically update status. So the token is ok. It’s the connection of to the Home app that does not work for the SmartThings plugin.

tonesto7 commented 4 years ago

@pizzinini Are you adding any Buttons from SmartThings into HomeKit?

pizzinini commented 4 years ago

Yes I am. I am adding 1 button under “Buttons” in the smartapp and multiple virtual Devices with buttons capability under “Other”

tonesto7 commented 4 years ago

@pizzinini Try removing the button from homebridge and see if the plugin comes back to life.

Something is wrong with the Buttons that needs some serious looking into I might remove them from the smartapp if I can't figure it out today

scoobaspeaz commented 4 years ago

Not to convolute the issue but I found that, if I added something like my tv through this plugin, then HomeKit would not communicate with homebridge. Homebridge and Smartthings would still work together but wouldnt work with the Home app. Probably something to do with how secure HomeKit is or something vs homebridge being ran insecure so it worked.

When using the EVE app I tried to get an ID response from homebridge and the connection error'd out. Thats when I found out that Homebridge was, what I assume, sending invalid things from the TV config that HomeKit wouldnt support so HomeKit "blacklisted" homebridge. The only way I could get it to work was remove the TV and just stick to the lightbulbs. I also had to remove homebridge from home and repair it to the home app. For my TV I went back to using the Samsung-tizen plugin for it and stuck to lightbulbs for the SmartThings plugin.

I ramble about this because to me it sounds like the same issue he is facing but just not with a TV, which in this case, possibly that button. If im right then that might help explain to Pizzinini what's going on.

This plugin is awesome btw and has opened up so many new devices for me. Thankful its here :D

pizzinini commented 4 years ago

@scoobaspeaz I do remember having a similar issue with my Schlage lock on pdlove's version of the plug-in. Thank you!

I will try adding different devices and report back if I can pinpoint which one created the error or if the new updates fixed it.

THANK YOU!!!.

pizzinini commented 4 years ago

Note: Innovelli switches worked without problems prior to me upgrading to smartapp 2.1.0 and plugin 2.1.7

https://www.amazon.com/gp/product/B07T26MVYC/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

DTH for Inovelli switches: https://raw.githubusercontent.com/InovelliUSA/SmartThingsInovelli/master/devicetypes/inovelliusa/inovelli-switch-lzw30.src/inovelli-switch-lzw30.groovy

tonesto7 commented 4 years ago

@pizzinini In the smartapp there is a device data viewer page where you can select a device and it will show all data about it. Can you post that JSON data here please?

pizzinini commented 4 years ago

{ "name": "Front Door Light", "basename": "Inovelli Switch Red Series", "deviceid": "6efa2d4d-c760-42d2-9d29-b6b2abff271a", "status": "ACTIVE", "manufacturer": "Unknown", "model": "Inovelli Switch Red Series LZW30-SN", "deviceNetworkId": "67", "lastActivity": "2020-01-10T23:15:40+0000", "capabilities": [ "Actuator", "Button", "Configuration", "Energy Meter", "Holdable Button", "Power Meter", "Refresh", "Sensor", "Switch" ], "commands": [ "configure", "holdDown", "holdUp", "off", "on", "pressConfig", "pressDownX1", "pressDownX2", "pressDownX3", "pressDownX4", "pressDownX5", "pressUpX1", "pressUpX2", "pressUpX3", "pressUpX4", "pressUpX5", "refresh", "reset", "setAssociationGroup" ], "customflags": [

],
"attributes": {
    "button": "pushed",
    "energy": 0.165,
    "firmware": "1.09",
    "lastActivity": "2020 Jan 10 Fri 6:15:40 PM",
    "lastEvent": " Tap \u25b2",
    "numberOfButtons": 7,
    "power": 11,
    "supportedButtonValues": null,
    "switch": "on"
},
"eventHistory": [
    "Fri Jan 10 23:06:37 UTC 2020 | [power] | (11 W)",
    "Fri Jan 10 23:06:35 UTC 2020 | [power] | (10 W)",
    "Fri Jan 10 22:45:39 UTC 2020 | [power] | (11 W)",
    "Fri Jan 10 22:45:37 UTC 2020 | [power] | (3 W)",
    "Fri Jan 10 22:45:36 UTC 2020 | [switch] | (on)",
    "Fri Jan 10 22:33:56 UTC 2020 | [power] | (0 W)",
    "Fri Jan 10 22:33:55 UTC 2020 | [switch] | (off)",
    "Fri Jan 10 22:30:33 UTC 2020 | [power] | (10 W)",
    "Fri Jan 10 22:30:33 UTC 2020 | [energy] | (0.165 kWh)",
    "Fri Jan 10 22:00:58 UTC 2020 | [energy] | (0.160 kWh)",
    "Fri Jan 10 22:00:03 UTC 2020 | [power] | (11 W)",
    "Fri Jan 10 22:00:01 UTC 2020 | [power] | (5 W)",
    "Fri Jan 10 22:00:00 UTC 2020 | [switch] | (on)",
    "Fri Jan 10 21:30:32 UTC 2020 | [energy] | (0.159 kWh)",
    "Fri Jan 10 21:03:26 UTC 2020 | [power] | (0 W)",
    "Fri Jan 10 21:03:25 UTC 2020 | [switch] | (off)",
    "Fri Jan 10 20:57:54 UTC 2020 | [power] | (10 W)",
    "Fri Jan 10 20:57:50 UTC 2020 | [switch] | (on)"
pizzinini commented 4 years ago

I removed the button capability and now the switches work. I added them back in and this creates the error again.

It looks like you guessed right yesterday. Buttons don’t currently work.

Thank you for all the help!

tonesto7 commented 4 years ago

I want to thank you for finally giving me an actionable direction to solve this issue.

cladmonitor commented 4 years ago

@tonesto7 Just tossing my hat in the ring to help provide info on this as well, I just spent 2 hours chasing my tail on this issue until I found this post. Im using the Samsung SmartThings Button.

{ "name": "Button", "basename": "Button", "deviceid": "f1f98c6c-7cfa-4b17-acda-1d662b67eabb", "status": "ONLINE", "manufacturer": "Samjin", "model": "button", "deviceNetworkId": "5D2F", "lastActivity": "2020-01-11T06:24:03+0000", "capabilities": [ "Battery", "Button", "Configuration", "Health Check", "Holdable Button", "Refresh", "Sensor", "Temperature Measurement" ], "commands": [ "configure", "ping", "refresh" ], "customflags": [ ], "attributes": { "DeviceWatch-DeviceStatus": null, "DeviceWatch-Enroll": "{\"protocol\":\"zigbee\",\"hubHardwareId\":\"0020\",\"scheme\":\"TRACKED\",\"checkInterval\":7260,\"lowBatteryThresholds\":[15,7,3],\"offlinePingable\":\"1\"}", "battery": 88, "button": "double", "checkInterval": 720, "healthStatus": null, "numberOfButtons": 1, "supportedButtonValues": "[\"pushed\",\"held\",\"double\"]", "temperature": 68 }, "eventHistory": [ "Sat Jan 11 04:58:18 UTC 2020 | [temperature] | (68 F)", "Sat Jan 11 03:37:36 UTC 2020 | [temperature] | (69 F)", "Sat Jan 11 01:51:41 UTC 2020 | [temperature] | (70 F)", "Sat Jan 11 00:25:56 UTC 2020 | [temperature] | (71 F)", "Fri Jan 10 23:20:22 UTC 2020 | [temperature] | (70 F)", "Fri Jan 10 22:24:53 UTC 2020 | [temperature] | (69 F)", "Fri Jan 10 21:24:21 UTC 2020 | [temperature] | (68 F)", "Fri Jan 10 20:38:57 UTC 2020 | [temperature] | (67 F)", "Fri Jan 10 19:33:23 UTC 2020 | [temperature] | (66 F)", "Fri Jan 10 17:57:32 UTC 2020 | [temperature] | (65 F)", "Fri Jan 10 14:55:55 UTC 2020 | [temperature] | (64 F)", "Fri Jan 10 14:45:49 UTC 2020 | [temperature] | (65 F)", "Fri Jan 10 12:59:53 UTC 2020 | [temperature] | (64 F)", "Fri Jan 10 12:04:23 UTC 2020 | [temperature] | (65 F)", "Fri Jan 10 11:54:18 UTC 2020 | [temperature] | (66 F)", "Fri Jan 10 11:53:20 UTC 2020 | [button] | (double)", "Fri Jan 10 11:53:19 UTC 2020 | [button] | (pushed)", "Fri Jan 10 11:53:14 UTC 2020 | [button] | (double)", "Fri Jan 10 11:49:15 UTC 2020 | [temperature] | (65 F)", "Fri Jan 10 10:58:49 UTC 2020 | [temperature] | (66 F)" ] }

tonesto7 commented 4 years ago

@pizzinini Can you verify that the new version works with Buttons and innovelli switches?

cladmonitor commented 4 years ago

@tonesto7 still crashing on mine. Updated plugin, restarted HB added button as Other. Waited for update and instantly all devices in Home.app stop responding.

pizzinini commented 4 years ago

@cladmonitor Correct - buttons don’t work right now. I had devices that included “button” as a capability and Now removed the capability in the Smartapp settings for them to work Virtual “momentary button tile” works fine.

EDIT: I did not notice the new plugin... should have read all my email SORRY!! After I updated the Inovelli switches work fine now. I also tried my ring doorbell that is a "button" in smartthings and this works now, too. @tonesto7 I think the issue is fixed. THANK YOU! @cladmonitor Did you update the plugin to 2.1.13 (you can check for he version number in the SmartApp.

cladmonitor commented 4 years ago

@pizzinini Sorry didnt see the edit (was watching via email) - Yes upgraded plugin to 2.1.13, restarted homebridge, added the button as a"other" in the smartapp and the second the refresh occurs in homebridge all of my devices are unresponsive (except native homekit stuff).

ultrathew commented 4 years ago

Same behavior as @cladmonitor is experiencing. Running plugin version 2.1.14, and everything works fine until I try to add a button. Everything - even non ST devices - freaks out and won't connect to HomeKit, despite continually attempting to, until I remove the button and STv2 refreshes the device list.

tonesto7 commented 4 years ago

@ultrathew Please make sure to update to the latest plugin.
When the plugin starts you will see a Sentry MachineId in the logs. Can you share that here, please?

roberkane212 commented 4 years ago

I’ve also updated to 2.1.16 and I also can not add buttons. Without buttons everything works fine

tonesto7 commented 4 years ago

@cladmonitor @ultrathew @roberkane212

Any of you guys still having issues please provide me the following. When the plugin starts you will see a Sentry MachineId in the logs.

ultrathew commented 4 years ago

@tonesto7 This is what I'm getting when I start the plugin. Adding any buttons still makes my entire HomeKit freak out with random "Updating/No Response" over nearly everything.

[1/14/2020, 9:15:11 PM] [SmartThings-v2] Initializing SmartThings-v2 platform... [1/14/2020, 9:15:11 PM] [SmartThings-v2] Initializing SmartThings-v2 platform... [1/14/2020, 9:15:11 pm] [SmartThings-v2] INFO: Homebridge Version: 2.4 [1/14/2020, 9:15:11 pm] [SmartThings-v2] INFO: Homebridge Version: 2.4 [1/14/2020, 9:15:11 pm] [SmartThings-v2] INFO: SmartThings-v2 Plugin Version: 2.1.16 [1/14/2020, 9:15:11 pm] [SmartThings-v2] INFO: SmartThings-v2 Plugin Version: 2.1.16 [1/14/2020, 9:15:11 pm] [SmartThings-v2] INFO: Sentry MachineId: c05bc7888893461fc149f4783e820bd05da8a2dd241da09ee4e6d0df744da502 [1/14/2020, 9:15:11 pm] [SmartThings-v2] INFO: Sentry MachineId: c05bc7888893461fc149f4783e820bd05da8a2dd241da09ee4e6d0df744da502

tonesto7 commented 4 years ago

@ultrathew What kind of button device are you trying to add?

cladmonitor commented 4 years ago

@tonesto7 INFO: Sentry MachineId: 40aae8814c290e1c0d6c289302dedefa45333414efc857b4f5c1945ef225228a

tonesto7 commented 4 years ago

@cladmonitor I only see one event generated from your plugin.

Error: connect ETIMEDOUT 192.168.235.221:39500 Which means the plugin can't reach your ST hub on the local network.

cladmonitor commented 4 years ago

@tonesto7 Thats not my network info my IoT network is 10.161.0.0/24

Heres the details on that same init that I grabbed the Sentry Machineid: INFO: INFO: Your plugin version is up-to-date NOTICE: Sending Plugin Status to SmartThings | UpdateAvailable: false NOTICE: setting temperature_unit to (F) NOTICE: Updating Global Values | HubIP: 10.161.0.222 | UseLocal: true WARN: Devices to Remove: (0) [] INFO: Devices to Update: (4) GOOD: Devices to Create: (0) [] INFO: Loading Existing Device (removed Office Window) | (40ce3781-8c25-46ee-8cb8-9ca456462363) INFO: Loading Existing Device (Bedroom Window) | (ac57f32e-54ee-48a6-a6df-b90b9d565b6b) INFO: Loading Existing Device (removed Office Window) | (4d2699e1-ab47-4354-a62a-3f3b4fe32942) INFO: Loading Existing Device (Mailbox) | (6400bb62-c970-4e4e-b91a-09c9eb0a2d82) ALERT: Total Initialization Time: (2 seconds) NOTICE: Unknown Capabilities: ["Three Axis"] INFO: SmartThings DeviceCache Size: (4) INFO: WebServer Initiated... INFO: Sending StartDirect Request to SmartThings | SendToLocalHub: (true) INFO: Direct Connect Active | Listening at 10.161.0.35:8000

tonesto7 commented 4 years ago

Can you go into the Homebridge SmartApp and select the Device Data Viewer > Select the button device you know is causing the plugin to crash and share the data with me here, please.

tonesto7 commented 4 years ago

I've been working on fixes for the bugs this error reported has been showing me.
So I want to try to squash this button thing for good before I push out the rest of the changes I've made today.

cladmonitor commented 4 years ago

@tonesto7 I shared it some days back -- https://github.com/tonesto7/homebridge-smartthings-v2/issues/45#issuecomment-573287518

cladmonitor commented 4 years ago

@tonesto7 I do want to say you've been a good sport over these trivial bugs, especially on your spare time. I really appreciate it and think many of us feel the same way. I just don't want to look like an ungrateful consumer, I want to be sure you know that I really do appreciate the help!

roberkane212 commented 4 years ago

I agree you really have

ultrathew commented 4 years ago

@tonesto7

{ "name": "Aeon Minimote button 1", "basename": "Child Button", "deviceid": "edfb5adb-3418-423b-a089-b2fc8e4fbfbf", "status": "ACTIVE", "manufacturer": "Unknown", "model": "Child Button", "deviceNetworkId": "05/1", "lastActivity": null, "capabilities": [ "Button", "Holdable Button", "Sensor" ], "commands": [

],
"customflags": [

],
"attributes": {
    "button": "pushed",
    "numberOfButtons": 1,
    "supportedButtonValues": "[\"pushed\",\"held\"]"
},
"eventHistory": [

]

}

tonesto7 commented 4 years ago

@cladmonitor @roberkane212 I appreciate the kind words.
I never looked at it that way :) I'm surprised you guys have stuck around with this new version having so many issues.

@ultrathew I literally have the exact same button I'm testing with and it works on my instance.
What input do you have the button selected under?

roberkane212 commented 4 years ago

{ "name": "Button Bedroom", "basename": "Button", "deviceid": "06c2f738-4587-4f6b-a243-aca20a1d84d3", "status": "ONLINE", "manufacturer": "Samjin", "model": "button", "deviceNetworkId": "88B2", "lastActivity": "2020-01-15T00:13:33+0000", "capabilities": [ "Battery", "Button", "Configuration", "Health Check", "Holdable Button", "Refresh", "Sensor", "Temperature Measurement" ], "commands": [ "configure", "ping", "refresh" ], "customflags": [

],
"attributes": {
    "DeviceWatch-DeviceStatus": null,
    "DeviceWatch-Enroll": null,
    "battery": 87,
    "button": "pushed",
    "checkInterval": 720,
    "healthStatus": null,
    "numberOfButtons": 1,
    "supportedButtonValues": "[\"pushed\",\"held\",\"double\"]",
    "temperature": 72
},
"eventHistory": [
    "Tue Jan 14 22:47:53 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 22:22:41 UTC 2020 | [temperature] | (73 F)",
    "Tue Jan 14 21:57:29 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 21:37:20 UTC 2020 | [temperature] | (73 F)",
    "Tue Jan 14 21:17:10 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 21:02:03 UTC 2020 | [temperature] | (73 F)",
    "Tue Jan 14 20:41:54 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 20:21:44 UTC 2020 | [temperature] | (73 F)",
    "Tue Jan 14 20:06:37 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 19:51:30 UTC 2020 | [temperature] | (73 F)",
    "Tue Jan 14 19:31:20 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 19:16:13 UTC 2020 | [temperature] | (73 F)",
    "Tue Jan 14 18:56:04 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 18:45:59 UTC 2020 | [temperature] | (73 F)",
    "Tue Jan 14 18:20:47 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 18:10:43 UTC 2020 | [temperature] | (73 F)",
    "Tue Jan 14 17:45:31 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 17:35:26 UTC 2020 | [temperature] | (73 F)",
    "Tue Jan 14 17:05:12 UTC 2020 | [temperature] | (72 F)",
    "Tue Jan 14 17:00:10 UTC 2020 | [temperature] | (73 F)"
]
roberkane212 commented 4 years ago

All my buttons are SmartThings

tonesto7 commented 4 years ago

When you select it what input are you selecting it under?

pizzinini commented 4 years ago

The button from my aeon minimote works fine for me with plugin 2.1.13 I selected it under “button”.

———————

{ "name": "Aeon Minimote 1 gym button 1", "basename": "Child Button", "deviceid": "2a8342ee-fdea-496e-9962-7152639de23e", "status": "ACTIVE", "manufacturer": "Unknown", "model": "Child Button", "deviceNetworkId": "37/1", "lastActivity": null, "capabilities": [ "Button", "Holdable Button", "Sensor" ], "commands": [

],
"customflags": [

],
"attributes": {
    "button": null,
    "numberOfButtons": 1,
    "supportedButtonValues": null
},
"eventHistory": [

]

}

cladmonitor commented 4 years ago

@cladmonitor @roberkane212 I appreciate the kind words. I never looked at it that way :) I'm surprised you guys have stuck around with this new version having so many issues.

@ultrathew I literally have the exact same button I'm testing with and it works on my instance. What input do you have the button selected under?

I tried Sensor and Other, same result both ways.

Long shot but what version of NPM and Node are you using?

tonesto7 commented 4 years ago

try selecting the button under Define Device Types input and select buttons

roberkane212 commented 4 years ago

That’s what I did with mine, should I try the other?

tonesto7 commented 4 years ago

Ugh... I wish I had one of these ST buttons. Is this the button you are using? https://www.samsung.com/us/smart-home/smartthings/buttons/samsung-smartthings-button-gp-u999sjvleaa/

cladmonitor commented 4 years ago

Same result - it's strange how it hangs, no errors in HB log, even other ST actions are still logged (i.e opening a window still shows accelerometer actions and contact changes)

INFO: Received request from SmartThings-v2 to refresh devices NOTICE: setting temperature_unit to (F) NOTICE: Updating Global Values | HubIP: 10.161.0.222 | UseLocal: true WARN: Devices to Remove: (0) [] INFO: Devices to Update: (4) GOOD: Devices to Create: (2) [ 'Button', 'Button' ] INFO: Loading Existing Device (Angela’s Office Window) | (40ce3781-8c25-46ee-8cb8-9ca456462363) INFO: Loading Existing Device (Bedroom Window) | (ac57f32e-54ee-48a6-a6df-b90b9d565b6b) INFO: Loading Existing Device (Eric’s Office Window) | (4d2699e1-ab47-4354-a62a-3f3b4fe32942) INFO: Loading Existing Device (Mailbox) | (6400bb62-c970-4e4e-b91a-09c9eb0a2d82) INFO: Added Device: (Button | 60449248-b8c4-4b8d-a668-e9ed2b426912) INFO: Added Device: (Button | f1f98c6c-7cfa-4b17-acda-1d662b67eabb) ALERT: Total Initialization Time: (1 seconds) NOTICE: Unknown Capabilities: ["Three Axis","Holdable Button"] INFO: SmartThings DeviceCache Size: (6) INFO: SmartThings-v2 Hub Sent Preference Updates

On Tue, Jan 14, 2020 at 4:59 PM Tonesto7 notifications@github.com wrote:

try selecting the button under Define Device Types input and select buttons

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tonesto7/homebridge-smartthings-v2/issues/45?email_source=notifications&email_token=AH2UNQ7VREKRVMPSKXI5OSDQ5ZNX5A5CNFSM4KETNJDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEI6VXPQ#issuecomment-574446526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH2UNQ5EYIV4WYGWZMTV5TLQ5ZNX5ANCNFSM4KETNJDA .

roberkane212 commented 4 years ago

@tonesto7 Yes that is the button I’m using

tonesto7 commented 4 years ago

Ok, I've ordered one of the buttons along with a few other of ST's new sensors :)

They will be here on Thursday.

cladmonitor commented 4 years ago

@tonesto7 Even a virtual button does it from IDE ... I tried a few until it broke my homekit config on my homekit hub thus wiping out all accessories :( guess I know what I'll be doing for the rest of the night. No matter I think I may also strip HB down to just ST and build up again seeing if its related to any plugin specifically. Also I'll put HB in Debug so I can catch anything of note.

All this so my wife can press this button on her night stand to shut off my bedside lamp when I pass-out and forget to turn it off.... :P

tonesto7 commented 4 years ago

That's weird because I also have a virtual button as well.

I can say that I have multiple homebridge instances running: 1 for SmartThings (because I have almost 150 devices coming into HomeKit) 1 for my harmony, nest, nest cams 1 for my chamberlain, and 5 RTSP cameras

roberkane212 commented 4 years ago

I remember everything working for me at one point. Did this work for anyone else at one point. And do you know what version it worked on. I might downgrade

tonesto7 commented 4 years ago

Just bear with me a little while longer. I’m completely rebuilding the buttons.

You can now select the whole remote now and it will build an accessory with actions for each button on the remote. EE2B3253-ED2E-4966-9568-80C4E6B7E524

All that remains is just getting the button numbers pressed under ST to the correct button on the remote.

If all goes well I will be able to push it out tonight.

cladmonitor commented 4 years ago

@tonesto7 No luck but here's what I tried, in case you have any other ideas.

  1. I setup a fresh pi4 with Hoobs and still had the same issue
  2. Homebridge in debug logging doesn't log any anomalies
  3. I renamed the buttons in case it was a naming issue
  4. Set temps to C just in case it was a formatting issue
cladmonitor commented 4 years ago

@tonesto7 one other idea in case you dont have luck with the new buttons. I'm not even sure if this would even be possible but, with a remote hub (even if I disabled local updates) could you give me an app id, token and url that I inject into a hoobs test instance to see how it reacts?