andersevenrud / ha-nexa-bridge-x

Home Assistant - Nexa Bridge X Integration
Other
9 stars 3 forks source link

Legacy Nexa Bridge Connectivity Issues #32

Closed passatraggaren closed 6 months ago

passatraggaren commented 10 months ago

I have some issues adding my legacy bridge+. I can add the device and the name of the device shows up but no entites. And the integration fails.

From the debug logging: 2024-01-09 11:02:56.043 DEBUG (MainThread) [custom_components.nexa_bridge_x.nexa] GET http://192.168.0.18/v1/nodes/1013: 200 2024-01-09 11:02:56.146 DEBUG (MainThread) [custom_components.nexa_bridge_x.nexa] GET http://192.168.0.18/v1/nodes/1017: 200 2024-01-09 11:03:18.652 DEBUG (MainThread) [custom_components.nexa_bridge_x.nexa] Finished fetching Nexa Bridge X Coordinator data in 25.010 seconds (success: False)

Would be great to get some assistance :)

/Christoffer

andersevenrud commented 10 months ago

Do you get any more log messages or just the DEBUG ones ?

andersevenrud commented 10 months ago

It just dawned on me that this is probably a timeout. It says "25 seconds" in your log, which is the same as the timeout value set in this integration.

Can you try editing this line inside your HA installation to something like 60?

And restart HA afterwards

https://github.com/andersevenrud/ha-nexa-bridge-x/blob/d718a7e711ad62ea144879f43c54924b0d0dcf42/custom_components/nexa_bridge_x/const.py#L27

It would also be nice to see the timing in the Finished fetching Nexa Bridge X Coordinator data messages afterwards to get a sense of how long it takes on your setup, because I think maybe this timeout should be increased.

passatraggaren commented 10 months ago

I modified the timeout to 60 and got the same error, increased it to 300 and still got the same error.

24-01-15 15:58:48.808 DEBUG (MainThread) [custom_components.nexa_bridge_x.nexa] GET http://192.168.0.18/v1/nodes/1048: 200 2024-01-15 16:03:47.364 DEBUG (MainThread) [custom_components.nexa_bridge_x.nexa] Finished fetching Nexa Bridge X Coordinator data in 300.011 seconds (success: False)

andersevenrud commented 10 months ago

That's a shame. In #15 I ran to into something similar for another user, which is why I already increased this timeout value once.

Sadly, I don't own a legacy bridge, so I don't really know where to go from here. Do you know how to work with tools like Postman to perform API requests ?

passatraggaren commented 10 months ago

Never used Postman but i've installed it and managed to make a couple of api calls to my Nexa. Do you want me to try something with Postman?

andersevenrud commented 10 months ago

What you could try is to do a GET request to http://192.168.0.18/v1/nodes and then the same for http://192.168.0.18/v1/nodes/<id> for the ones that show up and use the associated ids.

Do you want me to try something with Postman?

If you've already got something then just stick with that. The most interesting part here would be how long it takes for the requests of all of this. Maybe there is a buggy device here or something.

andersevenrud commented 8 months ago

Did you get a chance to check this out ?

passatraggaren commented 8 months ago

No not yet, I started with the integration of my solarpanels and heating system instead. I might give the old Nexa one more try later on, I'll let you know! Thanks!

sonite commented 8 months ago

GET via postman: http://192.168.1.2/v1/nodes/1082 { "code": 401, "description": "The request requires user authentication", "homeRef": "/", "reasonPhrase": "Unauthorized", "uri": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2" }

andersevenrud commented 8 months ago

@sonite API calls requires Digest Authentication with the username nexa and password nexa.