Jump to content

Kladrie

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Kladrie

  1. Ah, yes - I had tried to see what effect the profiles may have, and of course forgot to remove it again. Done. However, something seems to go awry when I do this (even after reducing the sensors to only 175 and 185): ... 2022-03-01 15:50:39,436 INFO MQTT: Connection successful 2022-03-01 15:50:39,927 DEBUG PUBLISH 1R SUNSYNK/status/2009074307/availability, online 2022-03-01 15:50:39,943 DEBUG publish homeassistant/sensor/2009074307/battery_soc/config 2022-03-01 15:50:39,944 DEBUG PUBLISH 1R homeassistant/sensor/2009074307/battery_soc/config, {"unique_id": "2009074307_battery_soc", "device": {"identifiers": ["2009074307"], "manufacturer": "Sunsynk", "model": "Inverter 2009074307", "name": "Sunsynk Inverter 2009074307"}, "state_topic": "SUNSYNK/status/2009074307/battery_soc", "name": "SS Battery SOC", "availability": [{"topic": "SUNSYNK/status/2009074307/availability"}], "device_class": "battery", "unit_of_measurement": "%"} 2022-03-01 15:50:39,950 DEBUG publish homeassistant/sensor/2009074307/inverter_power/config 2022-03-01 15:50:39,951 DEBUG PUBLISH 1R homeassistant/sensor/2009074307/inverter_power/config, {"unique_id": "2009074307_inverter_power", "device": {"identifiers": ["2009074307"], "manufacturer": "Sunsynk", "model": "Inverter 2009074307", "name": "Sunsynk Inverter 2009074307"}, "state_topic": "SUNSYNK/status/2009074307/inverter_power", "name": "SS Inverter power", "availability": [{"topic": "SUNSYNK/status/2009074307/availability"}], "device_class": "power", "unit_of_measurement": "W"} 2022-03-01 15:50:39,963 DEBUG Rx retained msg: topic=homeassistant/sensor/2009074307/battery_soc/config -- device=2009074307 2022-03-01 15:50:39,964 DEBUG Rx retained msg: topic=homeassistant/sensor/2009074307/inverter_power/config -- device=2009074307 2022-03-01 15:50:39,964 DEBUG Rx retained msg: topic=homeassistant/sensor/2009074307/inverter_frequency/config -- device=2009074307 2022-03-01 15:50:39,965 WARNING Removing HASS MQTT discovery info homeassistant/sensor/2009074307/inverter_frequency/config Exception in thread Thread-1: Traceback (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/local/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3452, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1779, in loop_forever rc = self.loop(timeout, max_packets) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1181, in loop rc = self.loop_read(max_packets) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1572, in loop_read rc = self._packet_read() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2310, in _packet_read rc = self._packet_handle() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2936, in _packet_handle return self._handle_publish() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3216, in _handle_publish self._handle_on_message(message) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3444, in _handle_on_message self.on_message(self, self._userdata, message) File "/usr/src/app/mqtt.py", line 247, in __on_message _loop.create_task(self.publish(topic, None, retain=True)) File "/usr/local/lib/python3.9/asyncio/base_events.py", line 433, in create_task task = tasks.Task(coro, loop=self, name=name) File "/usr/local/lib/python3.9/asyncio/base_events.py", line 748, in call_soon self._check_thread() File "/usr/local/lib/python3.9/asyncio/base_events.py", line 785, in _check_thread raise RuntimeError( RuntimeError: Non-thread-safe operation invoked on an event loop other than the current one 2022-03-01 15:50:39,994 ERROR Task was destroyed but it is pending! source_traceback: Object created at (most recent call last): File "/usr/local/lib/python3.9/threading.py", line 912, in _bootstrap self._bootstrap_inner() File "/usr/local/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/local/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3452, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1779, in loop_forever rc = self.loop(timeout, max_packets) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1181, in loop rc = self.loop_read(max_packets) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 1572, in loop_read rc = self._packet_read() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2310, in _packet_read rc = self._packet_handle() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 2936, in _packet_handle return self._handle_publish() File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3216, in _handle_publish self._handle_on_message(message) File "/usr/local/lib/python3.9/site-packages/paho/mqtt/client.py", line 3444, in _handle_on_message self.on_message(self, self._userdata, message) File "/usr/src/app/mqtt.py", line 247, in __on_message _loop.create_task(self.publish(topic, None, retain=True)) File "/usr/local/lib/python3.9/asyncio/base_events.py", line 433, in create_task task = tasks.Task(coro, loop=self, name=name) task: <Task pending name='Task-3' coro=<MQTTClient.publish() running at /usr/src/app/mqtt.py:187> created at /usr/local/lib/python3.9/asyncio/base_events.py:433> /usr/local/lib/python3.9/threading.py:956: RuntimeWarning: coroutine 'MQTTClient.publish' was never awaited self._invoke_excepthook(self) RuntimeWarning: Enable tracemalloc to get the object allocation traceback I also see it still battles with inverter_frequency, even though I removed it from the Configuration, and I do not attempt to use it anywhere else in HA either.
  2. My goodness, what a prompt reply! I have actually been using the dev version (2022.02.22d-0.1.3). On the 'Configuration' tab of the addon I have the following, for now: PORT_URL: serial:///dev/ttyUSB0 SUNSYNK_ID: '2009074307' SENSOR_PREFIX: SS SENSORS: - pv1_power - battery_soc - battery_power - inverter_power - inverter_frequency PROFILES: - system_mode MODBUS_SERVER_ID: 1 MQTT_HOST: core-mosquitto MQTT_PORT: 1883 DEBUG: 2 If I now restart the addon, the log window shows the following: [s6-init] making user provided files available at /var/run/s6/etc...exited 0. [s6-init] ensuring user provided files have correct perms...exited 0. [fix-attrs.d] applying ownership & permissions fixes... [fix-attrs.d] done. [cont-init.d] executing container initialization scripts... [cont-init.d] done. [services.d] starting services [services.d] done. 2022-03-01 15:04:00,012 INFO Loading HASS OS configuration 2022-03-01 15:04:00,013 DEBUG step unit:W, id:pv1_power 2022-03-01 15:04:00,014 DEBUG last unit:%, id:battery_soc 2022-03-01 15:04:00,015 DEBUG step unit:W, id:battery_power 2022-03-01 15:04:00,015 DEBUG step unit:W, id:inverter_power 2022-03-01 15:04:00,016 DEBUG step unit:Hz, id:inverter_frequency 2022-03-01 15:04:00,017 INFO Filter *step used for battery_power, inverter_frequency, inverter_power, pv1_power 2022-03-01 15:04:00,018 INFO Filter *last used for battery_soc 2022-03-01 15:04:00,018 DEBUG Using selector: EpollSelector 2022-03-01 15:04:00,020 INFO Connecting to serial:///dev/ttyUSB0 2022-03-01 15:04:00,132 DEBUG Request registers: [3, 4, 5, 6, 7] glen=5. Response [12848, 12345, 12343, 13363, 12343] len=5. regs={3: 12848, 4: 12345, 5: 12343, 6: 13363, 7: 12343} 2022-03-01 15:04:00,133 INFO ############################################################ 2022-03-01 15:04:00,133 INFO Inverter serial number '2009074307' 2022-03-01 15:04:00,134 INFO ############################################################ 2022-03-01 15:04:00,136 INFO MQTT: Connecting to **@core-mosquitto:1883 2022-03-01 15:04:00,172 INFO MQTT: Connection successful 2022-03-01 15:04:00,646 DEBUG PUBLISH 1R SUNSYNK/status/2009074307/availability, online 2022-03-01 15:04:00,656 DEBUG publish homeassistant/sensor/2009074307/pv1_power/config 2022-03-01 15:04:00,658 DEBUG PUBLISH 1R homeassistant/sensor/2009074307/pv1_power/config, {"unique_id": "2009074307_pv1_power", "device": {"identifiers": ["2009074307"], "manufacturer": "Sunsynk", "model": "Inverter 2009074307", "name": "Sunsynk Inverter 2009074307"}, "state_topic": "SUNSYNK/status/2009074307/pv1_power", "name": "SS PV1 power", "availability": [{"topic": "SUNSYNK/status/2009074307/availability"}], "device_class": "power", "unit_of_measurement": "W"} 2022-03-01 15:04:00,663 DEBUG publish homeassistant/sensor/2009074307/battery_soc/config 2022-03-01 15:04:00,665 DEBUG PUBLISH 1R homeassistant/sensor/2009074307/battery_soc/config, {"unique_id": "2009074307_battery_soc", "device": {"identifiers": ["2009074307"], "manufacturer": "Sunsynk", "model": "Inverter 2009074307", "name": "Sunsynk Inverter 2009074307"}, "state_topic": "SUNSYNK/status/2009074307/battery_soc", "name": "SS Battery SOC", "availability": [{"topic": "SUNSYNK/status/2009074307/availability"}], "device_class": "battery", "unit_of_measurement": "%"} 2022-03-01 15:04:00,669 DEBUG publish homeassistant/sensor/2009074307/battery_power/config 2022-03-01 15:04:00,677 DEBUG PUBLISH 1R homeassistant/sensor/2009074307/battery_power/config, {"unique_id": "2009074307_battery_power", "device": {"identifiers": ["2009074307"], "manufacturer": "Sunsynk", "model": "Inverter 2009074307", "name": "Sunsynk Inverter 2009074307"}, "state_topic": "SUNSYNK/status/2009074307/battery_power", "name": "SS Battery power", "availability": [{"topic": "SUNSYNK/status/2009074307/availability"}], "device_class": "power", "unit_of_measurement": "W"} 2022-03-01 15:04:00,682 DEBUG Rx retained msg: topic=homeassistant/sensor/2009074307/battery_soc/config -- device=2009074307 2022-03-01 15:04:00,683 DEBUG Rx retained msg: topic=homeassistant/sensor/2009074307/inverter_power/config -- device=2009074307 2022-03-01 15:04:00,684 DEBUG Rx retained msg: topic=homeassistant/sensor/2009074307/inverter_frequency/config -- device=2009074307 2022-03-01 15:04:00,686 DEBUG Rx retained msg: topic=homeassistant/sensor/2009074307/pv1_power/config -- device=2009074307 2022-03-01 15:04:00,686 DEBUG publish homeassistant/sensor/2009074307/inverter_power/config 2022-03-01 15:04:00,688 DEBUG PUBLISH 1R homeassistant/sensor/2009074307/inverter_power/config, {"unique_id": "2009074307_inverter_power", "device": {"identifiers": ["2009074307"], "manufacturer": "Sunsynk", "model": "Inverter 2009074307", "name": "Sunsynk Inverter 2009074307"}, "state_topic": "SUNSYNK/status/2009074307/inverter_power", "name": "SS Inverter power", "availability": [{"topic": "SUNSYNK/status/2009074307/availability"}], "device_class": "power", "unit_of_measurement": "W"} 2022-03-01 15:04:00,687 DEBUG Rx retained msg: topic=homeassistant/sensor/2009074307/battery_power/config -- device=2009074307 2022-03-01 15:04:00,692 DEBUG Rx retained msg: topic=homeassistant/select/2009074307/system_mode/config -- device=2009074307 2022-03-01 15:04:00,695 DEBUG publish homeassistant/sensor/2009074307/inverter_frequency/config 2022-03-01 15:04:00,696 DEBUG PUBLISH 1R homeassistant/sensor/2009074307/inverter_frequency/config, {"unique_id": "2009074307_inverter_frequency", "device": {"identifiers": ["2009074307"], "manufacturer": "Sunsynk", "model": "Inverter 2009074307", "name": "Sunsynk Inverter 2009074307"}, "state_topic": "SUNSYNK/status/2009074307/inverter_frequency", "name": "SS Inverter frequency", "availability": [{"topic": "SUNSYNK/status/2009074307/availability"}], "unit_of_measurement": "Hz"} 2022-03-01 15:04:00,699 DEBUG publish homeassistant/select/2009074307/system_mode/config 2022-03-01 15:04:00,701 DEBUG PUBLISH 1R homeassistant/select/2009074307/system_mode/config, {"unique_id": "2009074307_system_mode", "device": {"identifiers": ["2009074307"], "manufacturer": "Sunsynk", "model": "Inverter 2009074307", "name": "Sunsynk Inverter 2009074307"}, "state_topic": "SUNSYNK/status/2009074307/system_mode", "name": "SS System Mode", "availability": [{"topic": "SUNSYNK/status/2009074307/availability"}], "command_topic": "SUNSYNK/status/2009074307/system_mode_set", "options": ["UPDATE"]} 2022-03-01 15:04:01,255 DEBUG Request registers: [175] glen=1. Response [2217] len=1. regs={175: 2217} 2022-03-01 15:04:01,335 DEBUG Request registers: [184] glen=1. Response [100] len=1. regs={184: 100} 2022-03-01 15:04:01,411 DEBUG Request registers: [186] glen=1. Response [1307] len=1. regs={186: 1307} And that is as far as it goes. No further communication occurs, so I assume I should set something to make this happen? And why does it say 'retained msg'? I very much suspect that I got old readings this time round, as I often do. Do I put something in the configuration settings, or is it elsewhere altogether? Thank you very much for the massive amount of work that you have put in, and share so freely with the community.
  3. I too eventually got around to wiring up the RS485 port in my 8kW Deye inverter. Reading through this thread and others I have picked up that there are some uncertainty as to the best way to get the data to where you want when the inverter is far away from the Home Assistant host computer. At last we touch upon something that I actually know about. Being a differential format, RS485 is impressively robust, and able to communicate over ridiculously long wires. A ground wire is not needed, even though some serial converters have a GND input. The RS485 specification looks like this: Because we are talking to the inverter at 9600 baud, this means we should limit the wire length to less than 1.2km. Even in my house the distance is slightly less than that to get from my inverter in the garage to the RPi4+ running HA in the study, so I ran an ethernet cable all the way, and then chopped off its head at the RPi side, connecting wires 1&8 to D- and 2&7 to D+ on the USB-to-serial converter plugged into one of the ports on the Pi. No ground needed, as stated above - this is a differential signal. Then I installed Mr Kellerman's most excellent Sunsynk Add-on, and after some fiddling was able to see the inverter responding. I also looked at the signals with an oscilloscope, and found them to be just fine. However, this is where I apparently reached the limits of my poor abilities. For now I would merely like to monitor some parameters (specifically battery SoC and maybe PV production power and load power (real-time, not integrated totals). I was trying to display these on a Lovelace gauge or graph, but after the initial elation of actually seeing the data wore off, I soon found that it does not update: the only way I can get it to (sometimes) refresh the readings is to restart the add-on, which is most certainly lacking in elegance. I have now spent several days and many hours perusing this thread and others, and even tried the overwhelmingly complex Node-Red flows that are so kindly made available, but I was unable to get it running either. Dozens of items were 'not assigned', and I had no idea where to assign them and/or whether and why it matters, so I gave up and focused instead on merely getting the data live on a Lovelace dashboard. No doubt it is a simple setting somewhere, but I need help to find it - how/where should I activate and set the update period?
  4. I ran into the same problem: my 8kW Deye inverter became very unhappy with the generator on the input. So, inspired by PaulinNorthcliff's remark above about 'fiddling with the throttle' I set about finding my generator's speed control, and soon found it, by pushing and tugging on springs and levers (with the generator running) until I found something that affected the speed, and tracing that to a set screw. Then, with a heater drawing a few kW to load it down (directly plugged into the generator, not connected to the inverter yet), I monitored the frequency - it was about 53Hz under load - and adjusted it down to 50Hz. After this I unplugged the heater and flipped the switch to connect the generator to the inverter input. And as PaulinNorthcliff suggests, we set it to draw well below the generator's rated output capacity. Because the inverter presents a constant load, the generator now maintains a reasonably stable speed, and happiness reigns supreme.
×
×
  • Create New...