fboundy / ha_solis_modbus

YAML file for reading Solis Hybrid Inverter directly with HA native modbus
MIT License
54 stars 8 forks source link

Extra charge/discharge slots #1

Closed robjwalker closed 1 year ago

robjwalker commented 1 year ago

Apologies if 'issues' isn't the right place to put this, but I thought this info might be helpful.

After some guidance from you in the Solis Facebook group, I've got some extra bits working. My inverter has 3 charge and 3 discharge time slots. I've found the following so far:

43141 charge current 43142 discharge current 43143 charge hour start 1 43144 charge min start 1 43145 charge hour end 1 43146 charge min end 1 43147 discharge hour start 1 43148 discharge min start 1 43149 discharge hour end 1 43150 discharge min end 1 43151
43152 43153 charge hour start 2 43154 charge min start 2 43155 charge hour end 2 43156 charge min end 2

I suspect they then follow on in the same pattern. I'm not sure if 43151 and 43152 are left blank so that the next bank of slots are exactly 10 registers up, or for some other reason.

I'm on Octopus Intelligent which means I get 6 hours at the cheap rate guaranteed - 23:30 -05:30. But I also sometimes get the cheap rate outside of those times. This is decided by Octopus when I plug my car in. So I needed to be able to detect this and stop my house batteries discharging in to the car. To achieve this I leave charge times for slot 1 set to my guaranteed off peak times, and manipulate slot 2 when their are extras. I do this in quite a basic way. There is an Octopus Intelligent HA integration which has a switch that reflects if your account is currently benefitting from the cheap rate. I use this to trigger a script that sets the 'charge 2' slot to 05:31-23:29 if the current time is outside of the usual cheap window. Effectively forcing it to charge.

alias: Battery Force Charge
description: Forces battery to charge when Octopus intelligent rate is cheap
trigger:
  - type: turned_on
    platform: device
    device_id: 52eae951b4976236251ea7c7c31698f4
    entity_id: binary_sensor.octopus_intelligent_slot
    domain: binary_sensor
condition:
  - condition: time
    after: "05:30:00"
    before: "23:30:00"
    weekday:
      - mon
      - tue
      - wed
      - thu
      - fri
      - sat
      - sun
action:
  - service: script.solis_force_charge_on
    data: {}
mode: single

With a similar automation to turn it off again. The script is based on your economy 7 one:

solis_force_charge_on:                          
  alias: Solis Force Charge On                        
  sequence:                                     
  - service: script.solis_write_holding_register         
    data:                                       
      register_addr: 43153                      
      register_value: 05                                                         
  - service: script.solis_write_holding_register
    data:                                                  
      register_addr: 43154                                                       
      register_value: 30                        
  - service: script.solis_write_holding_register
    data:                                                      
      register_addr: 43155                      
      register_value: 23                        
  - service: script.solis_write_holding_register          
    data:                                       
      register_addr: 43156                                                           
      register_value: 29                              
  mode: single                                  
  icon: mdi:battery-clock-outline                         

Again, with another to set the times all back to 00 when the cheap rate ends.

Nothing revolutionary, but thought it might help someone! Thanks again for your great work.

fboundy commented 1 year ago

Thanks Rob - I will add the additional slots and your scripts to the next Release