joeyhage / homebridge-alexa-smarthome

Connect Alexa devices to HomeKit
MIT License
62 stars 20 forks source link

2.1.5 was working, now getting too many request errors #137

Open amd2800barton opened 1 week ago

amd2800barton commented 1 week ago

Describe The Bug:

Basically title. Had been non functioning for a bit, even after rolling back to 2.0.12(?) from .14. 2.1.5 fixed the issue connecting to Amazon/Alexa. Last ~36-48 hours have been getting timeouts and too many request warnings. edit to add - appears to be happening on a second homebridge instance I also run for my parents at their house on a docker/raspbian install.

Logs

requestUnsuccessful(Error getting smart home device state(s). Response: {
  "message": "Too many requests. Try again in some time."
})

Get current temperature - timeout while waiting for mutex to become available

Environment:

CrisNevares commented 1 week ago

Same here. Running 2.1.5

GreatBazunka-eng commented 1 week ago

same here. I am getting continuous messages that say the read handler for the characteristic on didn’t respond at all. And many other variations of that error message pertaining to device state and brightness.

fmottaz commented 1 week ago

Same for me

roomonthethird commented 1 week ago

Same as well, commenting to follow

joeyhage commented 1 week ago

I'm observing that behavior as well. I copied the user agent directly from the Alexa app on my phone, and of course my Alexa app still works, so the Amazon API is distinguishing traffic from Homebridge another way.

I will dig in more but I don't have any firm leads at this time.

joeyhage commented 1 week ago

Actually, I just observed the Alexa app intermittently generating 429 too many requests errors. It's likely at an Alexa account level.

joeyhage commented 1 week ago

Seems like Amazon is trending towards deprecating more and more Alexa APIs rather than maintaining them. I just heard about the deprecation of the List API today: https://developer.amazon.com/en-US/docs/alexa/ask-overviews/deprecated-features.html#shopping-lists

joeyhage commented 1 week ago

After debugging this the last 6 hours burning the midnight oil, I have tried a number of things that don't work. However I just discovered something that seams promising but have yet to test it out. If it works, it's going to require a significant redesign of the code so I'm going to need a lot of coffee ☕

fmottaz commented 1 week ago

Tell us how many cups and we will provide…

You are the only hope I have left for 40 light switches (a completely renovated old house) installed 4 years ago with the promise of HomeKit compatibility which never arrived. And as they say every time I ask, they cannot announce future products.

Francesco Mottaz A Fondamenta dei Borgognoni, 3 | 30142 Venezia (VE) | Italia M +39 351 958 6060   <tel:+39 351 958 6060> E @. @.>

Le 27.06.2024 à 08:36, Joey Hage @.***> a écrit :

After debugging this the last 6 hours burning the midnight oil, I have tried a number of things that don't work. However I just discovered something that seams promising but have yet to test it out. If it works, it's going to require a significant redesign of the code so I'm going to need a lot of coffee ☕

— Reply to this email directly, view it on GitHub https://github.com/joeyhage/homebridge-alexa-smarthome/issues/137#issuecomment-2193910114, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ2FYPC6WWCWZNH5WDPAX7LZJOXIJAVCNFSM6AAAAABJXVZZ46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJTHEYTAMJRGQ. You are receiving this because you commented.

GreatBazunka-eng commented 1 week ago

I am in complete agreement with fmottaz. I am late to the home automation game so I have a hand full of lightbulbs and outlets installed in my house for a few months now. But this plugin has made it all work so well with HomeKit.

I really dont like amazon and Alexa and I would rather stick with HomeKit. Plus I was just getting my family used to using these Wifi lights instead of the switch on the wall. A mutiny would be no good...

joeyhage commented 1 week ago

It's morning where I am so I will be back at it this evening. If you feel inclined, sponsoring a $1 or $2 means a lot. Thanks for the encouraging words, too!

joeyhage commented 1 week ago

Still working on a more permanent solution but mine is working again after doing the following:

  1. Verify this plugin is enabled as a child bridge
  2. Turned off child bridge for 24 hours
  3. Set cacheTTL plugin config (under performance section) to 600.
joeyhage commented 1 week ago

A few more hours of discovery and I have a working path forward. I'm having to rewrite a fair amount of code though so I don't know when it will be ready.

fmottaz commented 1 week ago

Mine was already a child bridge and had been disabled for a few days. I changed the setting as recommended and enabled again. No improvement.Thanks.Le 28 juin 2024 à 03:56, Joey Hage @.***> a écrit : Still working on a more permanent solution but mine is working again after doing the following:

Verify this plugin is enabled as a child bridge Turned off child bridge for 24 hours Set cacheTTL plugin config (under performance section) to 600.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

fmottaz commented 6 days ago

No they are from an italian startup called iotty: https://iotty.it/

They started on kickstarter and I got them real cheap (around 17USD per switch).

I’ve beta tested for them, did some localization on their app too. There was always a HomeKit promise and that’s why I committed because there was nearly nothing else available in Europe at the time (2018) and the esthetics were fine. As we were restructuring a whole house from ground up I needed 40 switches. First mistake is they are wifi based so I immediately found myself with a huge network to manage (90 devices now and counting). I had to upgrade my Wifi infrastructure to get a management console (Unifi) just to get stable connexion and understand which switch was getting randomly disconnected.

To configure the whole thing was a nightmare as I had to name every gang on every switch (120 in total) to be able to recognize them. Needless to say this is nearly impossible on the phone app provided. I needed a strict naming convention to manage the network and something easier in Alexa so that real people could speak to the system. Layers upon layers…

And no Homekit coming. 18 months ago, they told me their 1st gen hardware would not be able to support HK and exchanged all my switches to the new gen 2 hardware. And here we go, rewire the whole house, rename the 120 entries, etc. At that point the whole discussion was around the introduction of Matter and it was clear for me they were going this way. But nothing has happened.

A few months ago I found another plug-in which would bring smartthings into HK. I tried that as my switches also show-up in Smartthings. The guy even set up a server to poll the smartthings state of the switches. It never worked reliably with too long delays until the status would update into the Home App. So you'd click and then click again and again and then get a succession of ON-OFFs.

Then I found your miracle plug-in and could finally integrate reliably my switches into different automations I already had in HomeKit, hoping to ditch Alexa voice commands for privacy reasons and Alexa App for sheer incompetence of UI.

This is the long story.

A pity because there are a handful of solutions on the market now in Europe. Domotic remains very complicated in a project like mine when you need to plan a whole wiring diagram in advance, find electricians who understand something and do not try to sell you solutions like KNX which are overpriced, overkill and user unfriendly in a private house. And finally there is always the acceptance factor…

Thanks for your work.

François

Le 28.06.2024 à 15:51, YoaverageApplefanboy @.***> a écrit :

Tell us how many cups and we will provide… You are the only hope I have left for 40 light switches (a completely renovated old house) installed 4 years ago with the promise of HomeKit compatibility which never arrived. And as they say every time I ask, they cannot announce future products. I have curiosity, what brand of the light switches? You may be able to use a different plug-in for them. I'm assuming they are not Amazon basics ones because Amazon would almost certainly never promise something like that.

— Reply to this email directly, view it on GitHub https://github.com/joeyhage/homebridge-alexa-smarthome/issues/137#issuecomment-2196969315, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ2FYPC4OEA4AOUMDPBB4QLZJVS7LAVCNFSM6AAAAABJXVZZ46VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJWHE3DSMZRGU. You are receiving this because you commented.

GreatBazunka-eng commented 6 days ago

FYI I have just tried leaving the plugin disabled, changing the device state cache to 600, and restarting after waiting 24 hours. The devices are working now, but they are very slow to respond.

GreatBazunka-eng commented 6 days ago

Another update. I have been messing with devices on my network while I work today and it looks like they are responding, but I am getting a ton of errors saying too many requests. If I restart HB then it works fine for a bit and slows down until I restart again.

joeyhage commented 6 days ago

I am working on publishing a pre-release version for testing for anyone willing. Please use this thread to report issues with 2.2.0-alpha.0

GreatBazunka-eng commented 6 days ago

I have updated to the Alpha version and now I am getting errors that say this Plug-in slows down home bridge. The read handler for the characteristic on didn’t respond at all.

joeyhage commented 6 days ago

I have updated to the Alpha version and now I am getting errors that say this Plug-in slows down home bridge. The read handler for the characteristic on didn’t respond at all.

What types of devices? I've only addressed light bulbs, switches, and smart plugs so far. Everything else likely won't work on the Alpha version.

GreatBazunka-eng commented 6 days ago

All I have attached to Alexa are smart bulbs, outlets, and a Google nest thermostat

CrisNevares commented 6 days ago

I have updated to the Alpha version and now I am getting errors that say this Plug-in slows down home bridge. The read handler for the characteristic on didn’t respond at all.

What types of devices? I've only addressed light bulbs, switches, and smart plugs so far. Everything else likely won't work on the Alpha version.

Are dimmers their own thing?

CrisNevares commented 6 days ago

I am working on publishing a pre-release version for testing for anyone willing. Please use this thread to report issues with 2.2.0-alpha.0

Seems to be working for me despite the errors in the logs. Just tested with a dimmable bulb so far.


[29/06/2024, 00:24:35] [homebridge-alexa-smarthome] Restarting child bridge...
[29/06/2024, 00:24:35] Got SIGTERM, shutting down child bridge process...
[29/06/2024, 00:24:40] [homebridge-alexa-smarthome] Child bridge process ended
[29/06/2024, 00:24:40] [homebridge-alexa-smarthome] Process Ended. Code: 143, Signal: null
[29/06/2024, 00:24:47] [homebridge-alexa-smarthome] Restarting Process...
[29/06/2024, 00:24:48] [homebridge-alexa-smarthome] Launched child bridge with PID 3519
[29/06/2024, 00:24:49] Registering platform 'homebridge-alexa-smarthome.HomebridgeAlexaSmartHome'
[29/06/2024, 00:24:49] [homebridge-alexa-smarthome] Loaded homebridge-alexa-smarthome v2.2.0-alpha.0 child bridge successfully
[29/06/2024, 00:24:49] Loaded 7 cached accessories from cachedAccessories.0E6501909956.
[29/06/2024, 00:24:49] [homebridge-alexa-smarthome] Loading accessory from cache: Bedroom Light Strip
[29/06/2024, 00:24:49] [homebridge-alexa-smarthome] Loading accessory from cache: Bathroom Light 2
[29/06/2024, 00:24:49] [homebridge-alexa-smarthome] Loading accessory from cache: Bathroom Light 3
[29/06/2024, 00:24:49] [homebridge-alexa-smarthome] Loading accessory from cache: Backyard Lights
[29/06/2024, 00:24:49] [homebridge-alexa-smarthome] Loading accessory from cache: Living Room Lamp
[29/06/2024, 00:24:49] [homebridge-alexa-smarthome] Loading accessory from cache: Bathroom Light 1
[29/06/2024, 00:24:49] [homebridge-alexa-smarthome] Loading accessory from cache: Porch Light
[29/06/2024, 00:24:50] Homebridge v1.8.3 (HAP v0.12.2) (homebridge-alexa-smarthome) is running on port 42666.
[29/06/2024, 00:24:50] [homebridge-alexa-smarthome] Restored existing accessory from cache: Bathroom Light 3
[29/06/2024, 00:24:50] [homebridge-alexa-smarthome] Restored existing accessory from cache: Living Room Lamp
[29/06/2024, 00:24:50] [homebridge-alexa-smarthome] Restored existing accessory from cache: Bedroom Light Strip
[29/06/2024, 00:24:50] [homebridge-alexa-smarthome] Restored existing accessory from cache: Bathroom Light 2
[29/06/2024, 00:24:50] [homebridge-alexa-smarthome] Restored existing accessory from cache: Porch Light
[29/06/2024, 00:24:50] [homebridge-alexa-smarthome] Restored existing accessory from cache: Backyard Lights
[29/06/2024, 00:24:50] [homebridge-alexa-smarthome] Restored existing accessory from cache: Bathroom Light 1
[29/06/2024, 00:30:59] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:31:00] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:31:09] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:31:27] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:31:30] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:31:32] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:31:33] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:31:33] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:31:35] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:33:10] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:33:11] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
[29/06/2024, 00:33:30] [homebridge-alexa-smarthome] Living Room Lamp - Get brightness - InvalidResponse(State not available)
fmottaz commented 6 days ago

Sorry for the confusion. The GitHub handling of e-mail is a bit of a mess. Tried the Tuya plug-in. Way too slow to update status. Also all switches are three or two gangs but they are recognzied as separate devices and this aspect never caused problem.Le 28 juin 2024 à 23:34, YoaverageApplefanboy @.***> a écrit :

No they are from an italian startup called iotty: https://iotty.it/ They started on kickstarter and I got them real cheap (around 17USD per switch). I’ve beta tested for them, did some localization on their app too. There was always a HomeKit promise and that’s why I committed because there was nearly nothing else available in Europe at the time (2018) and the esthetics were fine. As we were restructuring a whole house from ground up I needed 40 switches. First mistake is they are wifi based so I immediately found myself with a huge network to manage (90 devices now and counting). I had to upgrade my Wifi infrastructure to get a management console (Unifi) just to get stable connexion and understand which switch was getting randomly disconnected. To configure the whole thing was a nightmare as I had to name every gang on every switch (120 in total) to be able to recognize them. Needless to say this is nearly impossible on the phone app provided. I needed a strict naming convention to manage the network and something easier in Alexa so that real people could speak to the system. Layers upon layers… And no Homekit coming. 18 months ago, they told me their 1st gen hardware would not be able to support HK and exchanged all my switches to the new gen 2 hardware. And here we go, rewire the whole house, rename the 120 entries, etc. At that point the whole discussion was around the introduction of Matter and it was clear for me they were going this way. But nothing has happened. A few months ago I found another plug-in which would bring smartthings into HK. I tried that as my switches also show-up in Smartthings. The guy even set up a server to poll the smartthings state of the switches. It never worked reliably with too long delays until the status would update into the Home App. So you'd click and then click again and again and then get a succession of ON-OFFs. Then I found your miracle plug-in and could finally integrate reliably my switches into different automations I already had in HomeKit, hoping to ditch Alexa voice commands for privacy reasons and Alexa App for sheer incompetence of UI. This is the long story. A pity because there are a handful of solutions on the market now in Europe. Domotic remains very complicated in a project like mine when you need to plan a whole wiring diagram in advance, find electricians who understand something and do not try to sell you solutions like KNX which are overpriced, overkill and user unfriendly in a private house. And finally there is always the acceptance factor… Thanks for your work.

damn. First of all, I do want to inform you that I am not the plug-in developer, that would be @joeyhage. Next, I want to inform you that you may be able to integrate these switches into the SmartLife app, in which case the Homebridge Tuya Web plug-in might work for you. I'd try integrating one of your switches that only has a single gang to it first to see if it works.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

fmottaz commented 6 days ago

Enabled the new alpha and seems to be working for me and for now. I have no messages in the log. I only have switches and smartplugs linked to the plug-in.

GreatBazunka-eng commented 5 days ago

Just wanted to let everyone know that I am running the Alpha and I also just removed the plug-in and config and re-added it and everything seems to be working great now!

GreatBazunka-eng commented 5 days ago

Although I did notice that my Google nest thermostat is not coming across to HomeKit yet. I will wait patiently for that one. Thank you for all your help and making this work again.

colinrblake commented 5 days ago

I'm tried upgrading to the Alpha version but after restarting I get this error and Homebridge restarts (over and over):

[6/29/2024, 1:36:28 PM] TypeError: Cannot read properties of null (reading 'primary')
    at /usr/local/lib/node_modules/homebridge-alexa-smarthome/dist/domain/alexa/get-devices.js:43:45
    at /usr/local/lib/node_modules/homebridge-alexa-smarthome/node_modules/fp-ts/lib/Array.js:1267:85
    at Array.map (<anonymous>)
    at /usr/local/lib/node_modules/homebridge-alexa-smarthome/node_modules/fp-ts/lib/Array.js:1267:59
    at pipe (/usr/local/lib/node_modules/homebridge-alexa-smarthome/node_modules/fp-ts/lib/function.js:301:20)
    at /usr/local/lib/node_modules/homebridge-alexa-smarthome/dist/domain/alexa/get-devices.js:35:32
    at /usr/local/lib/node_modules/homebridge-alexa-smarthome/node_modules/fp-ts/lib/Option.js:647:53
    at /usr/local/lib/node_modules/homebridge-alexa-smarthome/node_modules/fp-ts/lib/function.js:218:24
    at /usr/local/lib/node_modules/homebridge-alexa-smarthome/node_modules/fp-ts/lib/internal.js:119:67
    at /usr/local/lib/node_modules/homebridge-alexa-smarthome/node_modules/fp-ts/lib/EitherT.js:99:97
[6/29/2024, 1:36:28 PM] Got SIGTERM, shutting down Homebridge...

Thought the problem was that I hadn't updated node.js in Homebridge for a while. But doing so made no difference.

Had to revert to 2.1.5. Here's my config:

{
    "devices": [
        "Porch Light 1",
        "Porch Light 2",
        "Porch Light 3",
        "Patio Light 1",
        "Patio Light 2",
        "Patio Light 3",
        "Porch Lights Switch",
        "Patio Light Switch"
    ],
    "auth": {
        "refreshInterval": 4,
        "proxy": {
            "clientHost": "colins-mac-mini.local",
            "port": 8987
        }
    },
    "amazonDomain": "amazon.com",
    "language": "en-US",
    "performance": {
        "cacheTTL": 300,
        "backgroundRefresh": true
    },
    "debug": false,
    "platform": "HomebridgeAlexaSmartHome"
}
GreatBazunka-eng commented 5 days ago

Which node version are you on now?

colinrblake commented 5 days ago

Which node version are you on now?

Node.js Version v20.15.0

joeyhage commented 5 days ago

Which node version are you on now?

Node.js Version v20.15.0

Thanks for the report, I'll get that fixed in either the next Alpha or the full release.

colinrblake commented 5 days ago

Which node version are you on now?

Node.js Version v20.15.0

Thanks for the report, I'll get that fixed in either the next Alpha or the full release.

Thanks. Can't wait to have a working plugin again.

colinrblake commented 4 days ago

@joeyhage FYI, I locally fixed the "Cannot read properties of null (reading 'primary')" error, and now the plugin is loading and running without any errors and devices are responding quickly. Thanks so much for your work in fixing this. Looking forward to your official build.

Zfuzz commented 4 days ago

For reason on alpha version im getting a lot of errors and only showing 7 of my 22 devices being found.

colinrblake commented 4 days ago

For reason on alpha version im getting a lot of errors and only showing 7 of my 22 devices being found.

The Alpha version only supports light bulbs, switches, and smart plugs (see above). Is that the "issue"?

kmg091 commented 3 days ago

For reason on alpha version im getting a lot of errors and only showing 7 of my 22 devices being found.

The Alpha version only supports light bulbs, switches, and smart plugs (see above). Is that the "issue"?

I have around 20 lights plugs and switches total, alpha is only locating about 7 of them. Previous before the “too many attempts” error I would find them all. I’m also getting the this device slows down error as well