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

18911131471

Comments

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


    I don't really want the schedule.

    Looking for two lines of code I guess (if it works like that)

    1. Start charging from the grid now
    2. Stop charging from the grid now

    I have the older FW with the basic and useless schedules not the daily ones.

    Can we force charge/discharge on demand?

    Could it be tricked by setting overdischarge SOC to 99% for example when wanting to charge from the grid and then set it back to 15% when you want to use the battery?



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


    Try to break it into 2 or 3 blocks. I was running into issues when trying to do large blocks.



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


    You could try setting a 24 hour charge from grid period, and then toggle timed charging using 43110. Haven't tested it though.



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


    What's the write command?

    modbus.write_holding_register(
                register_addr=43110, value=1, bitmask=0x2, bitshift=1
            )
    

    When I read I get 0 and then it needs to write 1?

    Also do any of these 4xxxx registers allow us to toggle self use on/off? This is handy from charging car from grid without draining battery



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


    No, you need to read it and then XOR it and then write it. For the moment, read the value of 43110. If it is 33, set it to 35, and vice-versa. Look at 33 and 35 in hex and it will make sense to you then.

    Although, I was thinking yesterday that it could be helpful to introduce a pseudo modbus function to do this in one step in pysolarmanv5. I'll see what I can do.



  • Advertisement
  • Registered Users Posts: 189 ✭✭connesha


    Yea, that would be great. A "change bit in holding register" utility function would be a really handy addition to the lib

    • Read register
    • If bit is not what is requested, then XOR bit, and write holding register

    Thanks



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


    Well the read:

    modbus.read_holding_register_formatted(
                register_addr=43110, quantity=1, bitmask=0x2, bitshift=1
            )
    

    Returns 0, not 33 so not sure it works then? Maybe FW dependent?

    Actually I am getting 0 from all the holding registers with the above code but works if I remove the bitmask and bitshift values.

    I get 49 from reading register_addr=43110, quantity=1 now

    Post edited by SD_DRACULA on


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


    Thinking about it further, two distinct functions are probably required. One function to set a bits in a register high or low, using AND and OR as masks. The second then to toggle individual bits in a register using a XOR mask.



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




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


    I get 49 with:

    print(
            modbus.read_holding_register_formatted(
                register_addr=43110, quantity=1
            )
        )
    


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


    Nice, I trimmed some of the fat (got rid of leading/trailing registers not referenced) and now I'm getting stable 6 second polling;

    requests:
      - start: 33029
        end:  33095
        mb_functioncode: 0x04
      - start: 33116
        end:  33179
        mb_functioncode: 0x04
      - start: 33206
        end:  33282
        mb_functioncode: 0x04
    

    Read wise most values seem fine bar the odd crazy battery SOC spike:




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


    Looks like response is not handled properly in the code. It should have some error checking to ignore these and reread the register. I was only getting crazy numbers when was reading modbus directly with 2 modbus masters present hence I had the relay switch to avoid this.



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


    Nice work. File a PR with the changes.

    That is why integrating pysolarmanv5 is on the to-do list. Current implementation is naive.



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




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


    And that means? enabled? disabled?



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


    I never had this problem with pysolarmanv5 it either provides proper value or spits out some garbage and the exception handles that part and I just retry read again. When doing testing I do get that often but I never got an actual value that would be accepted. I think the problem that @mp3guy got is with home_assistant_solarman rather than with pysolarmanv5.



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


    Yes, the problem lies in the Solarman HA integration. I am hoping to replace the current V5 processing code with pysolarmanv5 and make it more reliable.

    For your set up 49 = disabled, 51 = enabled. Look at the binary representation of both and you'll see they differ by one bit, BIT1, which represents grid charging.



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


    As a dev myself, I keep an eye on this thread. And I have to applaud your willingness to start poking/peeking about with registers. The last time I did that was on my old VIC-20 circa 1983.

    But it does raise with me why they make it so difficult to remote control. Sure, security is important, but if they were serious about supporting the market, they could do it via a server generated API key. Yes, it's "more work" but man .... the stuff you're doing is hard.

    Respect.



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


    Has anyone tried modulating the charging current of the battery? I want to use it to prioritize the Eddi first thing.



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


    What are the advantages over just setting a boost on the Eddi from battery, and then the the inverter top up the battery as the morning goes on?



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


    That only works if your battery has energy in the morning when you want to start the boost. If it's empty come 8am, I can only pull grid energy and can't control the current the Eddi uses during a boost. If you modulate the battery charge current, you can ensure the inverter only diverters power to the battery when the Eddi is maxed out at ~3kW.



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


    Okay, I understand the use case a bit better now. I haven't tinkered with the charge current, but I was investigating the possibility of temporarily disabling the battery (effectively turning the hybrid inverter into a string inverter). My Zappi is connected from the meter box and not the consumer unit, so it only runs on true surplus as inverter CT can't see any Zappi loads. It would be helpful on the odd occasion that I might want to charge car before house battery is full.

    You could probably achieve same with your Eddi up until generation exceeds 3kW, then re-enable battery and set a boost.



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


    Interesting, any reason your Zappi ended up like that? That introduces a problem where you can't run your Zappi in Eco mode and leverage the battery as a buffer on days where clouds are on/off. I find that quite useful to avoid thrashing on mixed sunny cloudy days.



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


    Zappi is located right next to meter box, so it made wiring considerably easier. I suppose I could extend the inverter CT out to meter box, but it doesn't really cause me a problem. On intermittently cloudy days, I tend to run down battery and let inverter/battery handle any bursty generation.



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


    What about getting a harvi and doing away with the zappi CT altogether?

    As for slowing the charge,

    You could tell it to charge from grid at 0amps.


    I wonder can you change the discharge amps of the inverter, but that could be overidden by the bms.. as you can already set nearly every setting.



  • Registered Users Posts: 51 ✭✭Midlakelands


    Hi,

    I've been using the solarman HA integration for a day or two now and I had an issue with some parameters not showing up with the energy card. Kept on getting a 'last_reset' needed for 3 of the parameters. After reading this thread I changed the three in configuration.yaml as follows

    homeassistant:

     customize:

      sensor.solarman_daily_generation:

       state_class: total_increasing

      sensor.solarman_today_battery_discharge:

       state_class: total_increasing

      sensor.solarman_today_battery_charge:

       state_class: total_increasing

    Now I can see the energy data (takes an hour or so to show up). BTW did this in HA rather than the original solis_hybrid.yaml just to experiment but I guess the original sensors class could also be updated there instead.



  • Registered Users Posts: 189 ✭✭connesha


    Would be interested in this too. Have you tried it @mp3guy ?

    Was thinking of something similar to prioritise Immersion in the morning. Roughly:

    If Battery has some buffer (e.g. > 40% SOC)

    Then reduce battery charge current (e.g. to 0A / 20A)

    Until immersion has heated a bit (e.g. consumed 2kWh), or EDDI Active Heater is no longer heater1



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


    I already do it with my SolaX inverter, here's the automation:

    alias: Hot Water Battery Controller
    description: ''
    trigger:
      - platform: time_pattern
        seconds: /30
    condition: []
    action:
      - choose:
          - conditions:
              - condition: state
                entity_id: sensor.myenergi_eddi_status
                state: Max temp reached
            sequence:
              - service: automation.turn_off
                data:
                  stop_actions: false
                target:
                  entity_id: automation.hot_water_battery_controller
              - service: input_number.set_value
                data:
                  value: 20
                target:
                  entity_id: input_number.solax_battery_charge
          - conditions:
              - condition: not
                conditions:
                  - condition: state
                    entity_id: sensor.myenergi_eddi_status
                    state: Max temp reached
            sequence:
              - service: input_number.set_value
                data_template:
                  value: >-
                    {{ max(0, ((states("sensor.total_pv_power") | int(0) -
                    (states("sensor.myenergi_home_consumption") | int(0) +
                    3000)) / (states("sensor.solax_inverter_voltage") | int(0))) |
                    int(0)) }}
                target:
                  entity_id: input_number.solax_battery_charge
        default: []
    mode: single
    
    


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


    Changing charging current if battery profile is selected is not going to work as BMS overides the setting unless manual battery is used but then BMS does not communicate with inverter. I would no go with disabling battery route. There are couple ways to prioritize other devices instead of battery:

    1. Change usage profile from 'self use' to 'feed in priority'. I have not tried it but it should work.
    2. Use charging schedule. I tried this for water heating and it works well, also I can control how much I want to feed to water.

    I just let nodered to send register changes to mqtt and my code does the rest:

    charge_amp": [43141]
    start_charge_hour": [43143]
    start_charge_minute": [43144]
    stop_charge_hour": [43145]
    stop_charge_minute": [43146]
    

    First get current time. Change start_charge_hour to current hour and start_charge_minute to current minute. Set stop_charge_hour/minute for how long you want to divert but you can constantly monitor and adjust as required. I poll every 30s and modify based on generation if the sun drops I do not want to start importing. If you want to divert everything from PV to the car/water than set charge_amp to 0. I adjust based on generation or else I would start exporting as water heating element is 3kW. So if generation is 5kW I set charge_amp to 2 and that means 2kW goes to battery and 3kW to house and water.

    Maybe someone will find a better solution :)



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


    I was thinking along the lines of 43114 (battery_charge_and_discharge_enable_setting). Waiting for a sunny day to test.



Advertisement