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

1101113151671

Comments

  • Registered Users Posts: 430 ✭✭Geeyfds53573


    Thanks @Jonathan I have a Seplos bms and not happy when SOC gets near the top - ongoing issue with them, so days when I am not here I just want to stop charge for a few hrs if sunny. Manually I just change that to run and that does the trick but can schedule a script to check SOC and then write to that holding reg to turn on and off but I can’t seem to get just the toggle bit to work via code I’ll post code later. I’m on version 340022. Charge periods are fine and amps even through code all work fine just the Stop Run I can’t figure out.

    Post edited by Geeyfds53573 on


  • Registered Users Posts: 430 ✭✭Geeyfds53573


     

    This succeeds but inverter still on STOP


      val = modbus.read_input_registers(register_addr=33139, quantity=1)[0]

        if (val>94):

            modbus.write_holding_register(register_addr=43110, value=35) # JUST TOGGLE ON 33 AND OFF 35

            print(modbus.read_holding_register_formatted(register_addr=43110, quantity=1)) #check 43110 Energy Storage Control Switch

        else:

           print("Under 95")

           



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


    Code looks fine syntactically. As regards 33 and 35, they correspond to toggling Bit01 - Time of use mode. 33 = ToU off, 35 = ToU on. There are other bits in that register too, so you need to read it before setting it.

    Possibly a stupid question, but what can't you just set overcharge SOC to 95% (or something less than 100%)? Will that stop the Seplos bombing out?


    EDIT: Would enabling Feed In Priority also resolve the Seplos issue for you? https://usservice.solisinverters.com/support/solutions/articles/36000245194-12-of-20-energy-storage-operating-modes-feed-in-priority



  • Registered Users Posts: 430 ✭✭Geeyfds53573


    Thanks @Jonathan - so it changes “auto” to “time of use” mode. I’ll test If I leave optimal income on run and just turn the “time of use” on and off does that work. I may also be mistaken but I don’t think I can set the overcharge SOC as selecting a battery not using the user defined settings? Turning on and off “Feed in priority” looks a great idea tbh I shall look into that also. Fair play thank you I need to read up on the storage modes but really appreciate the help.



  • Registered Users Posts: 430 ✭✭Geeyfds53573


    I get you @Jonathan I see the other bits in that register on the doc I’ll need to read up on this.



  • Advertisement
  • Registered Users Posts: 51 ✭✭Midlakelands


    Hi,

    I wanted to try the idea of turning on and off feed in priority on my Solis 5G hybrid inverter. After reading register 33132 I discovered that the register was 35 (00100011) with feed in off and 98(01100010) with feed in on. Basically bit 6 and bit 0 so I wrote the following quick snippet to XOR those two bit s using 65 (01000001). Now I'm not too sure of modbus etiquette when it comes to reading from the holding register or the input register so I stuck with all reads coming from 33132 and writes going to 431110.

    Seems to work with changing the inverter but just to note I'm not sure why bit 6 needs to be set as this doesnt seem to align with https://www.scss.tcd.ie/coghlan/Elios4you/RS485_MODBUS-Hybrid-BACoghlan-201811228-1854.pdf so please use with caution. I put in a time delay as occasionally I got a crc error when reading back the updated value from 33132

         print("old value is ",modbus.read_input_register_formatted(register_addr=33132, quantity=1))
          """65 is 01000001 which changes bit 0 and bit 6 when you XOR (ie between 35 and 98)"""
        val = modbus.read_input_register_formatted(register_addr=33132, quantity=1)^65
        modbus.write_holding_register(register_addr=43110, value=val)
        # wait for 4 seconds to ensure register is updated 
        time.sleep(4)
        print("new value is ",modbus.read_input_register_formatted(register_addr=33132, quantity=1))
    




  • Registered Users Posts: 37 Fred7631


    Looks like some great work you chaps are doing on this. I don't have a lot of knowledge when it comes to HA etc but I do have an instance running and have managed to get a few things being monitored and automated around the house. I have the Solis 5K Hybrid with wifi dongle that I'd like to control remotely, and if possible, add some automation to night charging times linked to the weather forecast.

    I will try and get time to read the last 13 pages but has anyone managed to achieve the above, and if so, how difficult was it, and what are the main key steps to achieve this? Cheers.

    Info in case it's important:

    Wifi Stick Serial Starts With: 405

    Current version:MW_08_512_0501_1.82

    Firmware version (main)

    003A

    Firmware version (slave)

    0029

    Inverter model

    00F3

    Post edited by Fred7631 on


  • Registered Users Posts: 51 ✭✭Midlakelands


    Hi Fred,

    I think reading the thread is a must, but if you want to have a relatively quick HA integration then definitely take a look at https://github.com/StephanJoubert/home_assistant_solarman . I believe there are members on here who are changing their battery charge times based on the weather (see the thread https://www.boards.ie/discussion/comment/118596188/#Comment_118596188) I haven't tried myself but it looks like you have all the pieces in place to do it.



  • Registered Users Posts: 37 Fred7631


    Thanks, I'll start with HA integration and start reading those threads. Thanks for the links, very useful.



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


    For me, when timed charge is enabled, register 43110 reads Value: 00003 (0x0003)

    For me, when timed charge is disabled, register 43110 reads Value: 00001 (0x0001)

    Code below doesn't seem to be persisting on the inverter for me tho. Any pointers would be greatly appreciated.

    I assume the values to write can vary from model to model and be firmware dependent.

    Thanks!




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


    There is more to this than just enabled and disabled. 43100 is U16 with multiple functions. To enable timed charging you need to set BIT01 to 1 and to disable to set it to 0.

    Timed charge used to be on register 43114 but I was not able to make ti work. As a workaround I change charge interval with registers 43143-43150. If the interval is 0 than charging is disabled otherwise it charges for the number of hours/minutes that I set.



  • Registered Users Posts: 37 Fred7631


    Well, I've made some good progress by getting a lot of info into HA and talking to the inverter via Python. I've read some values and had a general poke around. I have a couple of questions as this is the first time I've used Python or Modbus.

    I'd like to change low charge SOC values but unsure how to do this the correct way. There appears to be a few registers for Overdischarge SOC and ForceCharge SOC.

    33213 reads as 10% and 33214 reads as 8%

    and then

    43010 -> overcharged_soc

    Reads as 100? (Edit: Actually, this makes sense and it's overcharge)

    43011 -> over_discharge_soc

    Reads as 10%

    43018 -> strong_charge_soc

    Reads as 8%

    Any help greatly appreciated!

    Post edited by Fred7631 on


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


    Ah, I get you. Yeah I polled 43143-43150, but these were unchanging so I assumed I didn't need to modify those. The only change I was physically making on the Solis inverter was under timed charge, changing from stop to run.

    I'm clearly missing much in the way of background to modbus. Will go back and read up.

    Thanks!



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


    Please provide more details as these are kinda self explanatory. 43011 is your Discharge SOC and 43018 is FOC. They both depend on each other. FOC cannot be higher than SOC. SOC has a range 10-40 and FOC min value is 5. These potentialy could change with firmware.



  • Registered Users Posts: 37 Fred7631


    Thanks, I did manage to change these values via Python this evening in the end. Why are there two registers for the same thing?



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


    They are not the same. SOC dicharge is how much the battery is allowed to discharge to. If battery is not charge for a long time it will slowsly drain. This is were FOC comes in. FOC is the very borrom line. Ifbattery charge falls beyond FOC value, inverter will force charge the battery to SOC value to avoid it being damaged.



  • Registered Users Posts: 37 Fred7631


    Sorry, I should have been clearer. Yes, I know that bit but there are two registers for the same thing. In the end, I changed 43011, and that in turn changed 33213. Why are there two registers relating to the same thing?



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


    One is holding(RW) and the other is input(RO) register. They may store same value but they may serve diferent purpose. You have to remember that your use case is not the only case the way inverter is used(like daisy chaining multiple inverter together). We do not know the full internal implementation of modbus in the inverter and manufactures do take many liberties the way they implement modbus.



  • Registered Users Posts: 37 Fred7631


    Thanks reklamos, it's a steep learning curve but an enjoyable one. My next task is some automation with Nodered MQTT.

    Do we have a current list online somewhere of all the regsiters that we can all contribute to? I have the Hybrid 5K.



  • Registered Users Posts: 51 ✭✭Midlakelands


    Hi,

    I'm using https://www.scss.tcd.ie/coghlan/Elios4you/RS485_MODBUS-Hybrid-BACoghlan-201811228-1854.pdf which I should note is not authoritative (ie it's not official from the manufacturer) so as said above could change with newer firmware updates.

    [edit] I just realized you were talking about contributions maybe you could publish to one of the existing github repos? I know that https://github.com/StephanJoubert/home_assistant_solarman has inverter specific yaml files which might suffice?



  • Advertisement
  • Registered Users Posts: 37 Fred7631


    Thanks, yes I saw that one but doesn't have 33213 or 43011 etc so I imagine that document is missing quite a lot now. Maybe most of the registers are known that people want and it's not too important. Just so happens the few I wanted weren't listed in documents but I did find them in this thread.



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


    No luck again this weekend.

    Setup Solismod and node-red to replicate reklamos’ solution. Registered for charging start and stop look to be setting, but the battery charged last night. Checking the settings on the inverter itself and it looked like nothing had happened at all!

    ah well! The hunt continues.



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


    First set node red to trigger timed charge manualy and verify if that works. If it does than you can start automating it.

    I have changed my charging based on weather forecast. It does need some tweaking as it is not exact science but it has been working pretty well so far.




  • Registered Users Posts: 37 Fred7631


    Thanks for this. I'm trying to do the same thing but have (hopefully) achieved it in HA with scripts/automations/MQTT. I'm using the Forecast.solar integration. I've added the scripts to my page so I can press them manually if needed.

    Basically, I've done it this way for now as a test.

    If at 11:30PM 'Energy Production - Tomorrow' is above 10kwh then set timed charge hour to 2.

    This basically reduces my charging slot by 1 hour / 20% and charges my battery from 10% to 90% rather than 100%.

    The next thing I need to do is take the current SOC at 11:30PM into account and add that to the above. Not immediately important at the moment as I'm using most of the Solar and Battery every day but I will be adding more batteries and solar in the next couple of months. Also handy to have this all sorted for when I'm away and not using as much energy.

    Would you mind sharing your NR flow? Would be really useful to see how it all works.




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


    I use https://solcast.com/ for forecasting. They allow 50 API calls in 24hours which is sufficient. I do poll every 30 mins and drop data that I need to MQTT. In HA I have sensors that subscribe to MQTT topics. Node red pulls the data constantly but the charge desicion is only taken at 2am as this is when the cheapest rate starts. It takes estimated forecast and SOC values and based on them decides at what current to charge the battery. Charge interval does not change(2-5am). If there is enough juice in the battery and forecast looks good it does not charge at all. I'm attaching node red flow. This will not work out of the box and you will need to modify it to fit your setup.




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


    Thanks for sharing! Would you mind explaining your GetEstimate function?

    I can try to make assumptions but it’s a dangerous game that.



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


    It takes my average use of 17kWh subtracts the estimate generation and battery soc.

    There are some conversions that I do from string to float with 2 decimal places(it is overkill 1 shoud be suffcient).Also divides forecast figure by 2 as this is what works for me. Converts SOC from % to kWh. First subtracts 20 as this is what I let battery to discharge to and then divides by 5(in my setup 5%=1kWh)



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


    I wondered if that’s what the 17 was for alright. Thanks for the explanation!

    been a while since I looked at NodeRed. Been using HomeKit for lighting automation to date.



  • Moderators, Motoring & Transport Moderators Posts: 6,522 Mod ✭✭✭✭Irish Steve


    Today was interesting, I decided to see if an Intel NUC that won't run Win 11 would work with Home Assistant. I had a spare SSD, so downloaded the lastest version of HA on to the laptop, and then used a USB to SATA external connector to put the image on to the SSD. Then took the windows disc out of the NUC, put the new HA copy in to the processor, and powered it up, and to my amazement, after a lot of scrlpt information scrolled up the screen, I endediup with a HA prompt on the screen,

    The next move was to load the latest version of the HA app on to my phone, and take it from there, and having created an account for HA, to my amazement, the phone offered me an option to connect to the HA server, and then proceeded to find some devices on the network, and give me options to be able to see the various devices in more detail. To my surprise, I was able to connect to my Brother Ink Jet, and then tell it that I want to monitor the ink levels, which it did without any issues, and at some stage, it looks like I can also do some things with the LG Smart TV and sound bar.

    Next step is to install the Shelly 3EM that's sitting on the kitchen table, and see if it's in range of my WiFi system, if it is, then HA should be able to see it, and that will be the first step in deciding how much capacity I will need for the Solar system. If I can't see the Shelly, and it's some way from the WiFi hubs, then I will have to get a repeater for the garage.

    I was surprised at how well the HA system installed, and how easy it was to get it working at basic level. I suspect I will be back before long to find out how to do more complex things, if nothing else, controlling the heating and hot water will be worth looking at, but that will need some WiFi enabled time clocks to replace the existing units that are there, and I may well also look at using a Shelly device to control the immersion heater during the summer to give us night rate hot water.

    Could get to be interesting.

    Shore, if it was easy, everybody would be doin it.😁



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


    Had a play around again last night but the timed charge settings don’t seem to make any difference.

    Python appears to be working, as when you do a read on the registers, the new values return back but has no bearing on the charging behavior of the system.



Advertisement