dre2901 / node-red-contrib-myq

Node-Red node to control MyQ (Chamberlain) devices
5 stars 3 forks source link

Getting error with v0.6 #6

Closed k5map closed 10 months ago

k5map commented 2 years ago

First of all, thanks for releasing a update to your node.

When I use the new version and provide my credentials and serial number, I get multiple errors:

"Error received:" "TypeError: Cannot read property 'state' of undefined" "Error code: undefined" "Error message: Cannot read property 'state' of undefined" "TypeError: Cannot read property 'state' of undefined"

Any ideas on how to resolve these errors?

dre2901 commented 2 years ago

Hmm.. Of course, I have tested it only with garage door opener as I don't have any other devices. I presume, you have something else. Can you see the logs of node-red? They should include the response you are getting for your device. I have included debug logging at multiple places so it could help to troubleshoot. You can see debug logging if you start node-red manually in console, for example. Or, if it's on Linux (PI) then you can execute node-red-log command to see it. Also, there was one small change in new version - the node returns info object directly in payload. There is no additional 'device' property anymore. So if your flow were relying on it then you need to adjust

rpakdel commented 2 years ago

I had the same issue today trying to setup a LiftMaster wifi garage door opener. Through trial and error I found a solution:

myQ API: Successfully connected to the myQ API.
myQ API: Discovered device family garagedoor: Garage Door [Liftmaster Commercial WiFi Wall Mount Operator] (serial number: CGxxxxxxxxxx, gateway: GWyyyyyyyyyy).
myQ API: Discovered device family gateway: Garage Door [Chamberlain WiFi GDO DC 1.25 HP] (serial number: GWyyyyyyyyyy).
myQ API: Discovered device family camera: Garage Door Camera (serial number: TC-zzzz-zzzzzzz).

I used the CGxxxxxxxxxx serial number shown in the log and I was able to connect to the device via node-red and interact with it.

Notice that there is both a gateway and a device and the serial numbers shown in the app and on the device are actually of the gateway. Looks like myQ API requires the actual device serial number rather than the gateway.

Update: I just noticed I get the TypeError while the garage door is opening and closing.

k5map commented 2 years ago

@rpakdel thanks for the info... I've successfully been able to use the node to get info from MyQ devices (garage opener and gate). The only issue I'm having now is when either are in the position of opening or closing, I get errors from the MyQ node. Have you been able to get the opening or closing status from the node?

rpakdel commented 2 years ago

@k5map, I did not pursue the issue with getting events when the door is opening and closing. The myQ app shows the states correctly. Perhaps they have some logic to make it look like it is opening and closing. I was thinking of writing some function to check the previous state of the door and fake the opening/closing events but honestly I couldn’t be bothered. :)

k5map commented 2 years ago

@rpakdel ... agreed, its not a show stopper for me... just hoping someone figured it out :)

dre2901 commented 10 months ago

Original errors (Cannon read property 'state' of undefined etc) were fixed in 0.0.10