Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Solar PV Monitoring/Automation Thread

Options
1235770

Comments

  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,114 Mod ✭✭✭✭Jonathan


    Thanks for posting this. This is a bug in the pysolarmanv5 frame validation. At the time I understood that all modbus RTU frames were prefixed by 0x61, but I was doing more digging during the week in the SOLARMAN Smart app, and this is not true. I've pushed a commit to fix this now. I have to further work on the validation before the next release, but the latest code from master should work for you now.

    Below is the Modbus Response that was returned from your logger. All looks good. https://rapidscada.net/modbus/ModbusParser.aspx




  • Registered Users Posts: 315 ✭✭john__long


    Thanks for having a look. I’ll circle back to this project in a bit. Would need to refactor some things in Home Assistant to bring this online.

    I get so hung up on what to name my MQTT topics! 😅



  • Moderators, Home & Garden Moderators Posts: 5,847 Mod ✭✭✭✭graememk


    I need to stop playing with home assistant and go to bed lol.



  • Registered Users Posts: 793 ✭✭✭reklamos




  • Registered Users Posts: 315 ✭✭john__long


    Thanks for bumping the PySolarman project with the v5 update. Gonna have a play with this again this weekend!



  • Advertisement
  • Registered Users Posts: 1,725 ✭✭✭tnegun


    Finally got some time to look at this while the inverter was on! Thanks so much for PySolarman I was able to hack together some python quick enough to read the current AC kw output and push this data into my EmonCMS as a new feed. I'll keep it like that while I play with it. I'm polling every 10 seconds and get the odd error returned but am handling that.

    The next steps for me are to only poll white the inverter is on and then add the metrics from both my arrays. I notice that the inverter returns 20w once it's powered up and again for while before it powers down but I doubt it's actually generating anything is this a known behaviour?



  • Registered Users Posts: 2,481 ✭✭✭ECO_Mental


    Just got my Shelly EM a few days ago (after waiting 3 weeks to be delivered..) and got it installed into the main fuse board yesterday. To be honest the thing I'm most impressed is I am still alive to tell you guys the tale...🤗 The Shelly EM requires you to hard wire the power directly into one of the trips and then attach your CT clamps all within the main consumer unit. With two live feeds the Solar PV and the main ESB you had to be VERY Careful. I tripped the main switch and the isolator for the PV but still....

    Anyway got one clamp on the main ESB incomer and the other CT on heat pump. I already have the Solar PV data from the cloud so I thought there was no point in logging this. I put the CT clamp on the incomer before the main trip switch and before the PV feed so in theory it should read negative values if I am exporting as I had no exposure of this with my basic Solis inverter.

    The PV has been a disaster over the last day so I don't I think I exported anything but if you look carefully at around 11:30 am I exporting about 50 watts for about 10 mins...so I think it works.

    All my data is being managed through Home Assistant on a PI4 and I'm using InfluxDB and then Grafana. HA picked up the Shelly straight away so I was impressed with that. The graph below shows in green the total house electricity consumption and the yellow is the heat pump and the blue is the Solar PV. Only getting used to Grafana so need to fancy up my graphs a bit.

    What shocking is the heat pump is about 50% of my energy consumption atm. and most of that is is heating the water in the 300 litre tank for the 30 minute showers my two kids have at least once a day if not two 😥


    6.1kWp south facing, South of Cork City



  • Registered Users Posts: 1,725 ✭✭✭tnegun


    So my initial script is working well, it needs a serious amount of refactoring and some additional redundancy built-in but it has run unattended for 24 hours. This is today's output solar/orange is the Emon Pis CT clamp(it was reading about 10w in excess so I manually calibrated it) and solis/blue is being polled from the inverter. I was polling at 10 seconds but something funny was going on with missing data so for now it's at 5-second intervals. Probably overkill but it hasn't broken anything yet! The phantom 20w shows as soon as the inverter powers up and before it shutdown but this is present on Solarman cloud too. I'm happy progress so far!



    Solarman site for comparision




  • Moderators, Home & Garden Moderators Posts: 5,847 Mod ✭✭✭✭graememk


    Ah the missing data!

    When you setup your feed, set it to 15 seconds not 10




  • Registered Users Posts: 1,725 ✭✭✭tnegun


    Thanks for that. Mine were set to 10 seconds so I'd kind of stumbled on it with the polling frequency. I still get the very odd missing data but I suspect that's my crude error handling where if I get an error from the pysolarmanv5 function (is the correct term?) I back off and wait 5 seconds before trying again so the interval exceeds 10 seconds. I don't get too many and now that the polling interval aligns with what the feed expects it's 99% good.

    Can anyone see a register to pull what kw each string attached to the inverter is generating? I can get the DC V and Amps so may end up calculating it but was wondering if anyone figured out if it was available from the inverter directly.



  • Advertisement
  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,114 Mod ✭✭✭✭Jonathan


    Yeah, the data logging sticks send an occasional unprompted "keep-alive" frame which kinda mucks things up. I have an idea on how to implement error correction to handle them without raising exceptions. Tied up on other work at the moment so on the to-do list for now.

    As regards the power of each string, I don't think this exists. Only a DC total power. You'll have to calculate them I think.



  • Moderators, Home & Garden Moderators Posts: 5,847 Mod ✭✭✭✭graememk


    Yeah you'll have to calculate it, but it's simple when you have them in emoncms anyway



  • Registered Users Posts: 2,481 ✭✭✭ECO_Mental


    Happy with the Shelly EM and my set up and it records the PV that goes back to grid as a negative value. Looks like I had a bit of a problem but the Solis PV data as it wasn't downloading for the first half of the day. I think the issue was the HACS integration in HA which had a Solis update and I never restarted HA to get it working. Anyway The graphs here really show how much the A2W heat pump is the main driver of energy in my house.


    6.1kWp south facing, South of Cork City



  • Registered Users Posts: 793 ✭✭✭reklamos


    on Hybrids it is 33057-33058, it shows total DC input power in Watts



  • Registered Users Posts: 1,874 ✭✭✭garo


    I have a Growatt inverter and am interested in pulling the data into a grafana dashboard. The Growatt website used to provide historical data until late last year but they took away that functionality and now I don't have historical records any more. Additionally I also have a Seplos BMS that I would like to monitor/control from my desktop. I am assuming the latter would require NodeRed and a pi or similar.

    I could scrape data by polling the growatt website periodically. Or I can change the server address that the RF logging stick talks to and consume the data locally (and optionally forward it to the original server). Any thoughts on what might be the better option? I am loath to add a second point of failure as I have been having some issues with my local network. The server connects off a powerline adapter (I know I know! I have a roll of Cat6 waiting for me to install).

    I think a number of people here have a Seplos BMS already. Ideally I would maybe have a Pi that talks to the Seplos on the RS485 port and allows me to measure and control it remotely.

    Thoughts/suggestions?



  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,114 Mod ✭✭✭✭Jonathan


    Check to see if the Growatt inverter has a Solarman data logging stick. If it does, you could possibly use pysolarmanv5 to poll it remotely without any requirement to mess with existing monitoring or wiring. Check to see if port 8899 is open. That is a good initial indicator.

    Don't have a Seplos, so can't help in that regard.



  • Registered Users Posts: 793 ✭✭✭reklamos


    So my plan for Seplos is to use elfin Modbus RTU to TCP adapters as they are compact, cheap(15Euro) and you can have them in with Ethernet port or WiFi. I have used them in the past and they work very well. RPi is also an option but for me it is too much hassle.

    For Growatt, pick what suits you best. If you want upto date and detailed data then pull it from inverter, if that is not important then scraping Growatt website can be sufficient for you.



  • Registered Users Posts: 793 ✭✭✭reklamos


    Did some coding today and was able to come with a simple code that allows me to change Solis settings from nodered. The main things I needed to automate was timed charging and also update inverter time, since mine drifts overtime.

    Testing looks good so far. Will see how it will work overnight.



  • Registered Users Posts: 1,874 ✭✭✭garo


    Growatt uses a proprietary comm device. https://www.alternergy.co.uk/growatt-shine-link-wireless-monitoring-device

    https://www.ginverter.com/Monitoring/10-664.html

    I have the Shinelink option here so the stick uses RF433 to talk to the box which communicates using the internet. Port 8899 is not open.



  • Registered Users Posts: 1,874 ✭✭✭garo


    The elfin Modbus seems like a good idea. I did some preliminary research on the RPi route and you are right it did seem like a lot of hassle.

    Let me try scraping the website periodically.



  • Advertisement
  • Registered Users Posts: 1,874 ✭✭✭garo




  • Registered Users Posts: 2,234 ✭✭✭SD_DRACULA


    This is interesting alright, is it running via Home Assistant? Assuming it can be used to change the discharge % etc as well?

    Maybe share the flow with us 😀



  • Registered Users Posts: 793 ✭✭✭reklamos


    Here it is https://github.com/NosIreland/solismod it has worked as expected overnight.

    You can add registers that you want to modify and create your own naming convention for topics. I use NodeRed for my automation and the example provided is with it, but anything that can publish to MQTT can be used. As long as script can subscribe to a topic on your MQTT server it should work.

    Post edited by reklamos on


  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,114 Mod ✭✭✭✭Jonathan


    Great stuff. Glad to see you're using Modbus FC06. 😉

    I found a bug last night which means that FC16 will only work for a particular message size. I'll fix that in the next release.

    Post edited by Jonathan on


  • Registered Users Posts: 793 ✭✭✭reklamos


    I cannot think of a scenario where FC16 could be used in automation.

    BTW I have submitted issue https://github.com/jmccrohan/pysolarmanv5/issues/2 for writing single holding register also. Have a look when you have time. To get away I just commented 'value = self._format_response(modbus_values, **kwargs)' in 'write_holding_register function'



  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,114 Mod ✭✭✭✭Jonathan


    Thanks. Have fixed both that and the FC16 issue now with v2.3.0.

    As regards FC16, it is handy to be able to sync the datetime values in one go:

    timestamp = list(map(int, time.strftime("%y %m %d %H %M %S").split()))
    modbus.write_multiple_holding_registers(register_addr=43000, values=timestamp))
    

       



  • Registered Users Posts: 2,481 ✭✭✭ECO_Mental


    HA and the Solis Portal integration is being give me trouble over the last week or so, it seems to be getting a daily version updates now from HACS and they cant seem to get it to work consistently. I have not being getting readings for the last few days

    To be honest though I am thinking of getting another ShellyEM and to monitor my PV with that. I am impressed with the one I have and it gives you instant live readings and it would integrate nicely with my existing ShellyEM readings. Also the second channel in the shelly I can log my utility room plug circuit which has the washing machine and the dryer and a few other bits and bobs so its worth logging this circuit.

    Only issue is possibly waiting three weeks for it to show up



    6.1kWp south facing, South of Cork City



  • Registered Users Posts: 2,234 ✭✭✭SD_DRACULA


    I have been using a node-red scraper that connects to Solis portal and didn't have many issues bar the odd time when the data is not refreshing on their side during maintenance etc which will happen to either solution anyway.

    https://flows.nodered.org/flow/1a1e2bac1ecfe8f40527ad930fe788f0



  • Moderators, Home & Garden Moderators Posts: 5,847 Mod ✭✭✭✭graememk


    Only drawback is that you'll not see the solar only. Just what comes from the Inverter be it solar or battery.

    Have you tried talking to the wifi logger directly with code from Jonathan and reklamos has done a docker container that publishes to mqtt..



  • Advertisement
  • Registered Users Posts: 1,725 ✭✭✭tnegun


    I think direct interrogation of the Wifi logger is the way to go you can get so much more info than just the current power from the shelly. I'm pushing it into Emoncms then pulling that info into HA. The solis feed is polled directly from the Inverter and each of my strings PV1/PV2 watts is calculated from the voltage and amps for those strings again pulled directly from the inverter. It should be much more reliable and accurate than depending on pulling from the Solarman site.




Advertisement