Haverland Radiators Smart Box Integration

I changed the password to a wrong one and it gave me Error 401

Logger: homeassistant.setup
Source: setup.py:332
First occurred: 14:04:10 (1 occurrences)
Last logged: 14:04:10

Error during setup of component smartbox
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 332, in _async_setup_component
    result = await task
             ^^^^^^^^^^
  File "/config/custom_components/smartbox/__init__.py", line 94, in async_setup
    devices = await get_devices(
              ^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/smartbox/model.py", line 274, in get_devices
    session = await hass.async_add_executor_job(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/smartbox/session.py", line 43, in __init__
    self._auth(
  File "/usr/local/lib/python3.11/site-packages/smartbox/session.py", line 58, in _auth
    response.raise_for_status()
  File "/usr/local/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api-hjm.helki.com/client/token

What release of the code are you using?

The latest one (v2.0.0-beta.2) . I got it via HACS directly

Maybe try a different version to see if the issue persists.

Thank you for the help. Iā€™ll try all of the older version, and see if any of them works.

By the way in the newest version of homeassistant some of stuff has been deprecated. ( I also get those logs)

I tried every version. And I always get the same error :confused:

@franciscohorta it looks like the code is getting part way through enumerating the nodes in your installation and then failing. Probably the best way to debug this is to see if you can inspect your heaters using the smartbox command line tools. See the docs on GitHub - graham33/smartbox: Python API to control heating 'smart boxes'.

If you can try that and post your results, it might illuminate the problem.

I do have the module working with python 3.11 Iā€™m my installation, but Iā€™m not everything is released. Iā€™ll try to take a look this weekend. The problem is one of the dependencies doesnā€™t support 3.11 and Iā€™ve had to fork it.

With the command line utility it lists all the nodes when I do ā€œsmartbox auth optionsā€¦ nodesā€, but when I try to recover the status of the nodes with ā€œsmartbox auth optionsā€¦ statusā€ it shows me the status of the accumulators but when it reaches the meter and rationalizer that I have in the electrical panel it gives me the following error:

Measurer A (addr: 4)
Traceback (most recent call last):
  File "/usr/bin/smartbox", line 8, in <module>
    sys.exit(smartbox())
             ^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1719, in invoke
    rv.append(sub_ctx.command.invoke(sub_ctx))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/smartbox/cmd.py", line 71, in status
    status = session.get_status(device["dev_id"], node)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/smartbox/session.py", line 153, in get_status
    return self._api_request(
           ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/smartbox/session.py", line 107, in _api_request
    response.raise_for_status()
  File "/usr/lib/python3.11/site-packages/requests/models.py", line 1021, 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/XXXXXXXXXXXXXXXX/pmo/4/status

It looks like you might have some new node types that will need to be supported in the code. Unfortunately I donā€™t have a lot of time to work on the project right now, any volunteers welcome of course.

Hi everyone,

As you probably have noticed, I havenā€™t been able to devote much time recently to smartbox + hass-smartbox. Thatā€™s probably going to be the case for some time, and due to some house redesign itā€™s also likely I wonā€™t have compatible devices to test with in the future.

Hence I think now is probably the time to see if anyone else would like to get involved in maintaining these projects? The code is fairly mature, I think one would only require fairly rudimentary Python skills to make useful contributions. If youā€™re interested, please reach out to me.

To be clear, Iā€™m not shutting down the project imminently or stepping away immediately, I just want to get something in place early to ensure continuity.

Thanks for all your work on this project. It has been great having control over my heating using automations. It has probably saved me some money too in the long run.

I donā€™t have any programming skills but I can assist where possible. I hope someone can work with you in taking this project over.

Thanks again.

Update on this issue, similar as per shish experience, after switching from Technoterm to LHZ app (the other way around!) everything magically started to work.
It seems to me that some controllers like Technoterm and some LHZ.
Besides, for me same happens with Google Assistsant, does not work with Technotherm and does with LHZ.
Thank you for this great integration!

Hi Graham,

Have you removed your so useful smartbox integration from GitHub ?

Hi everyone,
Iā€™ve been throught this thread looking on how to get HJM heaters to work on home assistant but cannot figure it out. Could someone point me in the right direction? any help would be greatly appreciated?
tried to find

i did find this repo on git : jandado Ā· GitHub

but canā€™t get it working
Where do you get the basic key?
thanks

1 Like

Hi can you share how you obtained the basic token iā€™ve done as said in the screenshot but i canā€™t find the file called token

hi @gr_h_m ,

Can you help on how to get the basic auth code iā€™ve check inside my panel and network but donā€™t have token file anywhere as far as i can see?

thanks in advance

jandadoā€™s repo is ancient and doesnā€™t work.

@gr_h_m (Graham) has removed (or made private) his repo on github with both the smartbox code and the hass integration. It would be good if there is a reason beyond a lack of time for the project.

There is currently no (public) fork of the project.

I have a working version installed on my own HA.

I can zip it if anyone wants to improve it.

Hi Alberto, a question about Smartbox, I had Smartbox running, in version 1.0.0 without problems, until due to a version change of HA it stopped working.
I think due to a problem with the Python version, giving several mistakes.
Do you know what is the problem?.