Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No setup function defined error #1

Open
sneakinhysteria opened this issue Jan 14, 2021 · 10 comments
Open

No setup function defined error #1

sneakinhysteria opened this issue Jan 14, 2021 · 10 comments

Comments

@sneakinhysteria
Copy link

After installing the integration in custom_components and adding to the root of my config file (using the IP of my Webcontrol) I get this error:

Invalid config
The following integrations and platforms could not be set up:

warema_wms_webcontrol
Please check your config and logs.

The logs have this error:

Logger: homeassistant.setup
Source: setup.py:138
First occurred: 19:02:38 (1 occurrences)
Last logged: 19:02:38

Setup failed for warema_wms_webcontrol: No setup function defined.

Now I am using WebControl Pro, could this be the issue?

@sneakinhysteria
Copy link
Author

Sorry for the double post, GitHub gave me a 404 so I thought it didn't submit. Duplicate closed.

@cornim
Copy link
Owner

cornim commented Jan 15, 2021

No, it rather looks to me like home assistant can't find the component, because HA complains that it can't find the setup method which should be available automatically as I'm implementing a preconfigured cover entity.
Are you sure you placed the files in the correct folder?

@sneakinhysteria
Copy link
Author

sneakinhysteria commented Jan 16, 2021 via email

@cornim
Copy link
Owner

cornim commented Jan 16, 2021

Hi Holger,

the problem is with your configuration. The implementation I used it based on the cover platform. Hence you must configure it as such. Try the following:

cover:
  - platform: warema_wms_webcontrol
    webcontrol_server_addr: http://192.168.86.35
    update_interval: 300

Best
Cornelius

@sneakinhysteria
Copy link
Author

sneakinhysteria commented Jan 16, 2021 via email

@sneakinhysteria
Copy link
Author

I commented out webcontrol_server_addr but got the same error for update_interval so it seems none of the options are recognised. I also recreated the warema_wms_webcontrol folder from scratch and a fresh download to make sure there is no issue but no luck. Running it without both parameters gets rid of all errors but of course, does not give me a working integration.

@cornim
Copy link
Owner

cornim commented Jan 17, 2021

Both options are optional so in principle the integration could work even without them.
But it is strange nonetheless that HA should complain about invalid options.

Could you run HA with logging on DEBUG? Maybe that will give us a clue.

@sneakinhysteria
Copy link
Author

My Webcontrol Pro hub does not seem to create a DNS entry (despite confirming that Webontrol is the host name) so I can only connect via its IP. So I would need at least the address parameter.

Can you give me a hint on setting up debugging? Not sure I understand enough to know what we need, Supervisor, OS?

Even without parameters, there actually is an error in the logs, but as far as I understand, this is cause by not being able to resolve the standard address:

`Log Details (ERROR)

Logger: homeassistant.components.cover
Source: custom_components/warema_wms_webcontrol/cover.py:25
Integration: Cover (documentation, issues)
First occurred: 15:50:33 (1 occurrences)
Last logged: 15:50:33

Error while setting up warema_wms_webcontrol platform for cover
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/local/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7facdcefa0>: Failed to establish a new connection: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='webcontrol.local', port=80): Max retries exceeded with url: /protocol.xml?protocol=9000020300&
=1610895033 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7facdcefa0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/warema_wms/wms_controller.py", line 39, in _retrieve_setup
room_xml = self.send_rx_room_name_command(room_id)
File "/usr/local/lib/python3.8/site-packages/warema_wms/wms_controller.py", line 84, in send_rx_room_name_command
return self._send_command(RX_ROOM_NAME, format(room_id, '02x'))
File "/usr/local/lib/python3.8/site-packages/warema_wms/wms_controller.py", line 75, in send_command
r = requests.get(urljoin(self.target, ENDPOINT), params=params)
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='webcontrol.local', port=80): Max retries exceeded with url: /protocol.xml?protocol=9000020300&
=1610895033 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7facdcefa0>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/usr/local/lib/python3.8/socket.py", line 918, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1301, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1250, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/http/client.py", line 1010, in _send_output
self.send(msg)
File "/usr/local/lib/python3.8/http/client.py", line 950, in send
self.connect()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 200, in connect
conn = self._new_conn()
File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x7facdfd730>: Failed to establish a new connection: [Errno -2] Name does not resolve

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "/usr/local/lib/python3.8/site-packages/urllib3/util/retry.py", line 573, in increment
raise MaxRetryError(pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='webcontrol.local', port=80): Max retries exceeded with url: /protocol.xml?protocol=900103230000&
=1610895034 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7facdfd730>: Failed to establish a new connection: [Errno -2] Name does not resolve'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 199, in _async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/warema_wms_webcontrol/cover.py", line 25, in setup_platform
shades = Shade.get_all_shades(WmsController(config[CONF_WEBCONTROL_SERVER_ADDR]), time_between_cmds=0.5)
File "/usr/local/lib/python3.8/site-packages/warema_wms/wms_controller.py", line 62, in init
self.rooms = self._retrieve_setup()
File "/usr/local/lib/python3.8/site-packages/warema_wms/wms_controller.py", line 55, in _retrieve_setup
self.send_rx_check_ready()
File "/usr/local/lib/python3.8/site-packages/warema_wms/wms_controller.py", line 105, in send_rx_check_ready
return self._send_command(RX_CHECK_READY, format(room_id, '02x') + format(channel_id, '02x'))
File "/usr/local/lib/python3.8/site-packages/warema_wms/wms_controller.py", line 75, in send_command
r = requests.get(urljoin(self.target, ENDPOINT), params=params)
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 76, in get
return request('get', url, params=params, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='webcontrol.local', port=80): Max retries exceeded with url: /protocol.xml?protocol=900103230000&
=1610895034 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7facdfd730>: Failed to establish a new connection: [Errno -2] Name does not resolve'))`

@cornim
Copy link
Owner

cornim commented Jan 18, 2021

This is interesting as it seems like the integration is loading correctly and tries to connect to the default web control address if no options are given.

Info on logging for HA can be found here https://www.home-assistant.io/integrations/logger/

@oywino
Copy link

oywino commented Jul 18, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants