Haverland Radiators Smart Box Integration

Hello, any help with this error?

Registrador: homeassistant.setup
Fuente: setup.py:416

Error during setup of component smartbox
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/smartbox/__init__.py", line 95, in async_setup
    devices = await get_devices(
              ^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartbox/model.py", line 288, in get_devices
    await create_smartbox_device(
  File "/config/custom_components/smartbox/model.py", line 313, in create_smartbox_device
    await device.initialise_nodes(hass)
  File "/config/custom_components/smartbox/model.py", line 63, in initialise_nodes
    status = await hass.async_add_executor_job(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/smartbox/session.py", line 154, in get_status
    return self._api_request(
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/smartbox/session.py", line 108, in _api_request
    response.raise_for_status()
  File "/usr/local/lib/python3.12/site-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://api-elnur.helki.com/api/v2/devs/5bfcabd3d8808xxxxx/pmo/9/status

All the credentials and token are correct, if put wrong password (for check) system mark other error

My config yaml are this:

smartbox:
  accounts:
  - api_name: api-elnur
    username: [email protected]
    password: "f88xxxxxb"
    session_retry_attempts: 20 # how many times to retry session REST operations
    session_backoff_factor: 1.0 # how much to backoff between REST retries
    socket_reconnect_attempts: 20 # how many times to try reconnecting the socket.io socket
    socket_backoff_factor: 1.0 # how much to backoff between initial socket connect attempts
    device_ids:
    - 5bfcabd3d880xxxxx
  basic_auth_creds: "NTRiY2NiZmI0MWE5YTUxMTNmMDQ4OGxxxxxxxxxxx*"

Im try write the password and basic auth credentials with slashes, without, wit simbol ==


Im not understand with not works.

Thanks in advance.

Hallo Lieber “patrickbusch”

Ich habe gesehen in der community das du die Heizung zu HASS hinzufĂŒgen konntest.
WÀre es möglich das du die schritte angeben könntest wie du es geschaft hast.
Welche “Integration”, oder “add-ons”, und wie ich die WiFi Radiatoren hinzufĂŒgen kann. Ich nutze derzeit die App auf Android “Climastar”, aber möchte natĂŒrlich die Radiatoren in der HASS APP HinzufĂŒgen :grin:
Vielen Dank shcon im voraus und liebe grĂŒsse.


Hello dear “patrickbusch” I have seen in the community that you were able to add the heater to HASS.
Would it be possible that you could give the steps how you did it.
Which “integration”, or “add-ons”, and how I can add the WiFi radiators. I currently use the app on Android “Climastar”, but of course I would like to add the radiators in the HASS APP :grin:
Thank you in advance and best regards

Hi,

I’m using the ‘smartbox’ integration via HACS.

configuration.yaml reads as

smartbox:
  accounts:
  - api_name: api
    username: [email protected]
    password: !secret smartbox_password
    session_retry_attempts: 32 # how many times to retry session REST operations
    device_ids:
    - 7b007a81517f0exxxxx
  basic_auth_creds: !secret smartbox_basic_auth

Need to get the password and basic auth, but I don’t remember how I got that. Maybe look for the smartbox github.

Best of luck!

Hello, “password” as the same as use in ur app.
For obtain “basic_auth_creds” check this post:

Haverland Radiators Smart Box Integration - #173 by lmorales?

Hi all
I’m getting the following error in my logs. Any help gratefully received.

Error during setup of component smartbox
Traceback (most recent call last):
File “/usr/local/lib/python3.12/site-packages/urllib3/connection.py”, line 174, in _new_conn
conn = connection.create_connection(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/site-packages/urllib3/util/connection.py”, line 72, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/local/lib/python3.12/socket.py”, line 964, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
socket.gaierror: [Errno -2] Name does not resolve

This might be a stupid question but I’ll ask it anyway.

Which protocol do the SmartBoxes use to communicate with the server? Would it be possible to spoof the server with a locally hosted service to remove the need for the remote server at all?

Joe

Hi,

i’m not sure whats the problem with my config. I can get the info in the command line executing:


smartbox -a api-hjm  -u [email protected] -p XXXXXXX -b 'NTRiY2XXXXXXXXXXXXXXXXXXXXXXZkaQ==' -v nodes

but configured in HA, I’ve always get the same error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 897, in urlopen
    return self.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 897, in urlopen
    return self.urlopen(
           ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 897, in urlopen
    return self.urlopen(
           ^^^^^^^^^^^^^
  [Previous line repeated 5 more times]
  File "/usr/local/lib/python3.12/site-packages/urllib3/connectionpool.py", line 887, in urlopen
    retries = retries.increment(method, url, response=response, _pool=self)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/urllib3/util/retry.py", line 594, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api-hjm.helki.com', port=443): Max retries exceeded with url: /client/token (Caused by ResponseError('too many 500 error responses'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 416, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/smartbox/__init__.py", line 95, in async_setup
    devices = await get_devices(
              ^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartbox/model.py", line 276, in get_devices
    session = await hass.async_add_executor_job(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/smartbox/session.py", line 43, in __init__
    self._auth(
  File "/usr/local/lib/python3.12/site-packages/smartbox/session.py", line 55, in _auth
    response = self._requests.post(
               ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 637, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/requests/adapters.py", line 691, in send
    raise RetryError(e, request=request)
requests.exceptions.RetryError: HTTPSConnectionPool(host='api-hjm.helki.com', port=443): Max retries exceeded with url: /client/token (Caused by ResponseError('too many 500 error responses'))

This is my configuration in HA.

smartbox:
  accounts:
  - api_name: api-hjm
    username: [email protected]
    password: XXXXXXX
    device_ids:
    - XXXXXXXXXXXX
  basic_auth_creds: NTRiY2XXXXXXXXXXXXXXXXXXXXXXZkaQ==

Whats wrong in my config?

thanks and regards

It looks like an authentication issue that is continuously retrying. Does the password contain and special characters and is it wrapped in quotes?

Thanks for your answer. No, the password has only letters and numbers. And the strange thing is that executing smartbox in a shell inside the docker HA container works perfect.

/config # smartbox -a api-hjm  -u XXXXXX @gmail.com -p XXXXXXX -b NTRiXXXXXXXXXXXXXXXXXXXXXXXXXXXXaQ== -v status
2024-10-22 15:27:27 DEBUG    [urllib3.connectionpool._new_conn:1022] Starting new HTTPS connection (1): api-hjm.helki.com:443
2024-10-22 15:27:28 DEBUG    [urllib3.connectionpool._make_request:475] https://api-hjm.helki.com:443 "POST /client/token HTTP/1.1" 200 742
2024-10-22 15:27:28 DEBUG    [smartbox.session._auth:78] Authenticated session (password), access_token=eXXXXXXXXXXXXX, expires at 2024-10-22 19:27:28.614856
2024-10-22 15:27:28 DEBUG    [urllib3.connectionpool._make_request:475] https://api-hjm.helki.com:443 "GET /api/v2/devs HTTP/1.1" 200 345
Irene (dev_id: XXXXXXXXXXXXXXXXXXX)
2024-10-22 15:27:28 DEBUG    [urllib3.connectionpool._make_request:475] https://api-hjm.helki.com:443 "GET /api/v2/devs/XXXXXXXXXXXXXXXXXXX/mgr/nodes HTTP/1.1" 200 75
 (addr: 2)
2024-10-22 15:27:28 DEBUG    [urllib3.connectionpool._make_request:475] https://api-hjm.helki.com:443 "GET /api/v2/devs/XXXXXXXXXXXXXXXXXXX/htr/2/status HTTP/1.1" 200 366
{
    "act_duty": 0,
    "active": false,
    "boost": false,
    "boost_end_day": 0,
    "boost_end_min": 60,
    "comf_temp": "21.0",
    "duty": 0,
    "eco_temp": "18.0",
    "error_code": "0000",
    "ice_temp": "7.0",
    "locked": 0,
    "mode": "off",
    "mtemp": "16.8",
    "pcb_temp": "22",
    "power": "781.9",
    "power_pcb_temp": "22",
    "presence": false,
    "stemp": "5.0",
    "sync_status": "ok",
    "true_radiant_active": false,
    "units": "C",
    "window_open": false
}
Ivan (dev_id: XXXXXXXXXXXXXXXXXXX)
2024-10-22 15:27:29 DEBUG    [urllib3.connectionpool._make_request:475] https://api-hjm.helki.com:443 "GET /api/v2/devs/XXXXXXXXXXXXXXXXXXX/mgr/nodes HTTP/1.1" 200 75
 (addr: 2)
2024-10-22 15:27:29 DEBUG    [urllib3.connectionpool._make_request:475] https://api-hjm.helki.com:443 "GET /api/v2/devs/XXXXXXXXXXXXXXXXXXX/htr/2/status HTTP/1.1" 200 368
{
    "act_duty": 0,
    "active": false,
    "boost": false,
    "boost_end_day": 0,
    "boost_end_min": 60,
    "comf_temp": "21.0",
    "duty": 0,
    "eco_temp": "18.0",
    "error_code": "0000",
    "ice_temp": "7.0",
    "locked": 0,
    "mode": "off",
    "mtemp": "16.8",
    "pcb_temp": "25",
    "power": "1089.0",
    "power_pcb_temp": "23",
    "presence": false,
    "stemp": "18.0",
    "sync_status": "ok",
    "true_radiant_active": false,
    "units": "C",
    "window_open": false
}
Matrimonio (dev_id: XXXXXXXXXXXXXXXXXXX)
2024-10-22 15:27:29 DEBUG    [urllib3.connectionpool._make_request:475] https://api-hjm.helki.com:443 "GET /api/v2/devs/XXXXXXXXXXXXXXXXXXX/mgr/nodes HTTP/1.1" 200 75
 (addr: 2)
2024-10-22 15:27:29 DEBUG    [urllib3.connectionpool._make_request:475] https://api-hjm.helki.com:443 "GET /api/v2/devs/XXXXXXXXXXXXXXXXXXX/htr/2/status HTTP/1.1" 200 368
{
    "act_duty": 0,
    "active": false,
    "boost": false,
    "boost_end_day": 0,
    "boost_end_min": 60,
    "comf_temp": "21.0",
    "duty": 0,
    "eco_temp": "18.0",
    "error_code": "0000",
    "ice_temp": "7.0",
    "locked": 0,
    "mode": "off",
    "mtemp": "17.1",
    "pcb_temp": "24",
    "power": "1054.8",
    "power_pcb_temp": "23",
    "presence": false,
    "stemp": "18.0",
    "sync_status": "ok",
    "true_radiant_active": false,
    "units": "C",
    "window_open": false
}
/config #

Do you have multiple users setup under the same account?

No, I only have one user in the account.

Hi,

I have spent lot of time, and finally the problem was that i don’t know the reason but i had a different basic_auth_creds in the configuration.yaml; thats the reason why smartbox in a terminal worked ok, but I got the Max retries exceeded in home assistant,

thanks and regards