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

Options
1222325272870

Comments

  • Moderators, Home & Garden Moderators Posts: 5,974 Mod ✭✭✭✭graememk


    Finally starting to get a decent poke at this today.. Its been a busy couple of weeks.

    Have extended the HA solarman thing too to pull in the Charge rates and times.

    Still havent decided to Do the logic in HA or Nodered. I know node red, but the Automations are quite powerful in HA. (using the python in HA)

    In HA can you Have Virtual switches.. or Inputs? ... If you know what i need to start looking into The Home assistant UI would be easy to pull up.



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


    I've moved this comment over to this thread where it is better suited.

    So Modbus is a communications protocol that is used in lots of different industrial equipment, and is also supported by many different solar inverters. It is available in two main flavours; RTU (serial over RS485) and TCP (IP based). The Solarman loggers allow you to pass through Modbus RTU commands encapsulated in a proprietary format. pysolarmanv5 handles all the encapsulation for you, and exposes a simple Modbus API. A copy of the Solis Hybrid modbus registers are available here.

    As for integrating with HA, the Solarman integration (as you've discovered) has Modbus read support for Solis Hybrids. There is no technical reason why it cannot be used to control either, other than nobody (myself included) has bothered to extend it. The alternative for reading is to use @reklamos's solismon3 project.

    If you want write support, you can use @reklamos's solismod project, you can use @connesha's AppDaemon wrapper, or you can use a pyscript wrapper (which is what I'm using, but I have to tidy up and properly document). All three have different advantages, however if you're running HAOS, it can be a bit awkward to run arbitrary docker images, so a lot of people end up running docker images on another RPi (which is a bit of waste). Your options for running docker images within HAOS are to either add the Portainer add-on or modify @reklamos's projects to turn them into fully fledged HA add-ons (which are just containers with some special metadata).

    What do you mean by virtual switches? A boolean that you can toggle in the UI which you are then checking the value of in some other automation? If so, check out Settings => Devices and Services => Helpers.



  • Moderators, Home & Garden Moderators Posts: 5,974 Mod ✭✭✭✭graememk


    "What do you mean by virtual switches? A boolean that you can toggle in the UI which you are then checking the value of in some other automation? If so, check out Settings => Devices and Services => Helpers."


    Yep thats what i needed, half the battle is figuring out what they are called!



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


    As regards HA automations vs Node Red, I stumbled upon Shortumation the other day. It basically provides a flow-based UI for HA automations.

    Could be useful for those that prefer flows rather than yaml.



  • Registered Users Posts: 1,440 ✭✭✭DC999


    Oh, so looks like you wouldn't need something like Node Red on top of HA to create flows. Would make life simpler to not need a 2nd system. I'll have a nosey as I'm deffo in the noob camp of needing gui / flow over code / yaml. Am looking to start very baby steps on HA soon. Don't have it setup yet, but gonna get it to turn on a light at the start. Rome, A Day and all that :)

    It's the trying not to get divorced part that might be harder with spending this time on solar.



  • Advertisement
  • Registered Users Posts: 6,101 ✭✭✭championc


    It won't come to divorce, but you'll be a sh1tload of brownie points in arrears 😂



  • Registered Users Posts: 1,440 ✭✭✭DC999


    Gave me a proper chuckle :)



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


    I need help with setting the correct value to 43110 to toggle the charging from grid on and off.

    I can send the write command from home assistant and that works fine, the problem I have no idea what to set it to when enabling charging from grid.

    It's a Solis 6Kwh 5G and I am using backup mode by default which is value 49.

    I tried setting that to 51 but it switches to feed in priority and starts dumping to the grid (exact opposite of what I want)

    I tried to manually go into it, set time of use so I can read the 43110 value again but won't take my settings, says Failed! when I save, what's wrong here?

    Any ideas what I'm doing wrong here?



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


    Don't worry, you're doing it right. 43110 toggles the optimal income run/stop mode.

    Your problem is that you have set a discharge time. That is only useful if you want to dump to the grid at peak times for high feed in tariff payments. Eg. Octopus Agile.

    Solution: Set Discharge Time to 00:00 - 00:00.

    It catches everyone. Solis should really rename or hide that option.



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


    Yes I only noticed that after.

    I used these to get a reading, started importing and I got 51 when I read 43110, all good.

    However when I sent 49 to 43110 it stopped grid charge as expected but did not toggle back to Backup mode, it stayed on Self use. Not sure how to resolve that.

    I now set the discharge time 00:00 - 00:00 and the charge time 00:00 - 09:00 because my d/n meter seems to be 1 hour behind and I assume that is what is used to count the d/n kwh right?



  • Advertisement
  • Registered Users Posts: 258 ✭✭S'


    Values 33 & 35 is what I send to the inverter to toggle Optimal Income Run/Stop.

    What value are you seeing from register 33132?

    You should be on Self use mode all the time & just toggle optimal income

    11.2kWp E/W split arra. Mayo



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


    33132 = 49

    It needs to go back to Backup mode after not self use since I have all my network gear hooked up to the AC backup and if the power goes out I need all that to work.


    Bit4 seems to toggle backup mode but not sure how to work it out.

    Or set this register to 1 or 2, not sure which


    Post edited by SD_DRACULA on


  • Registered Users Posts: 1,081 ✭✭✭silver_sky


    It's correct. If you have reserve battery enabled then it's 49/51, otherwise it's 33/35. I've a 6kW hybrid with backup enabled and same on mine.



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


    Maybe it just doesn't show it on the LCD screen, as in it shows Self use when I go to storage mode but it's actually Backup? And 43356 = 0 so everything would indicate otherwise?



  • Moderators, Home & Garden Moderators Posts: 5,974 Mod ✭✭✭✭graememk


    Yes the day night meter is on utc and never changes.

    The backup mode toggle is on a different settings page.. (I'd need to be hands on but it's one of the last menu items)


    And for the ones not knowing why we are shoving seemly random numbers to change settings:

    This register controls various settings, each a single bit. Mine for example is 35 in decimal or 0x23 in hexadecimal or 0010 0011 in binary (bit00 is on the most right, reading right to left)

    Bit00 is set to 1, unused

    Bit01 set to 1 time of use mode

    Bit02 set to 0, off grid mode

    Bit03 set to 0 battery wake up mode

    Bit04 set to 1 reserve battery mode

    Bit05 set to 1 allow charge from grid

    Bit06 set to 0 feed in priority mode

    And the rest are unused.

    Hexadecimal is a base 16 way of representing binary (base2) and goes 0-9 ABCDEF each number or letter represents 4 bits.

    If you can work out the 8 bits of binary you need, you can just shove that into google and ask it to convert to decimal!



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


    So this is what I don't get, before I messed around with 43110 I just read it and was 49 which is 00110001 and then after manually forcing a grid charge it changed to 51 or 00110011 so it looks to me it's just toggling bit 7 on and off.

    I can only think that once you change settings via modbus then maybe what you see on the LCD screen of the inverter doesn't match? i.e. once I flip between 49/51 via modbus I don't see Backup mode but Self use

    I guess I will never find out until the first power cut/I cut the power myself 🤷‍♂️



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


    I am reading the battery kwh charged directly from the wifi logger but I would like to create two new sensors in HA which track the amount of kwh charged from the grid and from PV, separately.

    If someone has this configured do you mind sharing the yaml pls.



  • Registered Users Posts: 6,944 ✭✭✭circadian


    Alright lads. I've got both a harvi/Eddi and a solis inverter. Which would be the best to monitor via openhab? I'm building my openhab pi with some grafana and Prometheus running too.



  • Moderators, Home & Garden Moderators Posts: 5,974 Mod ✭✭✭✭graememk


    If you know what register your looking to pull in. Pull up the \\homeassistant\config\custom_components\solarman\inverter_definitions folder and in the solis hybrid .yaml file.


    Make sure the registers are included there.. Ive added a few to monitor the charge timers

    Instructions are on the github.. which i cant find right now.. just not looking in the right place i think



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


    Thanks @graememk

    That's actually next on my to do list to bring in the full register list I need into HA via the integration, currently I'm doing it ghetto style, got a pi zero that polls it every whatever seconds using the pysolarmanv5 code and sends stuff via mqtt.

    But still I am not sure from the above if I can tell if the battery was charged using grid or solar.

    I suppose I need to make two new sensors and check if grid status = importing then add kwh to charged from grid else from pv.

    Or maybe even based on time, hardly going to be pv from 00:00 to 06:00 etc



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


    Rather than duplicating work, do you want to submit a PR to Stephan's repo with what you have and we can look to fill in the missing ones after?



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


    @Jonathan I was talking to you about this before but I don't recall what the solution was.

    Now that winter is here, I will need to charge the car at night and ofc not from the battery so I need to stop the battery drain while I charge the car.

    Was it something like enable charge form grid (43110 = 51) but charge with 0A until the car is charged and then 43110 = 49 and set charge to 50A?

    When I have to charge batteries & EV I suppose it won't matter, this might only apply for a few isolated cases.

    Which register is it for setting the charge rate?

    Or maybe there's a better option?



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


    If you want to charge car and preserve your house batteries;

    Set 43110 to 51 (charge from grid)

    Set 43141 to 0 (charge from grid at 0A)


    To avoid drain issues like @silver_sky, you might be better triggering your Zappi charge from within HA. That makes it more robust against the MyEnergi API. Create an input_number helper called zappi_boost_kwh, and then create a script using the below:

    alias: Zappi Boost x kWh
    sequence:
     - service: myenergi.myenergi_boost
       data:
         amount: "{{ states('input_number.zappi_boost_kwh') | int }}"
       target:
         device_id: xxxxxxxxxxxxxx
    mode: single
    icon: mdi:ev-station
    


  • Moderators, Home & Garden Moderators Posts: 5,974 Mod ✭✭✭✭graememk


    I think sd_dracula has the emonevse (like me)

    That sends it's data out over mqtt, no cloud API needed thankfully.


    As for the PR, yep I should be able to do it, most likely the weekend again.. or tomorrow night depending on how things go.. I have just got a new steamdeck so could be a bit distracted..



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


    Does anyone have the grid status register (importing/exporting) in the 3xxxx range, can't seem to find it if there is one.



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


    33257/33258 is grid meter active power as a signed 32bit integer, referenced to a positive number as import and a negative number as export.


    You can therefore look at the upper most bit of the first register (bit 15), and shift it 15 bits to the right to determine if importing or exporting.

    modbus.read_input_register_formatted(register_addr=33257, quantity=1, bitmask=0x8000, bitshift=0xF)
    

    The above query returns 0 when importing or zero reading. It returns 1 when exporting.


    Not aware of a single register to query unfortunately.



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


    I think that will do it thanks, I also found this:

    Not sure if the same.



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


    That particular discrete input signifies if the inverter is grid connected I think.



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




  • Advertisement
  • Registered Users Posts: 1,081 ✭✭✭silver_sky


    I've added these also but I'm getting 0 value for each of them. 🤨 Any idea what I may be missing?



Advertisement