kellerza Posted February 16, 2022 Share Posted February 16, 2022 With the addon the defaults are: Temperature - read every 1 second, averaged & reported over 60 seconds All the "energy" or total sensors - read & reported every 60 seconds Power - read every 1 second, update immediately if there is a significant change, else averaged over 60 seconds Quote Link to comment Share on other sites More sharing options...
Denarius Posted February 16, 2022 Share Posted February 16, 2022 Has anyone managed to write a modbus registers to the SunSynk 3 phase inverter? Whenever I write to it, it gives a success response, but the change doesn't take affect, if I read the same register right afterwards, it's still the old value. I've tried writing any register but none work. Note the 3 phase is different than the other inverters as the data stored in the modbus registers differ from what is posted in this topic. Nate 1 Quote Link to comment Share on other sites More sharing options...
kellerza Posted February 18, 2022 Share Posted February 18, 2022 On 2022/02/07 at 11:49 AM, shaulf said: Hi Guys, Thanks for the amazing work so far! I was wondering how I could get my essential/ups load reading out, and can't quite figure it out. If I use the below picture (from one of the above posts) I often get negative values, and it doesn't quite seem to match the load. I am really new to all the systems used here, so if anyone could point me in the right direction i would be very grateful! What do you use to read the registers? Are you sure the values you use in your calculations were read at the same point in time? Quote Link to comment Share on other sites More sharing options...
kellerza Posted February 18, 2022 Share Posted February 18, 2022 On 2022/02/17 at 1:48 AM, Denarius said: Has anyone managed to write a modbus registers to the SunSynk 3 phase inverter? What do you use to write? When I worked with pymodbus writing a single register had the same result Quote Link to comment Share on other sites More sharing options...
kellerza Posted February 21, 2022 Share Posted February 21, 2022 On 2022/02/07 at 11:49 AM, shaulf said: Hi Guys, Thanks for the amazing work so far! I was wondering how I could get my essential/ups load reading out, and can't quite figure it out. If I use the below picture (from one of the above posts) I often get negative values, and it doesn't quite seem to match the load. I am really new to all the systems used here, so if anyone could point me in the right direction i would be very grateful! In the dev version of the hass sunsynk addon (link in signature) you can add the following sensors: SENSORS: - essential_power - non_essential_power It also supports writing settings through profiles PROFILES: - system_mode (system mode will read/write time, target SOC and grid charge) Quote Link to comment Share on other sites More sharing options...
Kladrie Posted March 1, 2022 Share Posted March 1, 2022 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? Quote Link to comment Share on other sites More sharing options...
kellerza Posted March 1, 2022 Share Posted March 1, 2022 29 minutes ago, Kladrie said: 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? The signal is differential, and assuming you send it on a twisted pair, of which a network cable has enough it should transmit & arrive perfectly fine. (Here I fully agree with you) I doubt this is about the signal. In this case it is much more about the cheap RS485 transceivers being used (speaking at least for myself here). If it is not galvanically isolated and you exceed the common mode voltage, typically seems to be -7/12V (TI quotes an extended range -20 to 25V) you will not measure it correctly. The switching mode power supplies we use on the RPi4 does not help to give you a common ground, and although a ground between buildings could be a bad idea, it should be ok in my view if its fed from the same inverter. I've used a non-grounded RS485 transceiver up to now, but after a lightning strike that one is now retired and I'm getting a grounded one from Micoro Robotics. In the past I've had very few CRC errors (max 6 per day) Regarding the addon, please try the (dev) version for now. I've recently made some significant updates, with focus on the dev version, and had some reports that the non-dev version is broken... Quote Link to comment Share on other sites More sharing options...
Kladrie Posted March 1, 2022 Share Posted March 1, 2022 1 minute ago, kellerza said: Regarding the addon, please try the (dev) version for now. I've recently made some significant updates, with focus on the dev version, and had some reports that the non-dev version is broken... 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. kellerza 1 Quote Link to comment Share on other sites More sharing options...
kellerza Posted March 1, 2022 Share Posted March 1, 2022 16 minutes ago, Kladrie said: 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. Retained messages are MQTT messages - they are used to discover sensors in HomeAssistant and the addon listens for all existing sensors in order to delete old/unused sensors from HomeAssistant As a start, don't use profiles. This sets an empty array `PROFILES: []` The last 3 lines are interesting, since you get 3 values from the inverter (mapping here https://github.com/kellerza/sunsynk/blob/main/sunsynk/definitions.py) 175 - inverter power = 2217W 185 - soc - 100% 186 - pv1 power - 1307W Try limiting your sensors to only these 3 for now and without profiles. Add them slowly add more and see if you have a sensor that blocks things (Reading non-defined registers seems to cause havoc on the RS485 bus) Quote Link to comment Share on other sites More sharing options...
Kladrie Posted March 1, 2022 Share Posted March 1, 2022 5 minutes ago, kellerza said: As a start, don't use profiles. This sets an empty array `PROFILES: []` The last 3 lines are interesting, since you get 3 values from the inverter (mapping here https://github.com/kellerza/sunsynk/blob/main/sunsynk/definitions.py) 175 - inverter power = 2217W 185 - soc - 100% 186 - pv1 power - 1307W Try limiting your sensors to only these 3 for now and without profiles. Add them slowly add more and see if you have a sensor that blocks things (Reading non-defined registers seems to cause havoc on the RS485 bus) 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. Quote Link to comment Share on other sites More sharing options...
JuanH Posted March 1, 2022 Share Posted March 1, 2022 Noticed my Sunsynk data wasn't updating since this morning. For anyone else who noticed the same, there is an upstream issue with the HA add-on, and using the serial port on a RPi: https://github.com/hassio-addons/addon-node-red/issues/1312 Quote Link to comment Share on other sites More sharing options...
kellerza Posted March 1, 2022 Share Posted March 1, 2022 5 hours ago, Kladrie said: 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. The is an update available, but difficult to test since I do not have a working RS485 adaptor at the moment,- will pick up my new one on Friday. Please open an issue on Github if its still not working Quote Link to comment Share on other sites More sharing options...
Hannesvz Posted March 18, 2022 Share Posted March 18, 2022 I am struggling to communicate with the modbus and I don't know how to troubleshoot the problem. I am running home assistant in docker container with mqtt, influxdb and grafana on ubuntu server. I connected my rs485-USB adapter( USB to RS485 - 3 Pin - Micro Robotics ) A - 2 & 7 and B - 1 & 8. In the inverter I connect the cable to the BMS 485 port, but I have also tried connecting it to the RS 485 port with no luck. The cable is 10 m long from the garage to the server. The error I keep getting in node red looks like this. I also get this error every time I deploy. It is also worth to note that I took the flow from @jacauc 's github. If someone can help me it would be very appreciated. Quote Link to comment Share on other sites More sharing options...
system32 Posted March 18, 2022 Share Posted March 18, 2022 @Hannesvz How do you access the USB serial from Docker? Quote Link to comment Share on other sites More sharing options...
Hannesvz Posted March 18, 2022 Share Posted March 18, 2022 I see now what I think I did wrong, but I don't know how to fix it can you help me. Add /dev/ttyUSB0 to this line. docker run -it -p 1880:1880 -v /home/hannes/Docker/appdata/nodered:/data --name mynodered nodered/node-red Quote Link to comment Share on other sites More sharing options...
system32 Posted March 18, 2022 Share Posted March 18, 2022 25 minutes ago, Hannesvz said: I see now what I think I did wrong, but I don't know how to fix it can you help me. Add /dev/ttyUSB0 to this line. docker run -it -p 1880:1880 -v /home/hannes/Docker/appdata/nodered:/data --name mynodered nodered/node-red Try the --device option: docker run -it -p 1880:1880 --device=/dev/ttyUSB0 -v /home/hannes/Docker/appdata/nodered:/data --name mynodered nodered/node-red bash See https://stackoverflow.com/questions/24225647/docker-a-way-to-give-access-to-a-host-usb-or-serial-device >I am running home assistant in docker container with mqtt, influxdb and grafana on ubuntu server Where do you need access to the device? Should the --device not be on the HomeAssistant container along with @kellerza's https://github.com/kellerza/sunsynk plugin? Sorry. my setup is different: Main RPI4 - I run homeassistant in a container, mqtt in a 2nd container and grafana in a 3rd container. RPI4 does other things as well. I have Solar-Assistant on a RPI3B connected to the SunSynk. Solar-Assistant allows it's mqtt to feed my mqtt which Home-Assistant picks up. I am looking to see if I can get more comprehensive data via RS485 directly from from SunSynk. Quote Link to comment Share on other sites More sharing options...
Hannesvz Posted March 18, 2022 Share Posted March 18, 2022 I changed my docker-compose file to this. services: nodered: container_name: nodered image: nodered/node-red:latest user: root:root restart: always environment: - TZ=Africa/Johannesburg devices: - /dev/ttyUSB0:/dev/ttyUSB0 ports: - 1880:1880 volumes: - /home/hannes/Docker/appdata/nodered/data:/data Now it just connects and timeouts all the time. Quote Link to comment Share on other sites More sharing options...
Sc00bs Posted March 19, 2022 Share Posted March 19, 2022 Definitely doesn't work with the Canbus port. There is another RS485 port on the 5kw on the bottom RHS, I seem to remember something about using that one. Would give that I go. Lights flashing on the USB adapter are a good sign for data flowing. I like to use the Inspect nodes in Node Red so that I can check that the data is flowing. I did notice that sometimes the USB ports on the Raspberry Pi seem to move around. Quote Link to comment Share on other sites More sharing options...
Hannesvz Posted March 19, 2022 Share Posted March 19, 2022 I seems to be sending data correctly but it still just connects and timeouts I have put the timeout delay to over an hour to see if it would fix it but it still has not. On the adapter the TX led flashes but the RX led does nothing. Is it possible that the adapter is wired incorrectly. I have tried multiple suggestions in the forums but none have worked. Quote Link to comment Share on other sites More sharing options...
kellerza Posted March 19, 2022 Share Posted March 19, 2022 The connector wiring is documented quite extensively on my addon’s page (link in signature) the only other thing to look out for is the slave/client id in more recent firmware Quote Link to comment Share on other sites More sharing options...
Sc00bs Posted March 19, 2022 Share Posted March 19, 2022 Check your wiring, check the plug is wired up correctly and that you have the correct wires going to the USB adapter From Updated cabling for the USB-RS485 adapter, only requires these three cables when connected up to a RJ45 wired in 568B This apparently (needs confirmation someone) also has the advantage that it will work if plugged into the CANBUS port, handy if you have a battery that connects to the RS485 port. Quote Link to comment Share on other sites More sharing options...
Hannesvz Posted March 19, 2022 Share Posted March 19, 2022 3 hours ago, kellerza said: The connector wiring is documented quite extensively on my addon’s page (link in signature) the only other thing to look out for is the slave/client id in more recent firmware Are you saying that it is not sending the correct data to the inverter. And how would I get this slave/client id. And are you revering to the unit id. This did not work for me. Quote Link to comment Share on other sites More sharing options...
werner.potgieter Posted March 19, 2022 Share Posted March 19, 2022 1 hour ago, Hannesvz said: Are you saying that it is not sending the correct data to the inverter. And how would I get this slave/client id. And are you revering to the unit id. This did not work for me. Is your inverter modbus set to number 1? Hannesvz 1 Quote Link to comment Share on other sites More sharing options...
Joerg Posted March 19, 2022 Share Posted March 19, 2022 Hi, I installed a Waveshare RS485 to ETH and use a PI with ioBroker and the modbus software adapter to read my values via RTU via TCP from my SunSynk 8kW. I used the manual to find the registers but I can't find the register to enable/disable the use of the timer frames to charge the batteries. I want to turn into Loadshedding mode automatically according Eskom Schedules. Can anyone tell me please which register it is? Thank you! Quote Link to comment Share on other sites More sharing options...
Hannesvz Posted March 19, 2022 Share Posted March 19, 2022 The thing that fixed the inverter not speaking back to me was the modbus sn was set to 0, when I set it to 01 it fixed the issue immediately. For curiosity I tried to put it back to 0 and was unable to do so. @kellerza you should add to your github that people should remember to set the modbus sn to 01 < . Thanks for helping me everyone. werner.potgieter and kellerza 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.