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

1565759616271

Comments

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


    If you use -v or --volume to bind-mount a file or directory that does not yet exist on the Docker host, -v creates the endpoint for you. It is always created as a directory.



  • Registered Users, Registered Users 2 Posts: 7,260 ✭✭✭10-10-20


    Seems to be an issue with the command-line as I got the same here.

    I stuck it into a docker-compose.yaml file, touched the options.yaml file and it worked fine (as far as I can tell as I don't have a sunsynk).

    me@server:/bigpool/1tb/portainer/stack/keller$ sudo touch options.yaml
    me@server:/bigpool/1tb/portainer/stack/keller$ docker compose up -d
    [+] Running 1/2
     ⠼ Network keller_default           Created                       0.4s 
     ✔ Container keller-sunsynk-multi-1 Started                       0.3s 
    me@server:/bigpool/1tb/portainer/stack/keller$ ls
    docker-compose.yaml options.yaml
    


    me@server:/bigpool/1tb/portainer/stack/keller$ cat docker-compose.yaml 
    
    version: "3"
    services:
     sunsynk-multi:
       restart: unless-stopped
       image: ghcr.io/kellerza/hass-addon-sunsynk-multi/amd64:stable
       volumes:
         - /bigpool/1tb/portainer/stack/keller/options.yaml:/data/options.yaml
    




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


    This is bizarre. This is my docker-compose.yaml

    version: '3.0'
    
    services:
      portainer:
        container_name: portainer
        image: portainer/portainer-ce
        restart: always
        ports:
          - "9000:9000/tcp"
        environment:
          - TZ=Europe/London
        volumes:
          - /var/run/docker.sock:/var/run/docker.sock
          - /opt/portainer:/data
      homeassistant:
        container_name: homeassistant
        image: "ghcr.io/home-assistant/home-assistant:stable"
        volumes:
          - /opt/homeassistant/config:/config
          - /etc/localtime:/etc/localtime:ro
          - /run/dbus:/run/dbus:ro
        restart: unless-stopped
        privileged: true
        network_mode: host
      sunsynk-multi:
        container_name: sunsynk-multi
        restart: unless-stopped
        image: ghcr.io/kellerza/hass-addon-sunsynk-multi/amd64:stable
        volumes:
          - /opt/sunsynk/options.yaml:/data/options.yaml
    
    

    And I get

    root@Solar-M93:/opt/sunsynk# ls -la
    total 12
    drwxr-xr-x 3 root root 4096 Jan 31 19:52 .
    drwxr-xr-x 7 root root 4096 Jan 31 20:00 ..
    drwxr-xr-x 2 root root 4096 Jan 31 19:52 options.yaml
    root@Solar-M93:/opt/sunsynk#
    

    still a bl00dy folder / directory :(

    So I have created a file manually

    root@Solar-M93:/opt/sunsynk# nano options.yaml
    root@Solar-M93:/opt/sunsynk# ls -la
    total 12
    drwxr-xr-x 2 root root 4096 Jan 31 20:16 .
    drwxr-xr-x 7 root root 4096 Jan 31 20:00 ..
    -rw-r--r-- 1 root root    1 Jan 31 20:16 options.yaml
    root@Solar-M93:/opt/sunsynk#
    


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


    ....



  • Registered Users, Registered Users 2 Posts: 8,772 ✭✭✭micks_address


    Hi folks I know I asked about this before but I never got it working. I want to discharge my battery at midnight for 2 hours. I've a givenergy setup so the easy way is probably set a discharge schedule on the web portal? Can givetcp do it via home assistant?



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,550 ✭✭✭bullit_dodger


    Yeah, setting the discharge times on the portal or your phone is probably easiest. Alternatively you could just use PowerShell with the token (from the website) and then have two Scheduled task on a machine connected to the web, one at 00:00 to tell it to start discharging and the other at 02:00 to stop.

    Worth investing a little bit of time to learn/play around with using the powershell interface. Once you learn it (and it's pretty easy tbf) then you open up a lot of possibilities such as "if the battery is greater than 40% soc then dump at x kw for 90 minutes"

    Here's a sample piece of PowerShell which sets the discharge limit. Change 2x things, the "token" (xxxxx) which you can get for your account from the Givenergy portal and the inverter name (yyyyy) again this is from the portal (something like SD12345678) and then run it and you should be able to see it change the "discharge rate" on the portal. (You can easily change the discharge rate back in the portal)

    # Set system variables
    $baseUri = "https://api.givenergy.cloud/v1/"
    $json_extration_folder = "C:\Tools\GivEnergy\Cloud_Extract\"
    $filename_Datetime = get-date -format "yyyyMMdd_HHmm"
    $Inverter_date = get-date -format "yyyy-MM-dd"
    
    $Bearer_Token =
    "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
    
    #---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    # Get the Current top level Inverter Status (Grid voltage, Battery SOC, Solar power, etc 
    #---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
    $loginUri = "https://api.givenergy.cloud/v1/inverter/yyyyyyyy/settings/73/write"
    
    $headers = @{Authorization = "Bearer $Bearer_Token"}
    
    $tokenRequestBody = @{
      'Content-Type' = "application/json"
      'Accept' = "application/json"
      'value' = '1234'
    }
    
    $lenght_token = $tokenRequestBody.Authorization.length
    
    $output_filename = $json_extration_folder + "Set_Discharge_to_2600w_"+ $filename_Datetime + ".json"
    $login_response = Invoke-RestMethod -Method 'POST' -Uri $loginUri -Body $tokenRequestBody -Outfile $output_filename -Headers $headers
    

    A non-exhaustive list of the REST API's is

    <#
    {"data":[{
    "id":17,"name":"Enable AC Charge Upper % Limit","validation":"Value must be either true or false"},{
    "id":24,"name":"Enable Eco Mode","validation":"Value must be either true or false"},{
    "id":28,"name":"AC Charge 2 Start Time","validation":"Value format should be HH:mm. Use correct time range for hour and minutes"},{
    "id":29,"name":"AC Charge 2 End Time","validation":"Value format should be HH:mm. Use correct time range for hour and minutes"},{
    "id":41,"name":"DC Discharge 2 Start Time","validation":"Value format should be HH:mm. Use correct time range for hour and minutes"},{
    "id":42,"name":"DC Discharge 2 End Time","validation":"Value format should be HH:mm. Use correct time range for hour and minutes"},{
    "id":47,"name":"Inverter Max Output Active Power Percent","validation":"Value must be between 0 and 100"},{
    "id":53,"name":"DC Discharge 1 Start Time","validation":"Value format should be HH:mm. Use correct time range for hour and minutes"},{
    "id":54,"name":"DC Discharge 1 End Time","validation":"Value format should be HH:mm. Use correct time range for hour and minutes"},{
    "id":56,"name":"Enable DC Discharge","validation":"Value must be either true or false"},{
    "id":64,"name":"AC Charge 1 Start Time","validation":"Value format should be HH:mm. Use correct time range for hour and minutes"},{
    "id":65,"name":"AC Charge 1 End Time","validation":"Value format should be HH:mm. Use correct time range for hour and minutes"},{
    "id":66,"name":"AC Charge Enable","validation":"Value must be either true or false"},{
    "id":71,"name":"Battery Reserve % Limit","validation":"Value must be between 4 and 100"},{
    "id":72,"name":"Battery Charge Power","validation":"Value must be between 0 and 2600"},{
    "id":73,"name":"Battery Discharge Power","validation":"Value must be between 0 and 2600"},{
    "id":75,"name":"Battery Cutoff % Limit","validation":"Value must be between 4 and 100"},{
    "id":77,"name":"AC Charge Upper % Limit","validation":"Value must be between 0 and 100"},{
    "id":83,"name":"Restart Inverter","validation":"Value can only be 100"}]}
    #>
    
    

    So depending on the setting you want to change , you modify the number below as follows

    $loginUri = "https://api.givenergy.cloud/v1/inverter/yyyyyyyy/settings/73/write"

    and that's it.



  • Registered Users Posts: 436 ✭✭jasgrif11


    For those of you using Home Assistant, what Entity do you use for "Grid Consumption" and "Export to Grid"? I have more than 1 inverter and a Zappi. Do you use the inverter entities or the myEnergi sensors for this?

    The reason I ask is that I'm seeing a difference in the values.

    Do you use sensor.myenergi_home_power_export for Export to Grid?

    Do you use sensor.myenergi__home_power_import for "Grid Consumption"



  • Registered Users, Registered Users 2 Posts: 7,260 ✭✭✭10-10-20


    Wouldn't it just depend on which devices are monitoring (using a CT) at the closest point to the meter? I have a Shelly PM and it provides both "grid consumption" and "return to grid" from it (I just have a peak/offpeak tariff switch as a template):




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


    I'm using my inverter's power meter:

    Then the inbound powermeter value is made into a utility with automations to change the tarifs at whatevver time of day, and those are then my Grid consumption.



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


    Just wondering did any one add the standing charge as a sensor on the HA energy dashboard and how did you do it? Would be nice to get an accurate picture of the monthly cost



  • Advertisement
  • Registered Users, Registered Users 2 Posts: 8,772 ✭✭✭micks_address


    any good tutorials/videos on running powershell in home assistant?

    i was following this but its specific to the ev charger



    also ive read elsewhere if force discharging the battery any house load will pull from the grid? id assumed any house load would just come from the battery discharge.. still might be worth doing as the house load is probably low enough around midnight.. most nights 250 watts or so.. my goal is to try and dump 3.6kw each night between midnight and 1am if the battery percentage is above x%. That way i can earn 80 cents in export which would more than cover the nightly import during the summer months..

    Post edited by micks_address on


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


    No, the house will take away from the export not from the grid. Only does that when you charge the batteries from the grid.



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


    I have just come across this (Rebuilding a weighbridge for a diet feeder... Havent asked the price of an OEM one yet.. Going on one for an Abbey, €700-800, we have a kuhn... I digress. )

    A 7" touchscreen display. with an in built ESP32-s3.. And there is sample code to integrate with home assistant. Its on the advanced end of things but, perfect way to learn how to do something is to have something to learn on!

    https://www.amazon.co.uk/ELECROW-Compatible-Esphome-homeassistant-PlatformIO-Micropython/dp/B0CHDXP6X8




  • Registered Users, Registered Users 2 Posts: 7,260 ✭✭✭10-10-20


    That's very like the NEXTION displays which were mentioned on here last week.

    Integration was via ESPHOME, but the trick was that the ESP32 sent NEXTION commands over UART to the processor on the Nextion... That must also be what the ELECROW display is doing as ESP32 doesn't natively have that rendering capability.

    Anyway, let us know how it goes.



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


    esphome and those types of screen are a mess to work with, ok for text but anything more complicated (like images/animations) you will spend countless hours messing with it.

    Just buy a 7" nest hub and it displays HA directly in about 5 mins after unpacking it.



  • Registered Users, Registered Users 2 Posts: 7,260 ✭✭✭10-10-20


    Does the Nextion software not simplify that sufficiently? I was interested in getting one, are they just not mature enough?



  • Registered Users, Registered Users 2 Posts: 8,772 ✭✭✭micks_address


    Playing around with givetcp and looks like this will do the force discharge. Tested it via the home assistant dashboard and does the trick.



    Setting to 60 discharges for 60 minutes etc..


    Should be easy to include this in an automation that runs at midnight and uses battery state of charge as a condition. Guess could also check the solar forecast and only discharge if it's above a certain amount



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


    Looks like people are just adding an automation to add <value> to the total cost from teh energy sensor at midnight, not ideal though.



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


    Oh I get it, increase this by whatever the daily amount is?

    I was thinking you'd add a fake one here (Standing charge rate)




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


    I'm buying ones for other reasons (building a weighbridge clock)



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


    Do report back, I'm actually interested in doing a little monitor in my pc tower (inside the 5.25" bays) for temps/cpu/ram/etc stats on a WT32-SC01 but it's only 3.5" so a bigger screen might do nicely 😊



  • Registered Users Posts: 436 ✭✭jasgrif11


    This is how my daily standing charge works

    template:
    sensor:
    - name: "Daily Standing Charge"
    unique_id: Daily_Standing_Charge
    unit_of_measurement: "kWh"
    device_class: energy
    state_class: total_increasing
    state: >-
    {{ (((as_timestamp(now()) / 3600)-472571) | int) / 1000 }}
    attributes:
    last_reset: "1970-01-01T00:00:00+00:00"
    
    sensor:
    - platform: template
    sensors:
    tariff_daily_standing_charge_cost:
    friendly_name: "Daily standing charge"
    unit_of_measurement: €/kWh
    value_template: >
    {{ ((states('input_number.daily_standing_charge_price')|float)/0.024 )| round(3) }}
    tariff_price_day_per_kwh:
    friendly_name: "Grid Peak"
    unit_of_measurement: €/kWh
    value_template: >
    {{ states('input_number.energy_cost_day_rate') }}
    
    daily_standing_charge_price:
    name: Daily Standing Charge price
    min: 0
    max: 1000
    step: 0.0001
    unit_of_measurement: "€/day"
    mode: box
    

    Mod:Just put it in a code block for easier reading



  • Registered Users Posts: 436 ✭✭jasgrif11


    This is the result. Which is the correct daily rate for Energia Ev




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



    And this part?

    Set it to use a static price and it's just 0




  • Registered Users Posts: 436 ✭✭jasgrif11


    Here are some screencaptures



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


    Ok i got it the same as you now but now tell me how to get it to 0.78 🤣



  • Registered Users Posts: 436 ✭✭jasgrif11


    The "Daily Standing Charge price" entry is an input number. This will allow you to input the actual value.

    Here is mine right now

    By 12am it will be 0.824



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


    Ok I had messed with the -472571 number and now I set it to the same as you, and yes I have the input number set to 0.78 and now it looks like this:

    So it's at 0.833 already, maybe it will fix itself after midnight?



  • Registered Users Posts: 436 ✭✭jasgrif11


    Here are all my states. It should update at 12am and then be fine



  • Advertisement
  • Registered Users Posts: 238 ✭✭insular1


    My set up has a hybrid Solis inverter in the garage linked to panels on that roof and 3x15kWhr batteries with JKBMS. Then have a separate small standard inverter in the main house attic linked to some panels.

    Recently ordered a Deye hybrid inverter and had planned to just replace the hybrid in the garage, but have been thinking instead of replacing the standard inverter in the attic and having two hybrid inverters to maximise charging speed and make full use of my 16kVa connection. This would mean having 2 of the battery packs connected to the Deye and one to the Solis. The issue with this set up is the inverters won't communicate with each other and so one could potentially drain the battery of the other.

    Was thinking there must surely be a simple way using Home Assistant to prevent this from happening? Like setting an automation that neither inverter can be discharging while the other is charging?

    Any reason why this wouldn't work? Or any ideas of a better way of doing this?



Advertisement