Comments (8)
The ones that appear near the elfins in the image.
Two Master One /Multiple Slave RS485 Repeater Cache Optoelectronic Isolation Modbus Dual Master Hub
https://a.aliexpress.com/_EwiBqvz
from home-assistant-saj-modbus.
I've enabled logs and watched with tail -f /config/home-assistant.log
and when it had problems, this is how it went:
...
2024-04-27 19:47:25.318 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.275 seconds (success: True)
2024-04-27 19:47:35.318 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.277 seconds (success: True)
2024-04-27 19:47:45.321 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.279 seconds (success: True)
2024-04-27 19:47:55.322 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.280 seconds (success: True)
2024-04-27 19:48:05.324 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.283 seconds (success: True)
2024-04-27 19:48:15.324 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.283 seconds (success: True)
2024-04-27 19:48:25.134 ERROR (MainThread) [custom_components.saj_modbus.hub] Unexpected error fetching SAJ data: unpack requires a buffer of 4 bytes
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 315, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/saj_modbus/hub.py", line 95, in _async_update_data
realtime_data = await self.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 "/config/custom_components/saj_modbus/hub.py", line 166, in read_modbus_realtime_data
faultMsg0 = decoder.decode_32bit_uint()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymodbus/payload.py", line 380, in decode_32bit_uint
handle = self._unpack_words(fstring, handle)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pymodbus/payload.py", line 340, in _unpack_words
handle = unpack(f"!{wc_value}H", handle)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
struct.error: unpack requires a buffer of 4 bytes
2024-04-27 19:48:25.139 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.098 seconds (success: False)
2024-04-27 19:48:40.047 INFO (MainThread) [custom_components.saj_modbus.hub] Fetching SAJ data recovered
2024-04-27 19:48:40.047 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 5.007 seconds (success: True)
2024-04-27 19:48:55.051 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 5.009 seconds (success: True)
2024-04-27 19:49:05.310 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.269 seconds (success: True)
2024-04-27 19:49:15.310 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.269 seconds (success: True)
2024-04-27 19:49:25.311 DEBUG (MainThread) [custom_components.saj_modbus.hub] Finished fetching SAJ data in 0.269 seconds (success: True)
...
from home-assistant-saj-modbus.
My feeling is this could be related to the SEC device, if I understand properly this modbus thingie, the inverter is the slave and the Elfin and the SEC smart meter devices are the masters, and both harass the inverter requesting data.
Maybe at some point the SEC is requesting data, inverter replies and the Elfin device is catching the response on the fly, tries to decode using his known structure, the structure is not matching because the reply was meant for the SEC device, so the SAJ integration throws the exception and then it takes some time to recover (like 20 seconds?!?)
After the "Fetching SAJ data recovered" there are also 2 long time processing jobs reports, which is strange.
from home-assistant-saj-modbus.
See #72 (comment) for the most likely cause of your troubles. You can not connect more than one device that requests data from your inverter's RS485 port and expect it to work without issues. Modbus is not designed for that.
from home-assistant-saj-modbus.
I understand the part with "not expect it to work without issues". But most of the time the integration works fine, only from time to time the problem appears in which case handling the exception thrown could maybe improve the behavior?
from home-assistant-saj-modbus.
I ordered two "gateways" units, something that works like 2 masters and 1 slave and I hope to see if this is going to fix my issues.
I will report back with the outcome, and I will propose closing the issue.
from home-assistant-saj-modbus.
I received the gateway units, installed them and those works flawless.
No more errors in HA.
Also, now I can query the DTSU-666 smart meter over modbus.
from home-assistant-saj-modbus.
Good to hear the issue is solved.
Which gateway did you use?
from home-assistant-saj-modbus.
Related Issues (20)
- Clarifications please HOT 1
- Integration is using deprecated `DEVICE_CLASS_*` constants HOT 3
- Values are frequently 'unavailable' HOT 5
- System log plenty of "inverter" and "host" unreachable error messages (thousands of occurences) during the night. HOT 3
- Config flow could not be loaded error message when trying to add integration HOT 8
- Problems after adding the SmartMeter HOT 12
- Problems with integrations stops working HOT 4
- Integration not working HOT 3
- Add export limitation as service call HOT 10
- Power Slider HOT 1
- Deprecated constant which will be removed in HA Core 2025.1 HOT 2
- H2 inverter integration HOT 2
- UI locks when communication time-outs occur HOT 6
- Setting Data Bits on Elfin EW10 HOT 3
- Setting the power slider to 100% is too low HOT 11
- Issue while calculating the PV production HOT 2
- Add option for modbus to usb converter HOT 2
- Saj sununo plus help HOT 2
- Not closing the realtime connection causes intermitting data results
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 home-assistant-saj-modbus.