tabrindle/homebridge-leviton

My leviton dimmer switch stopped working from the home app

hepcat72 opened this issue · 2 comments

I have an automation that turns on a flood light using its homebridge representation when I arrive home. It's been working flawlessly for over a year, but tonight it didn't turn on. The Home app claimed it was on, and I noted that even using the button in the home app (toggling it on & off), it won't change the light's actual power state. The Leviton app itself works.

So I checked the homebridge log and it has the following error:

(node:783) UnhandledPromiseRejectionWarning: FetchError: request to https://my.leviton.com/api/Person/login?include=user failed, reason: getaddrinfo EAI_AGAIN my.leviton.com
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/homebridge-leviton/node_modules/node-fetch/index.js:133:11)
    at ClientRequest.emit (events.js:400:28)
    at TLSSocket.socketErrorListener (_http_client.js:475:9)
    at TLSSocket.emit (events.js:400:28)
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:82:21)
(node:783) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)

What is causing this to happen? How do I fix it?

I just tried a test on the command line, and I didn't get a rejected response, but the home app still isn't effecting actual state changes. I'll look deeper later, like try a homebridge restart or something...

redacted:

$ curl -XPOST --header "Content-Type: application/json" --data-raw '{"email": "xxxxx", "loggedInVia": "myLeviton", "password": "xxxxx", "rememberMe": true}' "https://my.leviton.com/api/Person/login?include=user"
{"id":"xxxxxxxxxxxxxx","ttl":5184000,"created":"2022-10-06T13:39:53.937Z","userId":"xxxxxxxx","user":{"id":"xxxxxxxxxxxxxx","firstName":"xxxxxxxxxxxxxx","lastName":"xxxxxxxxxxxxxx","phone":"xxxxxxxxxxxxxx","isLcsReseller":null,"registeredVia":"myLeviton","loggedInVia":null,"loginAttempts":1,"isWifiBetaUser":null,"isLeapFrogBetaUser":null,"created":"2021-10-23T23:18:29.000Z","lastUpdated":"2022-10-06T13:39:54.000Z","isInternal":false,"realm":null,"username":null,"email":"xxxxxxxxxxxxxx","emailVerified":true}}

It just randomly started working within 24h, so I'm going to chalk this up to a leviton server issue.