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

1246771

Comments

  • Registered Users, Registered Users 2 Posts: 2,541 ✭✭✭bullit_dodger


    You got 2.4Kw today?

    A meager 0.768Kw for me off 5.3Kwp (but as mentioned split East/West). What's your layout again graememk?

    Edit: 8.6Kwp (NE/SW) - I forgot that it's all in the spreadsheet now. Doh!



  • Moderators, Home & Garden Moderators Posts: 6,210 Mod ✭✭✭✭graememk


    briefly! then it got dark.

    8.6kwp, NE/SW split 50:50, low slope.



  • Registered Users, Registered Users 2 Posts: 793 ✭✭✭reklamos


    I had 2.4kW with 4.5kW facing south today. But yesterday was able to hit 2.5kW and generate 7.2kWh. January looking pretty goof so far.




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


    What registers are you using for your battery usage? 33133/33134 (inverter figures) or 33141/33142 (BMS figures)? Seems to be a slight lag with the BMS figures if you are pulling them from inverter. Might not be an issue for you if you are pulling directly from the Pylons?



  • Registered Users, Registered Users 2 Posts: 793 ✭✭✭reklamos


    For this specific graph I do not use any of these. I create my own modified metric(battery_power_modified) from 33135(battery_current_direction) and 33150(battery_power_2). Using this I do not see lag in the graph.

    33133/33134 is not as precises as 33141/33142 and in my case is 0.4v higher. I have compared the values with the one on pylon itself and 33141/33142 is accurate and it should be as it is provided by BMS. There could be lag as we do not know how often inverter is polling from BMS where as 33133/33134 is read by inverter itself on battery ports.



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


    Thanks. Yes, that is what I noted too. A bit of a lag on 33141/33142, but your approach of using a combination of 33135 and 33149 is good, and probably enough detail for my needs.



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


    @bullit_dodger Re your post here (I've no idea how to cross-quote on Vanilla): https://www.boards.ie/discussion/comment/118457512/#Comment_118457512

    Did you see this? https://community.home-assistant.io/t/givenergy-battery-inverter-home-power-things/266291/17

    The code isn't published anywhere at the moment, but you can extract the code from the docker image.

    user@host:~$ docker create --name=givtcp britkat/giv_tcp-ma:refactor

    user@host:~$ docker export givtcp > image-fs.tar

    GivEnergy inverters also seem to use High Flying based WiFi/Serial SOCs, but use Modbus TCP rather than encapsulated RTU. Code is in Python and looks to be a decent state.



  • Registered Users, Registered Users 2 Posts: 2,541 ✭✭✭bullit_dodger


    Ahh nice one mate. The way that I've been doing is via the REST API and I grab the data via a bit of powershell.

    # Set system variables
    $baseUri = "https://www.givenergy.cloud/GivManage/api/"
    $json_extration_folder = "C:\Tools\GivEnergy\Cloud_Extract\"
    $filename_Datetime = get-date -format "yyyyMMdd_HHmm"
    $Inverter_date = get-date -format "yyyy-MM-dd"
    
    #---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    # Login to GivEnergy Cloud and create a session. 
    #---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    $loginUri = $baseUri + "login"
    $authMode = "Windows"
    $tokenRequestBody =
    @{
      "account" = "xxxxxx"
      "password" = "xxxxxx"
    }
    $output_filename = $json_extration_folder + "Login_response_"+ $filename_Datetime + ".json"
    $login_response = Invoke-RestMethod -Method POST -Uri $loginUri -Body $tokenRequestBody -SessionVariable "MySession" 
    
    #---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    # Download the Inverter API information
    #---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    
    # Get the getInverterRuntime
    $loginUri = $baseUri + "inverter/getInverterRuntime"
    $tokenRequestBody =
    @{
      "serialNum" = "xxxxxx"
    }
    $output_filename = $json_extration_folder + "InverterRuntime_"+ $filename_Datetime + ".json"
    $getInverterRuntime = Invoke-RestMethod -Method POST -Uri $loginUri -Body $tokenRequestBody -Websession $MySession -Outfile $output_filename
    
    

    and then it returns a JSON file, which I then dump into a FoxPro database (old skool me) and I can slice/dice it at will. I don't have a "proper" JSON deserializer, so I had to write my own.

    With the GET api's I can modify the charge setting, timings to charge/discharge etc. although I'm not doing any of that at the moment. One of my pet projects which this is leading me to is interrogate the Met Eireann API and then figure out a "expected" generation for the next day and figure out the battery charge level.

    In theory like a few others I could do a few things with smart plugs - but idea in the infancy with me at the mo.



  • Registered Users, Registered Users 2 Posts: 2,742 ✭✭✭yankinlk


    I was gonna post up had anyone worked out how to do this yet... come late March or April time I can see needing to Adjust night charging power so I don't end up over filling battery back to grid.



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


    You've a Solis Hybrid, right? In that case, you can do this already using pysolarmanv5. You can get details of the Holding registers from Solis Support under NDA, or someone from TCD has translated them and posted them here. If you're handy with decompiling APKs, there is also a complete listing embedded in the Solis Cloud APK.

    I am not aware of a way to target SOC on Solis Hybrids, but you can emulate it by reading current SOC, and then setting charge rate and charge duration accordingly.



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,541 ✭✭✭bullit_dodger


    I think you guys with the solis inverters have a harder time of it than I do. Reading registers etc, sure it's doable, but it would seem to be a lot harder than parsing or posting a bit of JSON. I'm impressed at the work that your doing to be fair. Not sure I would have the patience for it. That said, I do think I'll have a look at what you posted Jonathan as for those times where the data in the cloud for me are zeros, it might be an "alternative channel" for me to grab the live data. Dunno - if it's a lot of work I might just keep what I have. My biggest issue with all these things is the fecking authentication methods that you have to figure out. Once you get that sorted the rest is easy, but getting that first "success" is the tricky one.

    yankinlk, so the idea that I have was to send off a API call to Met Eireann (this part I've done like as follows)

    That will return a "Radiation" column for every hour. I then add all those up and come up with a Radiation value for the day. What I've highlighted in red above.

    What I'm planning is take the average radiation forecasts over the past 10 days, along with the "actual" generation from the inverter to work out what the expected yield in KwHr is for the day. You have to average the last 10 days, as with the way the sun changes throughout the year the angles that you ha with your panels mean that your production will wax/wane through the year, so you can't just say 1000 radiation = x Kwhr. I can then use the battery API to set the battery level to charge to.

    Now I should say, I did the math on this. You might save a tenner a year optimizing the battery charge levels. Right now it's 100% charge at night for me, and in Feb it's likely to be the same, then very quickly for maybe a month in March you might have a couple of marginal days where it's debatable what to charge from night, and then come April, it'll be charge from panels. For the days in march you could adopt a "just set to 50%" and back both horses. So the money you save doing all this optimization work is probably a tenner or so a year.

    That's not why I'm doing it of course. For me the value/fun is in the doing and getting it to work.



  • Registered Users, Registered Users 2 Posts: 2,742 ✭✭✭yankinlk


    Thanks @Jonathan and @bullit_dodger I am so impressed with what both of ye have done (or are working towards!) this forum is great. I will liekly go the lazy route this year - ie in march cut back the charge rate manually... its easy for me - no need to climb the attic to set it.



  • Registered Users, Registered Users 2 Posts: 793 ✭✭✭reklamos


    Playing with registers is only needed initially. Once you figure out what data you need then you can format it in any form you want. In my script after reading all the registers that I want, I create JSON object that ontains all the data and push it to MQTT. Everyone can decide how to present the data be it JSON, CSV etc. At hardware level it is still modbus. Reading cloud API could be sufficient for some but for me the lag, data aggregation and dependency on the cloud was no enough.

    Now since you working on pulling data from met. Can you share the info how you do that, I see some urls but have not looked how ti actually works.



  • Registered Users, Registered Users 2 Posts: 2,541 ✭✭✭bullit_dodger


    That one is easy mate. Met Eireann's API takes the Latt/Long as a parameter and returns you some XML. E.g. fire this into your browser (or click the link below)

    http://metwdb-openaccess.ichec.ie/metno-wdb2ts/locationforecast?lat=53.27;long=-6.32            

    Just change the lat/long values for your location and you should get back a localized forecast for your location. If you can sort out the registers stuff (which I don't care what you say - it's hard), you'll have no issue with the Met Eireann stuff. That negative value for "long" looked wrong to me too, but west longitudes are officially referenced that way.

    I've been storing the xmls it returns once an hour every hour since August. Some 3,200 records at the moment. From that I'll be able to average out the radiation levels for specific times of year, see how the forecast for tomorrow have changed over time. My original degree was in mathematics (not computers) so while I don't call it "fun"..... it's kinda interesting to me to understand how it works. But yeah, not for everyone I grant you :-)



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


    In your travels, did you guys manage to update the discharge SOC via the script?

    Currently the battery is set to discharge to 30% but starting to see it fill up all the way recently so was wondering how to update it back to 10% via the script.

    Any idea which register it is and can the script do that?



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


    Yes, you can do that using Modbus. Use function code 3 to read the registers and function code 6 to write.

    43010 -> overcharged_soc

    43011 -> over_discharge_soc

    43018 -> strong_charge_soc



  • Registered Users, Registered Users 2 Posts: 315 ✭✭john__long


    So glad I found this thread! :D Have been scraping the data every 5 mins of the cloud and pushing to Grafana. Something more real-time, as well as pushing commands back up into the attic, would make my Home Assistant more fun! :D

    Anyone know how to update your WiFi dongle, or if you can? Getting this error back:

    Cannot read registers 33022 length 19 V5FrameError('V5 frame contains invalid a Modbus RTU frame prefix'

    I've setup a RPi with the official touchscreen on the hall table so I can see what's doing on. All powered by Home Assistant running on device, with some help from a small MQTT server in Azure.

    Have been experimenting with the domestic usage, i.e. excluding power going to charge the batteries but it's a bit rough. The time lag of 5 mins doesn't help.




  • Registered Users, Registered Users 2 Posts: 793 ✭✭✭reklamos


    What inverter model do you have? It could be that the registers on your inverter do not match. Try to read single register with sample code. Or loop through them this will give better picture where the registers are.



  • Registered Users, Registered Users 2 Posts: 315 ✭✭john__long




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



    You want to get yourself one of these for live power consumption https://shelly.cloud/products/shelly-em-smart-home-automation-device/ it hooks right into home assistant very easily.


    Not getting the right numbers (or I am and they are not converted right?)

        print(modbus.read_holding_registers(register_addr=43010, quantity=1))
    
        print(modbus.read_holding_registers(register_addr=43011, quantity=1))
    
        print(modbus.read_holding_registers(register_addr=43018, quantity=1))
    

    And I get back these 3 values:

    [100]
    [19]
    [10]
    

    I expected 29 as that is what I have my min SOC at, battery is in backup mode so it stops draining at 29%

    Any idea why I'm not seeing that? Unless min SOC is 10% and 19% is the other charge it reserves for AC backup???

    Post edited by SD_DRACULA on


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


    Turn on verbose mode and PM or post up the SEND and RECD frames.

    In other news, what screen/device is that you're using? Anything more specialised than an old tablet? EDIT: just reread your post. Looks good for RPI. Is that custom mount/frame?



  • Registered Users, Registered Users 2 Posts: 793 ✭✭✭reklamos


    If you have battery reserve configured then read 43024



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


    Yup that one does come back with 29 which should be correct.

    So for updating is it just this:

    print(modbus.write_holding_register(register_addr=43024, value=10))
    

    If I want to change that 29 to 10 for example?



  • Registered Users, Registered Users 2 Posts: 315 ✭✭john__long




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


    Best for home automation control is a 10" tablet and hook it up to the 12v on your alarm panel via a 12v to 5v adapter behind the wall for a seamless integration.




  • Moderators, Home & Garden Moderators Posts: 6,210 Mod ✭✭✭✭graememk


    I dont need it, i dont need it, i dont need it... - Its out of stock (the screen)



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


    That is obviously impressive, and not sure if you've seen this before, but there is an Home Assistant ingreation that already does this. I haven't used it myself yet (no PV yet) but even if you want to do it yourself you might want to have a look and check the logic they are using.

    https://www.home-assistant.io/integrations/forecast_solar/



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


    It's hit and miss, I've been using it for a while.

    Today it's a total miss, overcast for the whole day in Dublin I'd say and estimates 10kwh 😬




  • Registered Users, Registered Users 2 Posts: 315 ✭✭john__long


    Took me a while to get back to this. Verbose mode enabled.

    Totally new to modbus. Going to have to do some reading. Every day a school day! :D


    2022-01-15 11:40:53 DEBUG   Scrapping registers 33022 length 19

    SENT: a5 17 00 10 45 00 00 2a 46 dc ef 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 04 80 fe 00 13 f9 f7 2f 15

    RECD: a5 39 00 10 15 00 38 2a 46 dc ef 02 01 50 a2 fc 02 2d 51 00 00 75 10 e6 5e 01 04 26 00 16 00 01 00 0f 00 0b 00 2e 00 2b 00 00 00 00 0d 39 00 00 00 0e 00 00 00 12 00 01 00 03 00 00 00 0e 00 00 08 d3 0f 88 aa 15

    2022-01-15 11:40:53 ERROR   Cannot read registers 33022 length 19 V5FrameError('V5 frame contains invalid a Modbus RTU frame prefix')



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 315 ✭✭john__long


    My serial begins with 402. Seeing this being referenced for 402 serial WiFi dongles: https://github.com/t3kpunk/Omniksol-PV-Logger



Advertisement