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

Initial support for modbus is failing #50

Closed
elupus opened this issue Oct 19, 2022 · 61 comments
Closed

Initial support for modbus is failing #50

elupus opened this issue Oct 19, 2022 · 61 comments

Comments

@elupus
Copy link
Collaborator

elupus commented Oct 19, 2022

Initial support for modbus is failing

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

@cybermaus can you attach home assistant logs, so we can see the error.

@dkmh
Copy link

dkmh commented Oct 19, 2022

Same error for me (S1255).

This error originated from a custom integration.

Logger: custom_components.nibe_heatpump
Source: custom_components/nibe_heatpump/config_flow.py:144
Integration: Nibe Heat Pump
First occurred: 1:54:22 PM (7 occurrences)
Last logged: 2:02:41 PM

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/nibe_heatpump/config_flow.py", line 188, in async_step_modbus
    title, data = await validate_modbus_input(self.hass, user_input)
  File "/config/custom_components/nibe_heatpump/config_flow.py", line 144, in validate_modbus_input
    coil = await connection.read_coil(coil)
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py", line 69, in read_coil
    result = await self._client.read_holding_registers(
  File "/usr/local/lib/python3.10/site-packages/async_modbus/core.py", line 181, in read_holding_registers
    return await self._send_message(request)
  File "/usr/local/lib/python3.10/site-packages/async_modbus/core.py", line 142, in _send_message
    return await self.protocol._async_send_message(
  File "/usr/local/lib/python3.10/site-packages/async_modbus/core.py", line 43, in send_message_tcp
    tcp.raise_for_exception_adu(response_error_adu)
  File "/usr/local/lib/python3.10/site-packages/umodbus/client/tcp.py", line 247, in raise_for_exception_adu
    pdu_to_function_code_or_raise_error(resp_pdu)
  File "/usr/local/lib/python3.10/site-packages/umodbus/functions.py", line 118, in pdu_to_function_code_or_raise_error
    raise error_code_to_exception_map[error_code]
umodbus.exceptions.IllegalFunctionError: Function code is not an allowable action for the server.

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

That was a bit unexpected. Did any of you use standard modbus integration from ha against these pumps? Mainly to get some clues.

@cybermaus
Copy link

Yes. I did stop it, (directed it to another IP) and restarted HA, and then tried again. Same result.

@cybermaus
Copy link

@dkmh where do you find those. All I get is below, not very interesting.

Full logs
2022-10-19 14:30:03.690 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration nibe_heatpump which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-10-19 14:30:03.696 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration solaredge_modbus which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-10-19 14:30:03.699 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2022-10-19 14:30:29.132 WARNING (Recorder) [homeassistant.components.sensor.recorder] The unit of sensor.total_consumption (kW) can not be converted to the unit of previously compiled statistics (kWh). Generation of long term statistics will be suppressed unless the unit changes back to kWh or a compatible unit. Go to https://my.home-assistant.io/redirect/developer_statistics to fix this

@cybermaus
Copy link

Never mind, log had wrapped, had to redo the error:
(same as already found)

2022-10-19 15:12:23.079 ERROR (MainThread) [custom_components.nibe_heatpump] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/nibe_heatpump/config_flow.py", line 188, in async_step_modbus
    title, data = await validate_modbus_input(self.hass, user_input)
  File "/config/custom_components/nibe_heatpump/config_flow.py", line 144, in validate_modbus_input
    coil = await connection.read_coil(coil)
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py", line 69, in read_coil
    result = await self._client.read_holding_registers(
  File "/usr/local/lib/python3.10/site-packages/async_modbus/core.py", line 181, in read_holding_registers
    return await self._send_message(request)
  File "/usr/local/lib/python3.10/site-packages/async_modbus/core.py", line 142, in _send_message
    return await self.protocol._async_send_message(
  File "/usr/local/lib/python3.10/site-packages/async_modbus/core.py", line 43, in send_message_tcp
    tcp.raise_for_exception_adu(response_error_adu)
  File "/usr/local/lib/python3.10/site-packages/umodbus/client/tcp.py", line 247, in raise_for_exception_adu
    pdu_to_function_code_or_raise_error(resp_pdu)
  File "/usr/local/lib/python3.10/site-packages/umodbus/functions.py", line 118, in pdu_to_function_code_or_raise_error
    raise error_code_to_exception_map[error_code]
umodbus.exceptions.IllegalFunctionError: Function code is not an allowable action for the server.
➜  config

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

@cybermaus can you read the holding register 22 using standard modbus code?

Edit: meant: 21

@cybermaus
Copy link

Maybe not, I tried to read it as an input register, and now HA is not restarting.

In the mean time, I also did a tcpdump of the moment when I pressed submit on the plugin, and got this wireshark view. One modbus send, and one modbus reply:

image
image

wireshark.zip

@cybermaus
Copy link

Oh wait, it did restart, just took a bit longer for some reason. But I am not reading it correctly appearantly:

image
image

@cybermaus
Copy link

21 is not in my register list. Howmany bytes? What name?

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

22 is likely right. There are some offset to this number that i dont know if its added in the csv export.

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

Ps. Input type in hour example is wrong. Should be holding.

@cybermaus
Copy link

tried holding as well, accepted by the startup parser, still unavailable answer.

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

Can you check wireshark there too? Hopefully identical.

@cybermaus
Copy link

Yes, it appears all input registers go well, the one holding register fails:

(so, me being a MODBUS noob, what is a holding register?)

image
image

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

Register that can both be read and written. You can test some other of the holding registers and see if you get data (look in csv file).

It could be that its just rejecting this one, with wrong error code.

@cybermaus
Copy link

Well, I am trying More hot water MODBUS_HOLDING_REGISTER 697 1 1 0 0 0 and it gives the same.

To be fair: Out of all the (input) registers I am trying to read in the past few weeks, most of them fail. I come to the acceptance that only a few (lucky the most important) registers work. I assumed the register list is some sort of a "hint" which registers might be available, but not a definite list.

Therefore, while I did not think much about it till now, I would have assumed you wanted a full register list so you can try them all, and forget if they do not work. Ignore any read error, and move on to the next.
But now I understand you feel you should be able to read them all. Is this how it works on the non-TCP modbus, they should all exists?

Of course, my other though was, maybe they should all work, just the generic modbus integration of HA is not capable enough? So I am not sure. I was hoping you would read more of them, but to be honest, I was also hoping most would be automatically disabled or hidden in the integration, because I sure do not need to keep history on all of those potential registers. Especially not the ones named "id:" or "-"

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

All will be hidden by default. I wonder if there is some readonly setting in the pump.

@cybermaus
Copy link

But such a readonly setting would not explain the many input registers that I also cannot read.

@cybermaus
Copy link

cybermaus commented Oct 19, 2022

All hidden by default is still a very big set of data that we are recording. most could/would/maybe even should be disabled, to save the recorder space.

nevermind, its a discussion for later, lets first figure out why it is not working

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

Not being recorded, i meant disabled.

@dkmh
Copy link

dkmh commented Oct 19, 2022

Did some debugging and it seems to be that the problem is an off by one error (0 or 1 based addresses) on the addresses caused by:
entity_address = (coil.address % 10000) - 1
in
def split_modbus_data(coil: Coil):
So 40022 is translated to 21 which does not work.
--> removed the "-1" (or it has to be changed in the json register description.)

Another problem was that setting of alarm value
coil.value = "OFF"
failed in the validation due to non existent string->int mapping for that register. --> removed it

Hacky solution but it seems to work at a first glance:
image

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

Nice!! Then i will fix those offsets and add mapping for that register.

@cybermaus
Copy link

which file is that, I am grepping and not finding it anywhere.

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

I've now updated the pull request, so you can regrab it @cybermaus

@dkmh
Copy link

dkmh commented Oct 19, 2022

config validation still fails for me:
1: coil = heatpump.get_coil_by_name("reset-alarm-40022") <--- has to be changed now to 40023
2: write_coil seems to fail (im not sure what the value code is for)

After changing that i fall into this error (was already a problem in last version, but forgot to mention it):
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 365, in async_setup result = await component.async_setup_entry(hass, self) File "/config/custom_components/nibe_heatpump/__init__.py", line 63, in async_setup_entry heatpump.word_swap = entry.data[CONF_WORD_SWAP] KeyError: 'word_swap'
But after removing that sensor values seem to work (just checked a few)

@dkmh
Copy link

dkmh commented Oct 19, 2022

On changing parameters I get this error:
`Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/nibe_heatpump/init.py:224
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:06:09 AM (3 occurrences)
Last logged: 12:07:07 AM

[1657699968] The value contained in the request data field is not an allowable value for the server.
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/umodbus/functions.py", line 1515, in values
struct.pack(">" + conf.MULTI_BIT_VALUE_FORMAT_CHARACTER, value)
struct.error: required argument is not an integer

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 202, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1738, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1775, in _execute_service
await cast(Callable[[ServiceCall], Awaitable[None]], handler.job.target)(
File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 207, in handle_service
await service.entity_service_call(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 678, in entity_service_call
future.result() # pop exception if have
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 931, in async_request_call
await coro
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 715, in _handle_entity_call
await result
File "/usr/src/homeassistant/homeassistant/components/number/init.py", line 109, in async_set_value
await entity.async_set_native_value(native_value)
File "/config/custom_components/nibe_heatpump/number.py", line 68, in async_set_native_value
await self._async_write_coil(value)
File "/config/custom_components/nibe_heatpump/init.py", line 304, in _async_write_coil
await self.coordinator.async_write_coil(self._coil, value)
File "/config/custom_components/nibe_heatpump/init.py", line 224, in async_write_coil
coil = await self.connection.write_coil(coil)
File "/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py", line 110, in write_coil
result = await self._client.write_registers(
File "/usr/local/lib/python3.10/site-packages/async_modbus/core.py", line 233, in write_registers
request = self.protocol.write_multiple_registers(
File "/usr/local/lib/python3.10/site-packages/umodbus/client/tcp.py", line 221, in write_multiple_registers
function.values = values
File "/usr/local/lib/python3.10/site-packages/umodbus/functions.py", line 1517, in values
raise IllegalDataValueError
umodbus.exceptions.IllegalDataValueError: The value contained in the request data field is not an allowable value
for the server.`

@elupus
Copy link
Collaborator Author

elupus commented Oct 19, 2022

@dkmh Thanks. Yea we seem to have an encoding issue for writes. Will have to figure out a solution for it.

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

Different issue. If you change your manifest file where it says nibe==1.1.0 to nibe==1.1.1 and try again.

@yozik04
Copy link
Owner

yozik04 commented Oct 20, 2022

He might need to bump version in manifest as well.

@cybermaus
Copy link

Sorry guys, I have a real customer with an urgent issue. It may be a while.

@cybermaus
Copy link

cybermaus commented Oct 20, 2022

Latest log:

MARKER
2022-10-20 15:19:10.494 ERROR (MainThread) [custom_components.nibe_heatpump] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/nibe_heatpump/config_flow.py", line 191, in async_step_modbus
    title, data = await validate_modbus_input(self.hass, user_input)
  File "/config/custom_components/nibe_heatpump/config_flow.py", line 144, in validate_modbus_input
    coil = await connection.read_coil(coil)
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py", line 110, in read_coil
    coil.value = self.coil_encoder.decode(coil, encode_u16_list(result))
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py", line 45, in encode_u16_list
    return bytes(
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py", line 46, in <genexpr>
    byte for val in data for byte in val.to_bytes(2, "little", signed=False)
AttributeError: 'numpy.uint16' object has no attribute 'to_bytes'

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

@cybermaus if you can hack the path mentioned in your log above, you can change val.to_bytes to int(val).to_bytes should solve that issue.

@cybermaus
Copy link

It seems I can't. /usr/local/lib/ does not contain any /usr/local/lib/python3.10.

A sudo find / | grep nibe also does not find anything (apart from nibe_heatpump that I put there myself).
I had this problem yesteday also, when I tried to follow @dkmh.
I think it is because HAOS is all docker build and stuff, I do not really know, I am a bit behind on modern container methods, more of a classic monolithic system guy.

@yozik04
Copy link
Owner

yozik04 commented Oct 20, 2022

Main home assistant is separate from SSH container where you are logged in. So it is not possible to edit HA container from SSH Container.

@cybermaus
Copy link

Makes sense. Web UI terminal has the same. How to break this jail?

@yozik04
Copy link
Owner

yozik04 commented Oct 20, 2022

The same way as you would login from one VM to an other 3rd party VM (not owned by you) on the same server. You can't. =)
But it is possible to attach screen and keyboard to the RPI and use terminal in the host OS. From that you would be able to attach to a docker container.

@cybermaus
Copy link

cybermaus commented Oct 20, 2022

Ok. That is a hassle as I need to physically retrieve the device, but I will do so. If only because I need to get more on top of this docker stuff. But not now, another customer meeting at the top of the hour.

(also I probably need to add some KMV solution, like VNC)

@yozik04
Copy link
Owner

yozik04 commented Oct 20, 2022

you do not need any KVM or VNC. Just use regular raspbian and install docker there. You will have proper access to the host OS. HomeAssistant will run in docker. But this way you will loose opportunity to easy install hass os plugins, of course if you use them. All this requires some linux administration skills though, and maybe some more time and effort.

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

You can get into hassos container too: https://community.home-assistant.io/t/protip-how-to-get-shell-in-actual-homeassistant-or-addon-container-when-using-hassio/48760 but it's trigger and you risk breaking stuff.

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

I still don't understand thus. umodbus does not seem to be using numpy, so where the heck is that numpy.int16 coming from.

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

@cybermaus, change the requirement line in your manifest file to this:

"requirements": ["git+https://github.com/yozik04/nibe.git@master#nibe==2.0.0"],

The 2.0.0 need to be changed anytime we make some change to nibe library. It's just a dummy version.

@cybermaus
Copy link

Ok, so I was already busy activating port 22222 when your suggestion came in, but I did get that to work (so I guess I do now have a true root console).
But that did not help much to hack/tweak the modbus.py because there are 3 of them:

# find / | grep modbus.py | grep nibe
/mnt/data/docker/overlay2/2d19273231b2325c66890146d38205de880645d2fb8c429e53356d5d937056d9/diff/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/mnt/data/docker/overlay2/c221e9b9939e25592f42b86f9b204322db2820610b0312846ff6ebba8b484778/diff/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/mnt/data/docker/overlay2/c221e9b9939e25592f42b86f9b204322db2820610b0312846ff6ebba8b484778/merged/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/var/lib/docker/overlay2/2d19273231b2325c66890146d38205de880645d2fb8c429e53356d5d937056d9/diff/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/var/lib/docker/overlay2/c221e9b9939e25592f42b86f9b204322db2820610b0312846ff6ebba8b484778/diff/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/var/lib/docker/overlay2/c221e9b9939e25592f42b86f9b204322db2820610b0312846ff6ebba8b484778/merged/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py

Next I did the requirements=2.0.0 thing.
Loading the NIBE took quite some time (making me think it was downloading the redirected requirement.
But alas, the same numpy error:

2022-10-20 19:31:25.025 ERROR (MainThread) [custom_components.nibe_heatpump] Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/nibe_heatpump/config_flow.py", line 191, in async_step_modbus
    title, data = await validate_modbus_input(self.hass, user_input)
  File "/config/custom_components/nibe_heatpump/config_flow.py", line 144, in validate_modbus_input
    coil = await connection.read_coil(coil)
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py", line 110, in read_coil
    coil.value = self.coil_encoder.decode(coil, encode_u16_list(result))
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py", line 45, in encode_u16_list
    return bytes(
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py", line 46, in <genexpr>
    byte for val in data for byte in val.to_bytes(2, "little", signed=False)
AttributeError: 'numpy.uint16' object has no attribute 'to_bytes'

Just for reference, this is how my manifest looks at the moment:

{
  "domain": "nibe_heatpump",
  "name": "Nibe Heat Pump",
  "config_flow": true,
  "documentation": "https://www.home-assistant.io/integrations/nibe_heatpump",
  "requirements": ["git+https://github.com/yozik04/nibe.git@master#nibe==2.0.0"],
  "codeowners": ["@elupus"],
  "iot_class": "local_polling",
  "version": "1.0.0"
}

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

It didn't take the new requirement sadly. Not sure why.

@nkrepo
Copy link

nkrepo commented Oct 20, 2022

@cybermaus can you post your config.yaml for the SMOS40 so I can join testing ...
I am trying to poll current-outdoor-temperature-bt1-30002

@elupus I think i can't poll any register ...

I am not running through container , just directly on Ubuntu 22.04:
nibe-mqtt -c config.yaml

The output is:

nibe-mqtt -c nibe-config.yaml
2022-10-20 20:53:41,551 - INFO     - MainThread - root - Running Nibe MQTT 0.3.0 service with Nibe 1.1.1 lib
2022-10-20 20:53:46,563 - INFO     - MainThread - nibe.nibe_mqtt.service - Polling coil current-outdoor-temperature-bt1-30002: last_update = None
2022-10-20 20:53:46,564 - DEBUG    - MainThread - nibe.nibe.connection.modbus - Sending read request
2022-10-20 20:53:46,565 - DEBUG    - MainThread - sockio.TCP(192.168.2.18:502) - open connection (#1)
2022-10-20 20:53:46,576 - INFO     - MainThread - nibe.nibe.connection.modbus - current-outdoor-temperature-bt1-30002: 13.4
2022-10-20 20:53:46,576 - ERROR    - MainThread - nibe.nibe.event_server - 'nibegw'
Traceback (most recent call last):
  File "/home/nkef/.local/lib/python3.10/site-packages/nibe/event_server.py", line 17, in notify_event_listeners
    listener(*args, **kwargs)
  File "/home/nkef/.local/lib/python3.10/site-packages/nibe_mqtt/service.py", line 120, in on_coil_update
    self.mqtt_client.publish_discovery(coil, self._get_device_info())
  File "/home/nkef/.local/lib/python3.10/site-packages/nibe_mqtt/service.py", line 67, in _get_device_info
    "id": slugify("Nibe " + self.conf["nibe"]["nibegw"]["ip"]),
KeyError: 'nibegw'

My config is

logging:
  level: DEBUG
  format: "%(asctime)s - %(levelname)-8s - %(threadName)-10s - %(name)s - %(message)s"
mqtt:
  host: 192.168.2.17:1883
  protocol: 5
  username: test
  password: user
nibe:
  model: SMOS40
  word_swap: true
  modbus:
    url: tcp://192.168.2.18:502
    slave_id: 1
  poll:
    coils:
      - current-outdoor-temperature-bt1-30002

Using a gui tool I managed to pool various registers successfully , so I am confident the issue is not on NIBE's end.
image

@cybermaus
Copy link

@nkrepo For what elupus is doing, there is nothing in my configuration.yaml. And I am not using MQTT to the NIBE, but the home assistant MODBUS integration. I dropped my config here for you already. But to restate, that has nothing to do with either MQTT nor the work done here. You are welcome to use it though, but if you have questions about it, best put them in that other issue.

And if you want to start testing the solution of this issue, best follow the instructions from the top. Which somewhat unfortunately start also in the middle of another issue.

@nkrepo
Copy link

nkrepo commented Oct 20, 2022

@nkrepo For what elupus is doing, there is nothing in my configuration.yaml. And I am not using MQTT to the NIBE, but the home assistant MODBUS integration. I dropped my config here for you already. But to restate, that has nothing to do with either MQTT nor the work done here. You are welcome to use it though, but if you have questions about it, best put them in that other issue.

And if you want to start testing the solution of this issue, best follow the instructions from the top. Which somewhat unfortunately start also in the middle of another issue.

@cybermaus
Sorry I forgot that you already posted the config.
It fails on the nibe library part so I think the issues are common, but you are correct I should try also through home assistant. On 1.0.2 nibe library I was getting different error.

@elupus
I would like to join testing, I can setup anything , an instance of home assistant running in docker , fully supervised, whatever is easier to pull the latest nibe support in hasio.

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

@nkrepo you can just checkout home-assistant/core#80557 and use that pull request, however you will need to adjust the manifest file of nibe_heatpump at the moment. I will update that pull soon:is. I just wanted to avoid a new nibe release again, but looks like we might have to do that.

@cybermaus
Copy link

If you can tell me what modbus.py to modify in my root console, I could do that, so you may avoid unneeded versions. Or should I modify all of them?

# find / | grep modbus.py | grep nibe
/mnt/data/docker/overlay2/2d19273231b2325c66890146d38205de880645d2fb8c429e53356d5d937056d9/diff/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/mnt/data/docker/overlay2/c221e9b9939e25592f42b86f9b204322db2820610b0312846ff6ebba8b484778/diff/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/mnt/data/docker/overlay2/c221e9b9939e25592f42b86f9b204322db2820610b0312846ff6ebba8b484778/merged/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/var/lib/docker/overlay2/2d19273231b2325c66890146d38205de880645d2fb8c429e53356d5d937056d9/diff/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/var/lib/docker/overlay2/c221e9b9939e25592f42b86f9b204322db2820610b0312846ff6ebba8b484778/diff/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py
/var/lib/docker/overlay2/c221e9b9939e25592f42b86f9b204322db2820610b0312846ff6ebba8b484778/merged/usr/local/lib/python3.10/site-packages/nibe/connection/modbus.py

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

I've published a new lib and updaded the pull request.

@cybermaus change to "requirements": ["nibe==1.1.2"],

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

ps. @cybermaus you should not be modifying those. You should do as in: https://community.home-assistant.io/t/protip-how-to-get-shell-in-actual-homeassistant-or-addon-container-when-using-hassio/48760 and enter the docker container. Then you can find the paths in the error logs. But.. be careful :)

@dkmh
Copy link

dkmh commented Oct 20, 2022

No success here in pulling nibe requirement directly from github master instead of pypi release. No idea why.

But with version 1.1.2:
image
(Changing value works too 👍 )
image
🥳 Many THX for your work so far, will start further testing tomorrow.

@cybermaus
Copy link

Success for me too :)
I'll be playing with it

image

@cybermaus
Copy link

It is absolutely marvellous.
Not wanting to do too much more today, I figured I should at least enable the ones I was already monitoring, so I have some history to look at tomorrow.

Which leads me to the fact that this one seems to be missing:

#Priority	MODBUS_INPUT_REGISTER	1028	1		4	0	0	0
# 10: Off, 20: Hot Water, 30: Heat, 40: Pool, 50: Cooling

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

Hehe, yea the exports seem unreliable. I have opened #56 and #52

@nkrepo
Copy link

nkrepo commented Oct 20, 2022

Success for me also!
@elupus
In a ubuntu 22.04 VM with bridged networking and no firewall (UFW) I followed the Set up Development Environment for the "Manual Environment". (installed some missing python dependencies also)

git clone https://github.com/home-assistant/core.git
cd core/
git fetch origin pull/80557/head:elupus-test
git merge elupus-test
script/setup
source venv/bin/activate
hass -c config

It includes the 2e4627a

After that I configured the nibe integration through GUI, added some modbus registers and it seems to work
image
I can do more testing, are there specific types of registers that fail ?

@elupus
Copy link
Collaborator Author

elupus commented Oct 20, 2022

@nkrepo nice with more confirmation! Now i just need to figure out how to handle climate objects and hot water ones with different parameter numbers compared to modbus40.

@elupus elupus closed this as completed Oct 20, 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

5 participants