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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Solar PV Monitoring/Automation Thread

1235743

Comments

  • Registered Users Posts: 861 ✭✭✭tails_naf


    Is it supervised? If so, could you link the docker commands you used?



  • Registered Users Posts: 861 ✭✭✭tails_naf


    I have a spare rpi3 knocking about. Do you have any reliability issues with the sd card? I've had some wear out quickly and it sucks to loose everything.



  • Moderators, Science, Health & Environment Moderators Posts: 4,739 Mod ✭✭✭✭Tree


    I'm running on a pi3, would definitely prefer a pi4 but they're rarer than hen's teeth. I got one of those category A2 SD cards made for running applications from (memoryc, arrived next business day).



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


    No issues with SD card yet, but only a matter of time. Have a daily backup of config synced to another machine for when it does happen. A proper SSD will solve that though. Just can't get my hands on any RPi4s at moment.

    As for the install, I'm just using HAOS: https://www.home-assistant.io/installation/raspberrypi

    I went that route as I didn't want the hassle of trying to figure out what update broke what. I have enough of that in the day job 😂



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


    Yeah using an rpi4 with an SSD here and daily backups to google drive, nothing to lose that way.

    Or you could go with the HA amber official kits https://www.crowdsupply.com/nabu-casa/home-assistant-yellow

    I think you can get them with the cm4 included.

    I used this https://rpilocator.com/ to source some pi zero 2s recently, just follow them on twitter and be ready to jump once you get the notifications.



  • Registered Users Posts: 189 ✭✭connesha


    Am running supervised in a docker container on Ubuntu. On a NUC (Celeron) with SSD. Finding it snappy, quick to reboot, etc. Power consumption coming in at 4 to 5w.

    HA config in GitHub (git integration with StudioCodeServer is pretty nice). Haven't DB backup in place yet.



  • Registered Users Posts: 861 ✭✭✭tails_naf


    Nice. Can you give me a link to the one you have. Was thinking ssd in raid config would be good. Could eve stream media perhaps.



  • Registered Users Posts: 189 ✭✭connesha


    Sure, I got this:

    https://www.elara.ie/productdetail.aspx?productcode=MMECB55116

    https://www.elara.ie/productdetail.aspx?productcode=MME342C121

    https://www.elara.ie/productdetail.aspx?productcode=MME342B782

    Got the larger SSD as may use it as a fileserver at a later point. Can save 30e going smaller.

    Running Ubuntu 20.04

    Haven’t used it for media serving, so can’t comment there


    There are good ones on adverts from time-to-time. There weren’t any convenient at the time I needed, so went new.

    But, there’s an i7 there now, with SSD and Mem. I’d probably have taken that, had it been available when I was looking:

    https://www.adverts.ie/other-computers/intel-i7-tiny-pc-nuc5i7ryh/26382601



  • Registered Users Posts: 131 ✭✭fael


    I looked at a NUC, but decided to go with an Odroid N2+ instead. It had Home Assistant pre-installed. Just works out of the box. 64 GB eMMC and 4GB ram, slightly overspecced on what HA introduced themselves with the HA Blue (also Odroid based).

    Ships from NL, so no customs charges. It's close to €200 all-in.

    ODROID N2+ (4GB RAM) with Home Assistant Bundle - Standard Edition



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 3,972 ✭✭✭mp3guy


    Can't stand RPi or anything equivalent for HA, dog slow to restart and you'll be doing that a lot when you're configuring things.



  • Registered Users Posts: 131 ✭✭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,414 ✭✭✭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,972 ✭✭✭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,414 ✭✭✭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,972 ✭✭✭mp3guy


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



  • Advertisement
  • Registered Users Posts: 131 ✭✭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,414 ✭✭✭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,238 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: 131 ✭✭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: 131 ✭✭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,238 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,414 ✭✭✭SD_DRACULA


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




  • Registered Users, Registered Users 2 Posts: 6,213 ✭✭✭championc


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



  • Moderators, Education Moderators, Home & Garden Moderators Posts: 8,238 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,414 ✭✭✭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,414 ✭✭✭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,238 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,414 ✭✭✭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: 434 ✭✭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,238 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,238 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: 434 ✭✭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: 131 ✭✭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,238 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,414 ✭✭✭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,972 ✭✭✭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,414 ✭✭✭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,972 ✭✭✭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,414 ✭✭✭SD_DRACULA


    All details on page 1.



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


    Right, what I'm actually looking for is code, i.e. whatever is behind producing the entities shown here: https://www.boards.ie/discussion/comment/118887422/#Comment_118887422. Would be great if it could be shared rather than being left to re-invent the wheel.



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




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


    Aha, ok, and that's cloud scraping which is not ideal. So is anyone pulling MODBUS data and displaying it in HA? If so, could you share your code? Not just the libraries, but the actual implementation.



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


    Read back through the thread. Local Modbus polling via the Solarman V5 protocol is what is being worked on at the moment. My PR adding the groundwork for Solis integration to the existing Solarman local polling integration was merged yesterday. I'm working on mapping the registers at the moment.


    If you're happy with Cloud scraping, just use this integration and be done with it.



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


    Thanks, I pulled that repo out as one to dig into. Definitely not happy with cloud scraping, I'm polling my own inverters over modbus already. It'll be a week or so until I get a machine on the network with the inverter but once I do I can help out.



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


    Don't use the v2 one, the old platform always falls behind with updating, sometimes a full day of bad values until it refreshes.

    Works fine for me for now since I have 1 min updates in Solis cloud and I will probably set the modbus ones to refresh around the same.



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


    Bit slow for me, I'm reading my inverters every 5 seconds. All about that fine grained power usage.



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


    I used to do that but that results in a lot of data and honestly I have no real use for that granularity. I do it every 30s and that is sufficient for my automations. Although I do admin data is addictive. :)



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


    My shellyem does real time monitoring for me.

    Not sure I can see you pulling data every 5 seconds via pymodbus wifi if reading a lot of registers.



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




  • Advertisement
Advertisement