dave-code-ruiz / uhomeuponor

Custom Component to connect Home Assistant with Uhome Uponor Smatrix App
MIT License
19 stars 7 forks source link

unsuccessful API call - R-208 communication module #21

Closed wivaku closed 4 years ago

wivaku commented 4 years ago

Using uhomeuponor (ec403d7) through HACS.

I have a recent Smatrix setup: X-265 controller (2x), and an R-208 communication module. During HA start up the log shows:

custom_components.uhomeuponor.uponor_api.UponorAPIException: Unsucessful API call

Update: it seems to be related to new R-208 API. I assume the R-208 is not yet supported? https://community.home-assistant.io/t/custom-component-for-connect-home-assistant-with-uponor-smatrix-wave-plus-r167/134457/26

In that case the below info is not relevant any more, but will keep it for reference.

configuration.yml

climate uponor:
  - platform: uhomeuponor
    host: 10.0.0.31
    supports_heating: True

sensor uponor:
  - platform: uhomeuponor
    host: 10.0.0.31

host is available (although not sure how to manually access the API):

# ping 10.0.0.31
PING 10.0.0.31 (10.0.0.31) 56(84) bytes of data.
64 bytes from 10.0.0.31: icmp_seq=1 ttl=64 time=4.10 ms

# curl 10.0.0.31/api
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
  <title>404 - Not Found</title>
 </head>
 <body>
  <h1>404 - Not Found</h1>
 </body>
</html>

Log:

2020-03-29 19:47:30 ERROR (MainThread) [homeassistant.components.climate] Error while setting up uhomeuponor platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/uhomeuponor/climate.py", line 55, in setup_platform
    uponor.rescan()
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 39, in rescan
    self.uhome.update()
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 223, in update
    self.uponor_client.update_devices(self)
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 138, in update_devices
    self.update_values(value_list)
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 161, in update_values
    response_data = self.do_rest_call(req)
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 113, in do_rest_call
    raise UponorAPIException("Unsucessful API call")
custom_components.uhomeuponor.uponor_api.UponorAPIException: Unsucessful API call
2020-03-29 19:47:31 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up uhomeuponor platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/uhomeuponor/sensor.py", line 43, in setup_platform
    uponor.rescan()
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 39, in rescan
    self.uhome.update()
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 223, in update
    self.uponor_client.update_devices(self)
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 138, in update_devices
    self.update_values(value_list)
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 161, in update_values
    response_data = self.do_rest_call(req)
  File "/config/custom_components/uhomeuponor/uponor_api/__init__.py", line 113, in do_rest_call
    raise UponorAPIException("Unsucessful API call")
custom_components.uhomeuponor.uponor_api.UponorAPIException: Unsucessful API call

Tried to access the API directly, based on the example mentioned elsewhere:

curl --header "Content-Type: application/json" \
  --request POST \
  --data '{"jsonrpc":"2.0","id":6358,"method":"readactivealarms","params":{}}' \
  http://10.0.0.31/api

This also gives me a 404 error.

Update: accessing the R-208 API directly works fine:

curl -X POST -H 'x-jnap-action: http://phyn.com/jnap/uponorsky/GetAttributes' -i 'http://10.0.0.31/JNAP/' --data '{}'

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Connection: close
Content-Length: 46206
Date: Sun, 29 Mar 2020 18:32:15 GMT
Server: lighttpd/1.4.42

{
"result": "OK",
"output": {
"vars": [
{
"waspVarName": "cust_New_ControllerSW",
"waspVarValue": "1"
},
{
"waspVarName": "cust_CX_SW_Distributed",
"waspVarValue": "0"
},
{
"waspVarName": "cust_Start_SW_Update",
"waspVarValue": "0"
},
...
dave-code-ruiz commented 4 years ago

Sorry, i have no time in covid time, this component is not supported , even throw i think you know it now

wivaku commented 4 years ago

No worries. It seems this one supports the new R-208 & X-265. https://github.com/asev/homeassistant-uponor