Mattes83 / nymea

1 stars 1 forks source link

Python error for send_command #2

Open lukas-kd opened 1 month ago

lukas-kd commented 1 month ago

Hello, i am using this integration and facing the following issue, while updating the entity states:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1302, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nymea/cover.py", line 168, in update value = self._maveoStick.maveoBox.send_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not subscriptable

Could you have a look at this?

Additional information: After a HA restart it works for some time. I also restart the maveo box every second night.

Thanks. :)

tomu1907 commented 1 month ago

I can´t solve your problem, but I have a question regarding the restart of the box. How do you do that? Manually or automatically? I´m still looking for a solution to do that automatically.

lukas-kd commented 1 month ago

I am using a shelly plug s, which will turn off, wait 10 seconds and then turn it back on.

Triggerd by an automation from home assistant.

minhkhoiii1997 commented 1 month ago

Hi, I have a question, I tried to install this integration using HACS and click on Custom Repository and pasted in this link https://github.com/Mattes83/nymea. I got the error saying that "Repository structure for main is not compliant".

I'm still new to Home Assistant so any suggestions would help. Thank you!

Mattes83 commented 4 weeks ago

Hi, I have a question, I tried to install this integration using HACS and click on Custom Repository and pasted in this link https://github.com/Mattes83/nymea. I got the error saying that "Repository structure for main is not compliant".

I'm still new to Home Assistant so any suggestions would help. Thank you!

You need to copy the content of this repo onto the custom_components folder in home assistant. I will have a look at the required repo structure in the near future, this should be easy to adapt.

Mattes83 commented 4 weeks ago

Hello, i am using this integration and facing the following issue, while updating the entity states:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1302, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nymea/cover.py", line 168, in update value = self._maveoStick.maveoBox.send_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not subscriptable

Could you have a look at this?

Additional information: After a HA restart it works for some time. I also restart the maveo box every second night.

Thanks. :)

I guess i need to improve the error handling. It looks like some connection failure. I'll have a look at it.

Just out of curiosity: why do you need to restart it regularly?

minhkhoiii1997 commented 4 weeks ago

Hi @Mattes83, where can I find the custom_components folder in home assistant? Would it be under HACS? Sorry, I'm new to HA, so any suggestions help!

Mattes83 commented 4 weeks ago

Hi, I have a question, I tried to install this integration using HACS and click on Custom Repository and pasted in this link https://github.com/Mattes83/nymea. I got the error saying that "Repository structure for main is not compliant".

I'm still new to Home Assistant so any suggestions would help. Thank you!

Please try it again. I added a hacs.json file to make it work

Mattes83 commented 4 weeks ago

Hello, i am using this integration and facing the following issue, while updating the entity states:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1302, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nymea/cover.py", line 168, in update value = self._maveoStick.maveoBox.send_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not subscriptable

Could you have a look at this?

Additional information: After a HA restart it works for some time. I also restart the maveo box every second night.

Thanks. :)

I just pushed the version I am using at the moment. If it happens with this new version I'd be happy if you provide the new error log, I'll then try to fix it

minhkhoiii1997 commented 4 weeks ago

Hi, I have a question, I tried to install this integration using HACS and click on Custom Repository and pasted in this link https://github.com/Mattes83/nymea. I got the error saying that "Repository structure for main is not compliant". I'm still new to Home Assistant so any suggestions would help. Thank you!

Please try it again. I added a hacs.json file to make it work

Thank you for this! Also, it asks for IP address and Port, I was looking at this post here from Tomu https://community.home-assistant.io/t/maveo-garage-door-integration/278761, he said to enable TCP, but there is no option for me on Maveo app iOS device for some reason. I tried to search for this, but I couldn't find it. My device is BlueFi Stick version 1.11.14

lukas-kd commented 3 weeks ago

Hi, I have a question, I tried to install this integration using HACS and click on Custom Repository and pasted in this link https://github.com/Mattes83/nymea. I got the error saying that "Repository structure for main is not compliant". I'm still new to Home Assistant so any suggestions would help. Thank you!

Please try it again. I added a hacs.json file to make it work

Thank you for this! Also, it asks for IP address and Port, I was looking at this post here from Tomu https://community.home-assistant.io/t/maveo-garage-door-integration/278761, he said to enable TCP, but there is no option for me on Maveo app iOS device for some reason. I tried to search for this, but I couldn't find it. My device is BlueFi Stick version 1.11.14

You dont need to open a tcp port, because it uses the nymea port and not a 3rd party port.

lukas-kd commented 3 weeks ago

Hello, i am using this integration and facing the following issue, while updating the entity states: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 942, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1302, in async_device_update await hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/nymea/cover.py", line 168, in update value = self._maveoStick.maveoBox.send_command( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: 'NoneType' object is not subscriptable Could you have a look at this? Additional information: After a HA restart it works for some time. I also restart the maveo box every second night. Thanks. :)

I guess i need to improve the error handling. It looks like some connection failure. I'll have a look at it.

Just out of curiosity: why do you need to restart it regularly?

Because sometimes one of my two garages loses its connection, with a restart it works as expected for the next 3-5 days. But with this integration it only works like 1 hour or two, but the app works with no problem and shows the symbol for a successfull connection.

So i dont exactly know, whats here the problem. But it looks like it will set any object (maveoStick or maveoBox) to None if a failure occurs. Would be nice to get this integrated with the is_available or something like this, with reconnection maybe? I dont know the code of the integration if anything is there already implemented.

I will install the hacs version (instead of the current copy / paste variant) to get the update notifications. Thanks for that! :)

minhkhoiii1997 commented 2 weeks ago

Hi, I have a question, I tried to install this integration using HACS and click on Custom Repository and pasted in this link https://github.com/Mattes83/nymea. I got the error saying that "Repository structure for main is not compliant". I'm still new to Home Assistant so any suggestions would help. Thank you!

Please try it again. I added a hacs.json file to make it work

Thank you for this! Also, it asks for IP address and Port, I was looking at this post here from Tomu https://community.home-assistant.io/t/maveo-garage-door-integration/278761, he said to enable TCP, but there is no option for me on Maveo app iOS device for some reason. I tried to search for this, but I couldn't find it. My device is BlueFi Stick version 1.11.14

You dont need to open a tcp port, because it uses the nymea port and not a 3rd party port.

Hello,

So what port should I be using? It's a required field and I cannot leave it blank. The default value that you put there is 2223. And when I put in the IP address, it said failed to connect.

Mattes83 commented 2 weeks ago

this is the default port on the maveo box. have you chosen the right ip? you can check on your router. you should also make sure the box always gets the same ip. another way is to check via the nymea app. maveo box is running nymea with some custom addons.

lukas-kd commented 2 weeks ago

Any updates about the error? I am losing the connection within 5 minutes... app works.

Mattes83 commented 5 days ago

I am currently testing a new version which might be a bit more fault tolerant. I'll make a release if it works out for me.

nicolinuxfr commented 13 hours ago

I'm not sure if it's the same error, I see nothing in the Home Assistant log. But when I try to add the stick, I have an instant error, as if it did not even tried to connect :

Capture d’écran 2024-09-12 à 14 12 16

One weird thing I noticed : after each error, the IP adress changes to the one displayed in the screenshot above. It's not the correct one, but it seems the plugin wants to use it every time.

Let me know if I can help you debug all this.

Thanks for your work. 🙂