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

1679111271

Comments

  • Registered Users, Registered Users 2 Posts: 3,971 ✭✭✭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,365 ✭✭✭SD_DRACULA




  • Registered Users, Registered Users 2 Posts: 3,971 ✭✭✭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,192 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,971 ✭✭✭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,365 ✭✭✭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,971 ✭✭✭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,365 ✭✭✭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,971 ✭✭✭mp3guy




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


    I'm Polling my inverter every 10 seconds via wifi, and it seems fine,

    The rest of my system is setup for about 10 seconds too.

    As mine is just a normal inverter, they had different addresses, all im pulling is the string voltages, current, grid, temp, AC power and DC Power.

    Im just triggering the script from nodered and processing the output Json then into mqtt.

    I have a Home assistant instance running but havent really dug into it yet. Mostly working in emoncms.



  • Registered Users Posts: 189 ✭✭connesha


    +1 Same here.

    I'm polling the inverter every 10 seconds from a script outside HA, and publishing via mqtt. Was doing every 5 secs for a period previously too, and no issues so far. On Solis hybrid 5G.

    Also polling MyEnergi every 10 seconds to get Eddi heater loads/totals and publishing that via mqtt. Using https://github.com/CJNE/pymyenergi, keeping same MyenergiClient/Connection between invocations (lib modified locally to extract independent history for heater1 and heater2, so can use as Appliance1/2 in tesla-style-card)



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


    Why go through hoops of python->mqtt->HA when you can just use the existing HA integration (which you could also modify)? https://github.com/CJNE/ha-myenergi. Less moving parts.



  • Registered Users Posts: 189 ✭✭connesha


    Easier modify. It didn't give what I needed out of the box. Would have had to modify both HA and the lib to get it.

    Also, have all the infrastructure in place already for other events so was easy. And I find running outside HA is so much easier/less finicky to setup, debug, etc...



  • Registered Users Posts: 468 ✭✭thebackbar


    Does any inverter provide the ability to control the charging of a battery via an API ? For example if tomorrow is promised sunny can you set your battery to charge to x percent over night, but if tomorrow is expected to be cloudy you would fully charge your battery at offpeak rates ?



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


    I don't think so out-of-the-box.

    I am currently doing it with Node-Red to my Sofar ME3000 Storage Inverter.

    The RS485:port is connected to an sofar2mqtt which sends the data to Node-Red - and receives instructions back. The ME3000 is set to passive mode, which allows commands to then be sent to the inverter.

    So it can be told to start charging at midnight, and stop when SOC% reaches xx%, discharge overnight or go into Standby unit maybe 09:00.

    So passive mode turns the inverter into a dumb device. You can tell the inverter to Charge, Discharge, or go into Auto or Standby.

    I also use Node-Red to control my Eddi and Zappi, only turning them on when my batteries SOC hits 98%

    Post edited by championc on


  • Registered Users Posts: 468 ✭✭thebackbar


    Very interesting thanks ! I have been given the option of a solis, goodwee or a Huawei Inverter.

    Afaik with the solis inverter the api doesn't support this capability, so I need to see what type of api the other two have.



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


    You can interface with the solis over modbus though the wifi module (over IP)

    You can change most if not all of the settings on the hybrids



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


    I have the Huawei SUN 2000, you need a higher level account (installer) on fusion solar to mess w/ the battery config. Mine is set for time of use (TOU) and you can configure what times it charges from the grid and what time it discharges.

    Right now I have it discharging all teh time except Saturdays (BG smart tariff with a free weekend day), so I draw from the grid on saturdays even if the battery is full. You can't set "50%" but you can set it to charge from the grid for an hour or so, and that's the same. The 5kW takes ~2h to charge.



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


    Yup the GivEnergy ones have a nice (new) API where you can query and modify settings.

    GivEnergy API Documentation (v1.5.2)

    I actually still use the old API, but it doesn't look that much difficult to swap. I'll probably keep using the old API until they deprecate it and break me and then I'll have to get off my arse and migrate to the new one :-)



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 265 ✭✭S'


    I had a look at trying to read data over modbus via a PLC that I have on my network on port 502. I can ping the wifi stick (192.168.8.100) and have my PLC at (192.168.8.101).


    does below look right?




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


    I would say the main reason for not allowing remote control is security. The other thing is that the communication between inverter and cloud is not direct and instant. Since inverters are connected to the cloud it is ussually one way street, the data is going out. There is no direct connection to the inverter from outside unless you configure port forwarding(security risk). Solis has OTA firmware upgrades but in this case inverter still initiating the connection at certain time and checks if there is a firmware available for it in the cloud.

    It is still possible to control solis settings through modbus using Solarman V5. I have posted earlier my code https://github.com/NosIreland/solismod that allows to modify modbus registers remotely. It subscribes to mqtt topics that you define and then makes changes in inverter. I use node-red to send desired mqtt topics to broker. I use it to change charging intervals and charging current based on next days weather forcast.



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


    No. It isn't Modbus TCP. It's Modbus RTU encapsulated in the proprietary Solarman V5 protocol.

    Check out pysolarmanv5 which handles the encapsulation for you.



  • Registered Users, Registered Users 2 Posts: 265 ✭✭S'


    Ah Ok, that a pity. I could remove the cloud service and connect to my PLC over RS485 but ideally would like to hold onto the app for remote viewing.

    I'm not one bit familiar with python but what would be the best/easiest way to add this to my HA.

    I have HA running on Windows 10 VM on a QNAP NAS



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




  • Registered Users Posts: 861 ✭✭✭tails_naf


    Hi All,

    Just got Jonathan's pysolarmanv5 running - and can query the registers of my solis inverter (starting at 33000..).

    To get this integrated into HA are these the options as it stands:

    1. Use pysolarmanv5 with a register mapping and write the data to HA with MQTT or similar
    2. if some has done this, can you share that script?
    3. The other alternative that was mentioned is here: https://github.com/StephanJoubert/home_assistant_solarman
    4. This seems to have a lot of the work done and all we need is the YAML
    5. Something else?

    (Jesus formatting is a dose on this new site, tried to simply have an indented list and couldn't get it to work....)



  • Registered Users Posts: 189 ✭✭connesha


    See page 1 of this thread. @reklamos shared a script that pulls from pysolarmanv5 and publishes via mqtt



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


    Hey guys is there a register for PV1 and PV2 power or just have to get it by pv1 A * pv1 V?



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


    Couldn't get @reklamos' register writing to work for my Solis inverter. Wasn't able to scan the registers properly.

    Was chancing a 'modbus.read_input_register_formatted(register_addr=43144, quantity=1)' to see if I can also modify my charging times, but it's throwing the below.

    Will crawl into the attic like an animal so! :D


    Exception has occurred: error

    unpack requires a buffer of 2 bytes

     File "C:\Users\home\Python\solismon3\pysolarmanv5\pysolarmanv5.py", line 154, in _get_modbus_response

       modbus_values = rtu.parse_response_adu(mb_response_frame, mb_request_frame)

     File "C:\Users\home\Python\solismon3\pysolarmanv5\pysolarmanv5.py", line 199, in read_input_registers

       modbus_values = self._get_modbus_response(mb_request_frame)

     File "C:\Users\home\Python\solismon3\pysolarmanv5\pysolarmanv5.py", line 212, in read_input_register_formatted

       modbus_values = self.read_input_registers(register_addr, quantity)

     File "C:\Users\home\Python\solismon3\client_example.py", line 17, in main

       data = modbus.read_input_register_formatted(register_addr=43143, quantity=1)

     File "C:\Users\home\Python\solismon3\client_example.py", line 45, in <module>

       main()



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


    Not on the Solis, no. Either multiply them, or use the total DC power for all strings in 33057/33058.

    I pushed my draft yaml to GitHub yesterday. Have a few more changes to make before I file a PR, but it should be good enough for testing.



Advertisement