eseglem / hass-wattbox

Home Assistant WattBox Component
MIT License
14 stars 8 forks source link

Error during setup of component wattbox #9

Closed sheyman1 closed 2 years ago

sheyman1 commented 2 years ago

Version of the custom_component

Configuration

wattbox:

Add your logs here.

2022-08-07 11:00:05.712 ERROR (MainThread) [homeassistant.setup] Error during setup of component wattbox File "/config/custom_components/wattbox/init.py", line 94, in async_setup File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 76, in init File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 135, in update

Describe the bug

Wattbox addon not loading at all.

Debug log

2022-08-07 11:05:45.165 INFO (MainThread) [homeassistant.setup] Setting up wattbox 2022-08-07 11:05:45.166 INFO (MainThread) [custom_components.wattbox] wattbox https://github.com/eseglem/hass-wattbox/issues 2022-08-07 11:05:45.593 ERROR (MainThread) [homeassistant.setup] Error during setup of component wattbox File "/config/custom_components/wattbox/init.py", line 94, in async_setup File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 76, in init File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 135, in update

Add your logs here.

Logger: homeassistant.setup Source: custom_components/wattbox/init.py:94 Integration: wattbox (documentation, issues) First occurred: 11:31:33 AM (1 occurrences) Last logged: 11:31:33 AM

Error during setup of component wattbox Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 235, in _async_setup_component result = await task File "/config/custom_components/wattbox/init.py", line 94, in async_setup hass.data[DOMAIN_DATA][name] = await hass.async_add_executor_job( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 76, in init self.update() File "/usr/local/lib/python3.10/site-packages/pywattbox/wattbox.py", line 135, in update self.outlets[i].method = outlet_methods[i - 1] IndexError: list index out of range

eseglem commented 2 years ago

What model wattbox are you connecting to? I only have the WB-700CH-IPV-12 so its the only one I can test against. Everything else is guess work.

If you can go to http://10.10.10.204/wattbox_info.xml in your browser and share that xml with me that would probably be the easiest way for me to solve the issue.

sheyman1 commented 2 years ago

What model wattbox are you connecting to? I only have the WB-700CH-IPV-12 so its the only one I can test against. Everything else is guess work.

If you can go to http://10.10.10.204/wattbox_info.xml in your browser and share that xml with me that would probably be the easiest way for me to solve the issue.

Thank you so much for getting back to me, sorry I just saw your reply. Here is the data you asked for. Thank you very much for you help.

WattBox WB-600-IPVCE-12 2432732367 142.251.46.196,13.107.22.200,151.101.130.114,10.10.10.1,0,0,0,0,0,0 10,40,10,1,-1,-1,-1,-1,-1,-1 0,0,0,0,0,0,0,0,0,0 0 Outlet1,Peplink,Outlet3,Tesla Gateway,Outlet5,Outlet6,Sonos Port living room,Outlet8 1,0,1,1,1,1,1,1 1,1,1,1,1,1,1,1 1,1,0,1 1 1224 2 29 0
sheyman1 commented 2 years ago

Thank you so much for getting back to me, sorry I just saw your reply. Here is the data you asked for. Thank you very much for you help.

wattbox_info.txt

sheyman1 commented 2 years ago

My Wattbox unit looks almost the same as yours but maybe the config is different? Thanks for your help!!!

eseglem commented 2 years ago

Sorry, meant to reply over the weekend but got caught up in other things. I see what the issue is, just need to make some updates. I naively assumed that a model ending in -12 would have 12 programmable plugs, which apparently isn't the case. Yours only has 8 programmable with 4 more that are always on and provide no info in the API. So when it tries to update the 9th plug it breaks. Shouldn't be hard to fix, just need to find the time.

Need to do something different here: https://github.com/eseglem/pywattbox/blob/master/pywattbox/wattbox.py#L68

sheyman1 commented 2 years ago

No problem at all, totally understand. You are correct mine has 4 always on and 8 programmable. So glad you were able to spot the issue. Whenever you get a chance and find the time I really appreciate you helping out with getting this to work!!!

sheyman1 commented 2 years ago

Sorry, meant to reply over the weekend but got caught up in other things. I see what the issue is, just need to make some updates. I naively assumed that a model ending in -12 would have 12 programmable plugs, which apparently isn't the case. Yours only has 8 programmable with 4 more that are always on and provide no info in the API. So when it tries to update the 9th plug it breaks. Shouldn't be hard to fix, just need to find the time.

Need to do something different here: https://github.com/eseglem/pywattbox/blob/master/pywattbox/wattbox.py#L68

Thanks for your help on this when you get time, really appreciate it.

eseglem commented 2 years ago

Sorry for the delay. Fix should be up in v0.8.0, try that out and see how it does.

You can re-open the issue if its still causing problems for you.

sheyman1 commented 2 years ago

Sorry for the delay. Fix should be up in v0.8.0, try that out and see how it does.

You can re-open the issue if its still causing problems for you.

Eseglem: Works perfectly!!! Thank you so much for getting this resolved!!! Love it Scott