October 29, 20223 yr 14 minutes ago, Sc00bs said: @jacauc Would be nice to be able to not waste querying cycles to the inverter on values which do not change as quickly e.g. the Daily totals and spend more cycles on the values such as PV Power etc. I see in your example you aren't monitoring PV power. Was thinking of putting together an example with all the Inverter values and people can just # out the ones they don't require Do you think that we could write values back to the inverter using ESPhome as well? Yeah thought about that too, but I don't really know how to query it less frequently with esphome. Also... Does it really matter? I suppose we can make another modbus sensor with a less frequent scan rate, no idea if that would work though. I commented out the PV values because I don't have PV. (which is also why I have not tried writing values) If you want to add any more values to query, please feel free to add them into the code on GitHub with a pull request. Maybe we can somehow have a variable that can be set in the top of the script so that the irrelevant values are automatically ignored?
October 29, 20223 yr 11 minutes ago, jacauc said: I suppose we can make another modbus sensor with a less frequent scan rate, no idea if that would work though. I just tried this and seems to be easy enough. I uploaded the code to github
October 29, 20223 yr Author 1 hour ago, jacauc said: Yeah thought about that too, but I don't really know how to query it less frequently with esphome. Also... Does it really matter? I suppose we can make another modbus sensor with a less frequent scan rate, no idea if that would work though. I commented out the PV values because I don't have PV. (which is also why I have not tried writing values) If you want to add any more values to query, please feel free to add them into the code on GitHub with a pull request. Maybe we can somehow have a variable that can be set in the top of the script so that the irrelevant values are automatically ignored? Thanks Jacauc, will do that and will add the PV Values etc. Do you think it will be possible to write the values as well for load shedding settings?
October 29, 20223 yr 11 minutes ago, Sc00bs said: Thanks Jacauc, will do that and will add the PV Values etc. Do you think it will be possible to write the values as well for load shedding settings? I would imagine it's possible using the write_lambda function https://esphome.io/components/output/modbus_controller.html Worthwhile to look at the node red flows @Bloubul7made for writing values to see how he did it and adapt it to lambda format. Let me know if you figure something out with this, I'll try it sometime, but have a busy few weeks ahead
October 29, 20223 yr Author On 2022/10/28 at 1:28 PM, jacauc said: Instead of posting my esphome configs here, I'm uploading them to github (partly just for keeping for my own backup) Recently added all the setting values https://github.com/jacauc/SunsynkEsphome Haven't worked with Github before so will see if I can work it out I am sure it can't be that difficult and there must be a vide on it some where 🙂
October 29, 20223 yr 59 minutes ago, Sc00bs said: Haven't worked with Github before so will see if I can work it out I am sure it can't be that difficult and there must be a vide on it some where 🙂
October 30, 20223 yr On 2022/10/29 at 8:37 AM, Sc00bs said: @jacauc Would be nice to be able to not waste querying cycles to the inverter on values which do not change as quickly e.g. the Daily totals and spend more cycles on the values such as PV Power etc. I see in your example you aren't monitoring PV power. Was thinking of putting together an example with all the Inverter values and people can just # out the ones they don't require Do you think that we could write values back to the inverter using ESPhome as well? found a better way to skip updates for settings instead of creating another modbus component. Updating github now and adding substitutions at the very top of the document
October 30, 20223 yr On 2022/10/29 at 8:15 AM, Sc00bs said: Do you have an 8Kw inverter @slipx @sjlouw? Wondering if the removal of the R7 resistor is specific to the 8kw as mine would not connect with the resistor in place but some people do not seem to have that issue, most (all maybe) seem to be on the 5kw inverter. Yes its an 8KW. Working on a dashboard in homeassistant.
October 31, 20223 yr Some other ideas inspired by @StickeyTape I like the simple background he designed but also need to test with high quality pic of the system flow.
November 2, 20223 yr On 2022/10/30 at 11:44 AM, slipx said: Yes its an 8KW. Working on a dashboard in homeassistant. The power flow card (Power Distribution) is what I use.
November 2, 20223 yr 3 hours ago, system32 said: The power flow card (Power Distribution) is what I use. I was originally using that but prefer the Sunsynk system flow. I'm pretty happy with the card now. It supports HA themes and is built using SVG so scales on desktop and mobile. Edited November 2, 20223 yr by slipx
November 3, 20223 yr I am getting some weird spikes on "172 Grid External Power" and "169 Grid Power" sensors. Trying the following to filter them out which seems to be working: - platform: modbus_controller # 169 Grid Power modbus_controller_id: sunsynk name: "Grid Power" id: grid_power register_type: holding address: 169 unit_of_measurement: "W" accuracy_decimals: 0 device_class: power state_class: measurement filters: - lambda: |- float MAX_DIFFERENCE = 8000.0; // adjust this! static float last_value_t = NAN; static int count_missed_t = 0; if (count_missed_t == 3) last_value_t = x; if (isnan(last_value_t) || std::abs(x - last_value_t) < MAX_DIFFERENCE) { count_missed_t = 0; return last_value_t = x; } else { count_missed_t += 1; return last_value_t; }
November 5, 20223 yr Reverted to this - platform: modbus_controller # 169 Grid Power modbus_controller_id: sunsynk name: "Grid Power" id: grid_power register_type: holding address: 169 unit_of_measurement: "W" accuracy_decimals: 0 device_class: power state_class: measurement filters: - lambda: |- float MIN_VALUE = -8000.0; float MAX_VALUE = 8000.0; if (MIN_VALUE <= x && x <= MAX_VALUE) return x; else return {}; Also added some labels to the card.
November 6, 20223 yr Grafana 9.2.3 Canvas Visualizations can do a similar thing. https://grafana.com/docs/grafana/next/panels-visualizations/visualizations/canvas/
November 6, 20223 yr 2 hours ago, system32 said: Grafana 9.2.3 Canvas Visualizations can do a similar thing. https://grafana.com/docs/grafana/next/panels-visualizations/visualizations/canvas/ Nice. Here are the PNG and SVG files. And the draw.io file if you want to edit sunsynkv6.svg sunsynkv4.drawio Edited November 6, 20223 yr by slipx
November 6, 20223 yr If you want to try this card in home assistant follow these steps. 1. Create a new directory under www/community/ and name it sunsynk-card. If you don't have HACS installed you can create directory directly under www and reference in step 3 below. 2. Copy the attached sunsynkcard.js into the directory 3. Add the resource to your Dashboard 4. Add the Custom: Sunsynk Card to your Dashboard view. Select Show Code editor 5. Replace all the code with the contents from the card configuration file card configuration.txt 6. Scroll down to bindings and replace the sensors with your own bindings: - bind: return hass.states["sensor.pv1_power"].state + ' W' selector: '#pv1_power_186' type: html - bind: return hass.states["sensor.pv2_power"].state + ' W' selector: '#pv2_power_187' type: html - bind: return hass.states["sensor.sunsynk_totalsolar"].state + ' W' selector: '#pvtotal_power' type: html - bind: return hass.states["sensor.battery_voltage"].state + ' V' selector: '#battery_voltage_183' type: html - bind: return hass.states["sensor.battery_soc"].state + ' %' selector: '#battery_soc_184' type: html - bind: return hass.states["sensor.battery_output_power"].state + ' W' selector: '#battery_out_190' type: html - bind: return hass.states["sensor.inverter_output_power"].state + ' W' selector: '#inverter_out_175' type: html - bind: return hass.states["sensor.inverter_output_current"].state + ' A' selector: '#inverter_out_164' type: html - bind: return hass.states["sensor.aux_output_power"].state + ' W' selector: '#aux_power_166' type: html - bind: return hass.states["sensor.sunsynk_essential_load"].state + ' W' selector: '#ess_power' type: html - bind: return hass.states["sensor.grid_inverter_voltage"].state + ' V' selector: '#inverter_grid_voltage_154' type: html - bind: return hass.states["sensor.load_frequency"].state + ' Hz' selector: '#inverter_load_freq_192' type: html - bind: return hass.states["sensor.grid_inverter_load"].state + ' W' selector: '#inverter_load_grid_167' type: html - bind: return hass.states["sensor.grid_external_power"].state + ' W' selector: '#grid_external_power_172' type: html - bind: >- return parseInt(hass.states["sensor.grid_external_power"].state) - parseInt(hass.states["sensor.grid_inverter_load"].state) + ' W' selector: '#non_ess_power' type: html Maybe someone smart can package this as a proper HACS frontend resource
November 24, 20223 yr Hi, just reading through this thread and what you have achieve is brilliant quick question though - is the RS485 connection active at the same time as the RS232 that is used by the supplied wifi dongle ? I want to replicate what you are doing and I really like having local control and not being dependant on distant cloud based services and so wondered if it was an 'either/or' or whether I can have my cake and eat it - and have both at the same time ? Thanks Mark
November 24, 20223 yr Author 1 hour ago, MarkR said: Hi, just reading through this thread and what you have achieve is brilliant quick question though - is the RS485 connection active at the same time as the RS232 that is used by the supplied wifi dongle ? I want to replicate what you are doing and I really like having local control and not being dependant on distant cloud based services and so wondered if it was an 'either/or' or whether I can have my cake and eat it - and have both at the same time ? Thanks Mark Yes, dongle remain active and functional.
November 24, 20223 yr sorry forgot to add you need to create the following template sensors as well sensor: - platform: template sensors: sunsynk_totalsolar: friendly_name: "Total Solar Generation" value_template: "{{ (states('sensor.pv1_power') | float(0) + states('sensor.pv2_power') | float(0)) | round(0) }}" unit_of_measurement: 'W' sunsynk_solar_load: friendly_name: "Solar Load" value_template: "{{ (states('sensor.daily_pv_power_kwh') | float(0) - states('sensor.battery_charge_day') | float(0)) |round(1) }}" unit_of_measurement: 'kWh' device_class: energy sunsynk_essential_load: friendly_name: "Essential Load" value_template: "{{ (states('sensor.inverter_output_power') |float(0) - (states('sensor.aux_output_power') |float(0) - states('sensor.grid_inverter_load') |float(0) )) | round(0)}}" unit_of_measurement: 'W' device_class: power Edited November 26, 20223 yr by slipx
December 1, 20223 yr *NB changes on Deye firmware update from July 2022. 12kw Deye Hybrid 3 Phase (but could affect others, i dono) I tried to get this working with an esp32, eventually gave up and went with Solar Assistant. Solar assistant didnt work on the rs485 port or the meter port. But as per the instructions, the rs485 port does not comm anymore with the latest update, so in order to get communication working I had no choice but to connect to the BMS port. Its a complete pain in the ass, because i had to buy a rj 45 Splitter which looks like this: https://romtech.co.za/product/rj45-splitter-2/?utm_source=Google Shopping&utm_campaign=Google&utm_medium=cpc&utm_term=63300&gclid=Cj0KCQiAvqGcBhCJARIsAFQ5ke7_vQyNIhojrOo2LrEr_JKRqJQAqjhT1qq7w4i8h2HJrm8mqznc3TYaAoxVEALw_wcB You can find this thing on takelot, but warning the build quality is total crap. very flimsy, but got it to work after some frustration. If you go to a china shop/mall you will be able to pick up one for R10, much cheaper than takealot, and better quality. This needs to be a direct pin to pin, the black varient you find wont work. If your pins on your bms are correct and using CAN for battery, it doesnt interfere with the rs485 as they use different pins. I have both the pylontech bms cable and the Deye cable connected to the splitter then into the invertor BMS port, and then connected the invertor cable to the solar assistant pi. I also have the solar assistant pylontech console cable connected to the pi to pull in readings of the batteries, and able to view all the different packs individualy and get readings per battery. Im not sure if this update will affect other sunsynk/deye invertors but if you cant get comms, try the BMS port. Now that i know this, i want to try my esp32 again. Lastly, what is really nice about Solar Assistant is to be able to configure the battery schedule on the app, pulled in all the metrics into home assistant, and can automate of sensors as well as write to the invertor. Has anyone been able to do this with the ESP32 method? Edited December 1, 20223 yr by roadkill
December 1, 20223 yr Interesting. I don't have this problem with the Sunsynk Firmware which was updated a few weeks ago. (SW Ver.M 6.0.2.2 / S 1.7.2.4 / C E.4.2.6) Unfortunately I have not figured out how to write to the inverter using ESPHome. I'm sure it's possible though. I've also created a simpler version of the card for those that have everything on Essential and no AUX connection. Attached SVG for those who want it sunsynk-comp.svg Edited December 1, 20223 yr by slipx
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.