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

1568101171

Comments

  • Registered Users Posts: 129 ✭✭fael


    Odroid is back in no time.

    To put a number on it, I just hit the restart button in HA and started a stopwatch. I was logged back in in 29 seconds.



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


    Not sure what pi you're using but mine is back in 30 seconds or so.



  • Registered Users, Registered Users 2 Posts: 3,971 ✭✭✭mp3guy


    RPi 4, super slow. How many integrations do you have? I have 10 official ones, 7 custom, well over 200 entities in total, 20 automations. 30 seconds is pretty slow tbh.



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


    About 35 integrations, over 100 automations/scripts and devices/entities like 500

    Everything in my house is basically connected to HA



  • Registered Users, Registered Users 2 Posts: 3,971 ✭✭✭mp3guy


    35 is extensive, what's the full list? Curious if I'm missing out on something.



  • Advertisement
  • Registered Users Posts: 129 ✭✭fael


    So I'm just starting this whole journey to get my Solis data into HA. I have used Jonathan's script to query all the registers and have exported relevant values to Excel. Now I have to figure out which register means what.

    In order to keep it simple, I would like to us the Solarman Integration (StephanJoubert/home_assistant_solarman: Home Assistant component for Solarman collectors used with a variety of inverters. (github.com)) so that HA/HACS should do all the heavy lifting and I just tell it what registers to read.

    However I see that Jonathans script refers to the registers in a decimal value (for example 33022), but the Solarman Integration uses values like 0x0003. What kind of unit is the 0x0003? I'm trying to convert my decimal values into those. Any suggestions?



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


    I just used his script directly on a cronjob that runs on a pi zero and sends all the data to HA via MQTT, but let me know if you get this to work too, would be nice to run it all from HA. I did come across this repo but same issue, they don't have Solis mappings.



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


    0x prefix refers to hexadecimal. I'm working to create the Solis mappings and integrate pysolarmanv5 to that integration as time allows. See issue #8. As it currently stands, you'll need to manually amend the modbus function code. See my fork for details.



  • Registered Users Posts: 129 ✭✭fael


    Cheers. Just saw your conversation in issue #8. That would be fantastic. Wish I had some skills to be able to contribute.

    Struggling getting this going as it stands :) I'll have a look at your fork.

    With regard to hexadecimal, that was my first though but discounted it. I though for example the in Stephan's version he uses 0x006C for Daily Production, which would be register 108? Didn't make sense to me at the time. But maybe his standard device in parameters.yaml has such low numbers.

    Thanks for clarifying.

    The registers I'm seeing in my hybrid Solis 6kW are 33000 and higher.



  • Registered Users Posts: 129 ✭✭fael


    This could be of use to someone starting out. My Python is extremely basic, but I mutilated the reklamos/Jonathon script into something checking all the registers and then writing every register that gets returned with a value that is not 0 (so there could be false negatives) into a .csv file. Easy to work with in Excel or similar then.

    """ A basic client demonstrating how to use pysolarmanv5."""
    import csv  # to write to csv file
    from pysolarmanv5.pysolarmanv5 import PySolarmanV5
    
    
    # User variables. Serial is for WiFi-stick, not inverter. For filename use \\ instead of \.
    ip = '192.168.000.000'
    serial = 1234567890
    filename = 'C:\\<your path>\\found_registers.csv'
    
    
    def main():
        # Setting up PySolarman instance
        # Note: Only IP address and S/N of data logger are mandatory parameters. If port,
        # mb_slave_id, and verbose are omitted, they will default to 8899, 1 and 0
        # respectively.
        modbus = PySolarmanV5(
            ip, serial, port=8899, mb_slave_id=1, verbose=0)
    
        # Query registers, results added to list
        print('Querying Input registers...')
        found_registers = []
        for x in range(30000, 39999):  # default = 30000 - 39999
            try:
                if modbus.read_input_registers(
                        register_addr=x, quantity=1) != [0]:
                    print('Input register found at ' + str(x) + ', value ' +
                          str(modbus.read_input_registers(register_addr=x, quantity=1)[0]))
                    found_registers.append(
                        ['input', str(x), modbus.read_input_registers(register_addr=x, quantity=1)[0]])
            except:
                continue
    
        print('')
        print('Quering holding registers...')
    
        for x in range(40000, 49999):  # default 40000 - 49999
            try:
                if modbus.read_holding_registers(
                        register_addr=x, quantity=1) != [0]:
                    print('Holding register found at ' + str(x) + ', value ' +
                          str(modbus.read_holding_registers(register_addr=x, quantity=1)[0]))
                    found_registers.append(
                        ['holding', str(x), modbus.read_holding_registers(register_addr=x, quantity=1)[0]])
            except:
                continue
        print('')
        print('Total registers found is ' + str(len(found_registers)))
        print('Results have been written to file: ' + str(filename))
        print('-------------END OF SCRIPT-------------')
        print('')
    
        # Setting up and writing to CSV file, the description column will be empty.
        column_titles = ['Type', 'Register', 'Value', 'Description']
    
        with open(filename, 'w', newline='') as csvfile:
            csvwriter = csv.writer(csvfile)
            found_registers.insert(0, column_titles)
            csvwriter.writerows(found_registers)
    
    
    if __name__ == "__main__":
        main()
    


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


    I've been working on this over the last week. What registers do Solis owners want/need exposed through this HA integration?



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


    Oh I don't know, let's start with these ones? 😂




  • Registered Users Posts: 6,160 ✭✭✭championc


    Anyone looked at extracting the 16 cell values from cells attached to a Seplos BMS ?



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


    Is there much point in extracting the yesterday values? The today values from yesterday will be in HA anyway?



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


    True.

    I had this set up from before the energy dashboard in HA was a thing and was bringing in the values via node-red and solis cloud.

    It's more so that I can keep this view the same:


    I know that some of the monthly and yearly figures don't exist on the inverter but are calculated in the cloud.

    I think a few utility meter sensors which reset monthly/annually will do the trick



  • Registered Users Posts: 861 ✭✭✭tails_naf


    How do you connect the rs485 bus on the inverter to the pi zero?

    Edit: I'm and idiot, I thought this was using a physical modbus interface, but see from the code it can be done directly over ip. Nice, will definitely look into setting this up also.

    Is there a yaml version of the solis registers, or is the one in the github good for solis?

    Post edited by tails_naf on


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


    Why would you when you can poll it via the IP directly? Assuming it's a Solis inverter.



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


    Thanks for the picture of the dashboard. I know you have some sensors from other integrations mixed in there, but does that picture contain the full set of sensors from the SolisCloud API integration? I can aim to replicate that so.



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


    Yeah just the shelly one is the odd one out.

    There's actually a ton of extra data if you open up dev tools in a browser and inspect on the old solis portal (not solis cloud)

    {
        "_st": "1",
        "1af": "229.40",
        "1ag": "0.00",
        "1ah": "0.00",
        "1ai": "1.40",
        "1aj": "0.00",
        "1ak": "0.00",
        "1ao": "860",
        "1ar": "49.99",
        "za": "xxx",
        "1aw": "11.30",
        "ah": "111577",
        "zc": "xxx",
        "zd": xxx,
        "2tm": "96",
        "ze": xxx,
        "zf": "xxx",
        "zg": "00,D8",
        "2tp": "64",
        "zh": "xxx",
        "zi": "02",
        "ap": "0000",
        "aq": "0000",
        "zk": "1",
        "ar": "0000",
        "2tt": "53.40",
        "zl": "0",
        "as": "0000",
        "1bc": "5593.00",
        "2tu": "7.50",
        "at": "0000",
        "1bd": "14.60",
        "1be": "119.40000000000022",
        "2tv": "100.00",
        "1ru": "709",
        "1bf": "1211.1000000000008",
        "2tw": "100.00",
        "1rw": "0",
        "1bj": "230.60",
        "1bm": "3.03",
        "_ut": "xxx",
        "1bq": "60",
        "1br": "0",
        "1bs": "340",
        "1bt": "1.00",
        "1bu": "1532",
        "1bv": "2291",
        "1bw": "0.30",
        "1bx": "2.80",
        "1by": "16.900000000000006",
        "1bz": "21.599999999999998",
        "1sm": "0034",
        "1ca": "102.10000000000002",
        "_et": "xxx",
        "1ki": "0022",
        "1cb": "836.2000000000004",
        "1a": "399.30",
        "1b": "299.30",
        "1cj": "490.0",
        "1j": "1.20",
        "1k": "1.30",
        "1cn": "6454",
        "1co": "12.60",
        "1cp": "127.10000000000001",
        "2vb": "18.50",
        "1cq": "1979.300000000001",
        "_": "0000",
        "2vc": "4.80",
        "2vd": "5.40",
        "1cr": "53.40",
        "2ve": "0.00",
        "a": "01",
        "1cs": "4.00",
        "stat": "0",
        "b": "0505",
        "1ct": "210",
        "2vg": "0",
        "c": "xxx",
        "d": "1606",
        "1cv": "98",
        "e": "xx",
        "f": "0001",
        "1cx": "1451",
        "g": "xxx",
        "1cy": "1547",
        "1cz": "6.50",
        "1lf": "EN50549L",
        "1da": "1.70",
        "1db": "34.80000000000001",
        "1dc": "31.6",
        "ruleCode": "0102010505",
        "1dd": "374.5000000000001",
        "1ll": "0001",
        "1de": "382.29999999999995",
        "1df": "34.30",
        "94ax": "94",
        "4ke": "5",
        "dt": "xxx",
        "1fe": "1",
        "1ff": "1",
        "1vw": "22",
        "1vx": "4",
        "1vy": "6",
        "1vz": "14",
        "1wa": "30",
        "1wb": "28",
        "1fs": "",
        "7cf": "0.00",
        "7cg": "0.00",
        "1gr": "00F6",
        "7ch": "0.00",
        "7ci": "0",
        "13ah": "34.30",
        "a0": "1",
        "1hk": "4000"
    }
    


  • Registered Users Posts: 430 ✭✭Geeyfds53573


    Really great to find this thread and to see some familiar names. Great work all. Can I please check I have a SOLIS RHI-5K-48ES hybrid inverter with Solis Cloud and the Wi-Fi Stick S/N is in the format 400*****99 and I see a LAN IP in the Solis Cloud app - are these the details to use and should they work for the Pysolarman5 module?



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


    Yes, you have the serial number correct. Best to double check the LAN IP in your router's DHCP table. The incorrect LAN IP is shown in my Solis Cloud dashboard (looks to be a display issue).

    Solis Cloud LAN IP is shown as 192.168.0.111 whereas the actual LAN IP is 192.168.1.11.



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


    This is what I'm working on at the moment. My Stephan merged my pull request earlier to support different modbus function codes. All that should be required now is the Solis registers yaml file.

    There is the odd data corruption issue which I hope to resolve by replacing the existing code with pysolarmanv5.



  • Registered Users Posts: 430 ✭✭Geeyfds53573


    Thanks @Jonathan thought it looked funny I found the serial no on the list on the router so have the correct ip so looking promising - I’m sure I’ll have a few questions in the coming days. Great work by the way very nice solution.



  • Registered Users Posts: 129 ✭✭fael


    I would love the most registers that SD_DRACULA mentioned.

    And on top of that I'm hoping for a way to control battery charging. I'm not sure yet what's possible. But changing the charging amps to x would be very cool if that's possible (basically if you then set it to 0 it stops charging).



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


    Yeah, it's on the to-do list.

    For the moment, just create a basic python script and call directly from HA.

    from pysolarmanv5.pysolarmanv5 import *
    
    def main():
        modbus = PySolarmanV5(192.168.1.111, 1234567890)
        modbus.write_holding_register(register_addr=43141, value=125) # Set charge rate to 12.5A (Scaled by 0.1)
        print(modbus.read_holding_registers(register_addr=43141, quantity=1)) # Confirm current charge rate in A (Scaled by 0.1)
    
    if __name__ == "__main__":
        main()
    
    
    


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


    +1 on the battery charging with a schedule if possible (if not then automations will sort that out anyway)



  • Registered Users, Registered Users 2 Posts: 3,971 ✭✭✭mp3guy


    Just so I'm grokking this thread correctly, folks here are mainly talking about this inverter?

    And are folks using RS485 or doing everything over the Wifi dongle?



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


    Yes and Wifi.

    I tried using rs485 connected directly to HA while also having the logger send data to Solis cloud and let's just say you don't want to do that unless you want to see values in the millions added to your cloud data.

    There's a workaround I think @reklamos did it to get a relay that switches off the rs485 momentarily but don't see the point of that now that we can get the data directly via wifi.



  • Registered Users, Registered Users 2 Posts: 3,971 ✭✭✭mp3guy


    Awesome. My parents have this inverter and I want to setup real-time HA monitoring for them. Are there some configuration files you could share with me for this?



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


    All details on page 1.



Advertisement