Comments (30)
@veista - thank you! 🍺
Than you for your continuing support!
from nilan.
from nilan.
https://github.com/home-assistant/core/pull/97780/files
from nilan.
I can not fix this issue fully right now. We will have to wait for an update for HA. The pymodbus wrapper in HA is broken. If this is not fixed I will have to make my own, but not looking forward to that.
Will push my progress to dev, so you can try it yourself.
from nilan.
@veista - thank you! 🍺
from nilan.
hi,
Is the problem not related to a name-change in the ha-modbus wrapper-lib?
home-assistant/core@bbc34ba#diff-2665704d3ee341f20f11d81ce07da5575297bf5c2dc1cb6623c92d6f62ed8e1a
I've replaced it locally in device.py
async_pymodbus_call -> async_pb_call
and now all entities are there again and updating
No exceptions in the HA Logs either so far
from nilan.
hi,
Is the problem not related to a name-change in the ha-modbus wrapper-lib?
home-assistant/core@bbc34ba#diff-2665704d3ee341f20f11d81ce07da5575297bf5c2dc1cb6623c92d6f62ed8e1a
Concider reading the issue and responses. Yes that is one problem. You can download the fix for that from dev. Even though I implemented that change, it does not work. I spent a couple of hours debugging and figured that the new pymodbus version is not fully compatible with the wrapper used in HA.
from nilan.
hi,
Is the problem not related to a name-change in the ha-modbus wrapper-lib? home-assistant/core@bbc34ba#diff-2665704d3ee341f20f11d81ce07da5575297bf5c2dc1cb6623c92d6f62ed8e1a
I've replaced it locally in device.py async_pymodbus_call -> async_pb_call and now all entities are there again and updating
No exceptions in the HA Logs either so far
Are you running with Modbus tcp or serial?
from nilan.
Modbus Serial
I'll monitor it for some time if it stops working and maybe add the suggested error-handling arguments
( retries: 3, retry_on_empty: true, close_comm_on_error: false )
@veista - great job btw. I love this integration 🍺
from nilan.
Modbus Serial
I'll monitor it for some time if it stops working and maybe add the suggested error-handling arguments ( retries: 3, retry_on_empty: true, close_comm_on_error: false )
@veista - great job btw. I love this integration 🍺
OK and thanks. Then it seems to me that only the TCP side is broken or it depends also on the bridge device.
from nilan.
Can you test the dev branch if it works for you?
from nilan.
"dev" branch did not work unfortunately
DEBUG (MainThread) [pymodbus.logging] Connecting to /dev/ttyUSB0.
DEBUG (MainThread) [pymodbus.logging] Connecting comm
DEBUG (MainThread) [pymodbus.logging] Connected to comm
DEBUG (MainThread) [pymodbus.logging] callback_connected called
DEBUG (MainThread) [pymodbus.logging] send: 0x1e 0x3 0x3 0xe8 0x0 0x1 0x6 0x15
DEBUG (MainThread) [pymodbus.logging] Adding transaction 30
DEBUG (MainThread) [pymodbus.logging] recv: 0x1e 0x3 0x2 0x0 0x23 0x6c 0x5f addr=None
DEBUG (MainThread) [pymodbus.logging] Processing: 0x1e 0x3 0x2 0x0 0x23 0x6c 0x5f
DEBUG (MainThread) [pymodbus.logging] Getting Frame - 0x3 0x2 0x0 0x23
DEBUG (MainThread) [pymodbus.logging] Factory Response[ReadHoldingRegistersResponse': 3]
DEBUG (MainThread) [pymodbus.logging] Frame advanced, resetting header!!
DEBUG (MainThread) [pymodbus.logging] Getting transaction 30
ERROR (MainThread) [custom_components.nilan.device] Could not read get_machine_type
ERROR (MainThread) [custom_components.nilan.device] Could not read get_bus_version
INFO (SyncWorker_11) [homeassistant.components.modbus.modbus] modbus Nilan communication open
master branch with replacement of method-name (async_pymodbus_call -> async_pb_call) worked though
from nilan.
Well that seems fairly odd since there should be no difference (I get this error too almost always, sometimes it works for a minute). From manifest.json could you change the minimum requirement for pymodbus to 2.4.1 and try again?
from nilan.
wasn't the issue but rather:
diff --git a/custom_components/nilan/device.py b/custom_components/nilan/device.py
index 95a28fd..c8d6946 100644
--- a/custom_components/nilan/device.py
+++ b/custom_components/nilan/device.py
@@ -38,7 +38,7 @@ class Device:
"name": self._device_name,
"type": self._com_type,
"method": "rtu",
- "delay": 1,
+ "delay": 0,
"port": self._host_port,
"timeout": 1,
"close_comm_on_error": "false",
from nilan.
wasn't the issue but rather:
diff --git a/custom_components/nilan/device.py b/custom_components/nilan/device.py index 95a28fd..c8d6946 100644 --- a/custom_components/nilan/device.py +++ b/custom_components/nilan/device.py @@ -38,7 +38,7 @@ class Device: "name": self._device_name, "type": self._com_type, "method": "rtu", - "delay": 1, + "delay": 0, "port": self._host_port, "timeout": 1, "close_comm_on_error": "false",
That is funny. On my setup I cannot even connect with delay 0 on 2023.9. The wrapper seems to be completely broken to me.
from nilan.
HA 2023.9.1 has updated pymodbus to 3.5.1
have you tried that already?
let me know if i should help testing.
from nilan.
Yeah although I'm not smart enough to help fix anything I did update to 2023.9.1 last night - both this Nilan modbus integration and the one I use for my Solax inverter are still having issues. 😥
from nilan.
HA 2023.9.1 has updated pymodbus to 3.5.1
have you tried that already? let me know if i should help testing.
Noticed this morning that they pushed a new update. Will try today... I'm leaving on a trip again tomorrow so lets hope it works. Will anyway push a beta release so if it gets fixed on HA you can get this integration working again.
from nilan.
Yeah although I'm not smart enough to help fix anything I did update to 2023.9.1 last night - both this Nilan modbus integration and the one I use for my Solax inverter are still having issues. 😥
I had to also go back to 2023.8.4 since the new update broke also z-wave and other stuff... I recommend going back and skipping this months release. I suspect it will take time untill all of the problems get fixed.
from nilan.
Also I suspect the issue #76 already had symptoms of something not working right with modbus. Though it has nothing to do with the root cause of that.
from nilan.
home-assistant/core#99784 (comment)
from nilan.
HA 2023.9.1 has updated pymodbus to 3.5.1
have you tried that already? let me know if i should help testing.
Tried the latest versions. Still the issues remain unfortunately. Released the partial fix as beta and reverted delay to 0.
from nilan.
Hi,
Updated to freshly released 2023.09.2, and with 1.2.5B of integration it all works perfectly now. All entities as normal.
from nilan.
Resolved with 2023.09.2 and 1.2.5B
from nilan.
Having a similar issue. Updated to 1.2.5B but still "Failed to connect" when I try to re-install the integration. To the log it gives the following error:
This error originated from a custom integration.
Logger: pymodbus.logging
Source: custom_components/nilan/config_flow.py:56
Integration: Nilan (documentation, issues)
First occurred: 10:45:08 PM (3 occurrences)
Last logged: 10:47:46 PM
Failed to connect [Errno 111] Connect call failed ('192.168.0.111', 502)
I restored an older full backup, and the integration works ok again on that so I assume that the bridge device is working OK. I have a RP4 and usb to rs485 adapter.
from nilan.
Having a similar issue. Updated to 1.2.5B but still "Failed to connect" when I try to re-install the integration. To the log it gives the following error:
This error originated from a custom integration.
Logger: pymodbus.logging Source: custom_components/nilan/config_flow.py:56 Integration: Nilan (documentation, issues) First occurred: 10:45:08 PM (3 occurrences) Last logged: 10:47:46 PM
Failed to connect [Errno 111] Connect call failed ('192.168.0.111', 502)
I restored an older full backup, and the integration works ok again on that so I assume that the bridge device is working OK. I have a RP4 and usb to rs485 adapter.
Had a similar issue on my dev environment. Could not replicate once is magically started working. Try the new release 1.2.6. If the issue remains just keep trying to install it again. The issue is somehow in the config flow, but cannot pinpoint the cause.
from nilan.
Bumped to 1.2.6 with a HA restart after installing the HACS module. Still unable to install the integration:
Logger: pymodbus.logging
Source: components/modbus/modbus.py:396
First occurred: 12:01:22 PM (269 occurrences)
Last logged: 12:10:07 PM
Connection to (192.168.0.111, 502) failed: [Errno 111] Connection refused
from nilan.
It seems to me that for some reason the usb adaptor is busy. I will try and simulate this issue in my dev environment when I have time. Have you tried to do a Full reboot of your system? Power off and power on.
from nilan.
Ok. So I think I misunderstood your setup. You have made your own bridge device with a RPi and an USB adaptor?
The newer pymodbus is at the moment much less forgiving than the old one, so it might be an issue in both ends. I'll read the documentation again and try to figure out if I'm missing something in the update.
from nilan.
Just to inform, the setup with 1.2.6 works ok now. I just restarted all, including the bridge device also. Did not need to manually touch anything, and the integration is now up and running ok. Thanks for the great piece of code 💪🏻
from nilan.
Related Issues (20)
- If connection fails during setup, integration must be reloaded
- Add support for VGU180 EK HOT 4
- Add support for Nilan CompactS HOT 3
- Fan mode missing from automation actions HOT 2
- Nilan Compact P Air 9 support
- CTS700 on a Compact P HOT 2
- Latest update created orphaned device HOT 6
- Can't initialize integration after 2024.4 HOT 8
- Could not read errors - poss since 1.2.14 HOT 11
- Elfin EW11 HOT 2
- Modbus Error: [Connection] Not connected[AsyncModbusTcpClient 192.168.68.122:502] HOT 1
- 1.2.15 causes MODBUS communication to fail HOT 2
- Could not exclusively lock port /dev/ttyUSB0 HOT 1
- Failed to call service HOT 1
- Home Assistant 2023.9 broke Nilan integration - "Failed to set up"
- Doesn't work with 2023.9? HOT 1
- Issues with 2023.9.0 and 2023.9.1 Core update HOT 1
- Feature request - NILAN Gateway integration directly? HOT 1
- Set Fan Level
- Central heating control HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nilan.