Open FridrickF opened 9 months ago
Hey there @pjanuario, mind taking a look at this feedback as it has been labeled with an integration (ecoforest
) you are listed as a code owner for? Thanks!
hi @FridrickF The host needs to be something like https://192.168.0.9:8000 (my device runs on port 8000 by default, not sure yours), can you try that way. If you have troubles please enable debug log and post the logs in here, unfortunately there is no API specifications for the different models and we will have to relay on user information in order to make the integration working with other models. Currently it's working with my Cordoba glass and will likely work with other models out of the box, but need to be tested. Let me know if it works, so that I can add the model to the supported devices or help with changes needed to support it.
hi @FridrickF The host needs to be something like https://192.168.0.9:8000 (my device runs on port 8000 by default, not sure yours), can you try that way. If you have troubles please enable debug log and post the logs in here, unfortunately there is no API specifications for the different models and we will have to relay on user information in order to make the integration working with other models. Currently it's working with my Cordoba glass and will likely work with other models out of the box, but need to be tested. Let me know if it works, so that I can add the model to the supported devices or help with changes needed to support it.
Hi @pjanuario , the home page is https://192.168.0.9:8000/index.html so I use the same port, however even entering https://192.168.0.9:8000/ doesn't work. Sorry but I'm a beginner with HA and I don't know how to activate debugging, if you guide me I can try. For information I am using HA via docker.
Maybe I found...
Logger: homeassistant.components.ecoforest.config_flow Source: components/ecoforest/config_flow.py:46 Integration: Ecoforest (documentation, issues) First occurred: 09:21:37 (5 occurrences) Last logged: 10:59:49
Unexpected exception Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 66, in map_httpcore_exceptions yield File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 366, in handle_async_request resp = await self._pool.handle_async_request(req) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 214, in handle_async_request raise UnsupportedProtocol( httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
The above exception was the direct cause of the following exception:
Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/pyecoforest/api.py", line 79, in _request response = await self._client.post( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1848, in post return await self.request( ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1530, in request return await self.send(request, auth=auth, follow_redirects=follow_redirects) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1617, in send response = await self._send_handling_auth( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1645, in _send_handling_auth response = await self._send_handling_redirects( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1682, in _send_handling_redirects response = await self._send_single_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1719, in _send_single_request response = await transport.handle_async_request(request) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 365, in handle_async_request with map_httpcore_exceptions(): File "/usr/local/lib/python3.11/contextlib.py", line 155, in exit self.gen.throw(typ, value, traceback) File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 83, in map_httpcore_exceptions raise mapped_exc(message) from exc httpx.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/ecoforest/config_flow.py", line 46, in async_step_user device = await api.get() ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyecoforest/api.py", line 48, in get "status": await self._status(), ^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyecoforest/api.py", line 111, in _status return await self._request(data={"idOperacion": API_STATUS_OP}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyecoforest/api.py", line 91, in _request if error.response.status_code in ( ^^^^^^^^^^^^^^ AttributeError: 'UnsupportedProtocol' object has no attribute 'response'
Logger: homeassistant.components.ecoforest.config_flow Source: components/ecoforest/config_flow.py:46 Integration: Ecoforest (documentation, issues) First occurred: 10:46:58 (4 occurrences) Last logged: 11:15:10
Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/ecoforest/config_flow.py", line 46, in async_step_user device = await api.get() ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyecoforest/api.py", line 46, in get return Device.build( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyecoforest/models/device.py", line 123, in build model=stats["Me"],
KeyError: 'Me'
From this part of the log:
File "/usr/local/lib/python3.11/site-packages/httpcore/_async/connection_pool.py", line 214, in handle_async_request
raise UnsupportedProtocol(
httpcore.UnsupportedProtocol: Request URL is missing an 'http://' or 'https://' protocol
The above exception was the direct cause of the following exception:
It looks that the host is not set with http/https the host properly, can you try with https://192.168.0.9:8000
instead of https://192.168.0.9:8000/
maybe it's a problem with the backslash in the end.
If doesn't help I will try to create a simple docker image you could run to gather API information, this have been a common problem since we don't have a API documentation from the devices. Once I have some moments I will try to create a example for users to fetch the device information, so that we can debug more easily the support to new devices.
That was also my suspicion and I had already tried but with https://192.168.0.9:8000 or http://192.168.0.9:8000 it still doesn't work.
Logger: homeassistant.components.ecoforest.config_flow Source: components/ecoforest/config_flow.py:46 Integration: Ecoforest (documentation, issues) First occurred: 11:22:12 (2 occurrences) Last logged: 11:37:09
Unexpected exception Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/ecoforest/config_flow.py", line 46, in async_step_user device = await api.get() ^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyecoforest/api.py", line 46, in get return Device.build( ^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/site-packages/pyecoforest/models/device.py", line 123, in build model=stats["Me"],
KeyError: 'Me'
This error is most likely related with the device api being slightly different, once I have some time I will try to post a easy way to grab the information. In meantime if you want to try out, the library used to access the device data is https://github.com/pjanuario/pyecoforest and try to run something like:
example.py
api = EcoforestApi("https://192.168.0.9:8000", new BasicAuth("username", "password")
api.get()
python example.py
Sorry but I don't have the skills to do what you ask me... -.-"
@FridrickF I finally had sometime to create a debug docker image, run it with the following command and post the output in here:
docker run --rm --name pyecoforest-debug -e "HOST=https://192.168.0.9:8000" -e "USERNAME=changeme" -e "PASS=changeme" -e "POWER=1" -e "ON=False" pyecoforest-debug
Change the username, password and host (i believe yours is the one in there) and also make sure that in the logs you remove the credentials from the logs.
This script is using the api to connect to the device and output all the api responses for debug purposes.
@FridrickF I finally had sometime to create a debug docker image, run it with the following command and post the output in here:
docker run --rm --name pyecoforest-debug -e "HOST=https://192.168.0.9:8000" -e "USERNAME=changeme" -e "PASS=changeme" -e "POWER=1" -e "ON=False" pyecoforest-debug
Change the username, password and host (i believe yours is the one in there) and also make sure that in the logs you remove the credentials from the logs.
This script is using the api to connect to the device and output all the api responses for debug purposes.
@pjanuario I apologize for returning after so long but at first I had some personal problems, once they were overcome I had technical problems with Easynet which broke. I tried launching docker (I run docker on a qnap x86-64) but it gives me the following error: exec /usr/local/bin/python: exec format error
I've spent a few days building a PoC based on HA ecoforest integration to communicate with the EcoGeo heat pump. This heat pump has an entirely different API (which looks more like "modbus HTTP API"). The implementation is quick, dirty and requires way more time to make a proper integration out of it. Here it is: https://github.com/bytestorm/ecoforest_ecogeo
Feedback
Hi, I'm very interested in this integration, however I can't log in: I enter the host (192.168.0.9) I enter the username and password but it says unable to connect. I noticed that my username is 11 digits, the one in your example is 13 digits, could that be the problem? Thank you
URL
https://www.home-assistant.io/integrations/ecoforest/
Version
2023.11.3
Additional information
No response