diy solar

diy solar

Solis and Octopus Integration

chaosnature

New Member
Joined
Sep 15, 2022
Messages
455
I know this is off-topic, so pardon me...just private me if you can help

a colleague of mine has a program that uses the Solis-HA integration to determine the cheap times and get the Solis to charge at those times
1711053094129.png



I have integrated my Solis and Octopus using the Provided API - I can now read off the tariff data and other data thanks to the integration - does anyone know how to take this beyond just reading data and be able to trigger the Solis to charge at selected cheaper times? (Private me if you can help) - thanks

Solis and Octopus Integration Screenshots
1711053382603.png

1711053434716.png
 
calling @rpdom :) I think he has done an integration between Octopus and his Solis via the Solis RS486 / modbus control parameters - maybe not that automated though :unsure:

I force charge of my Solis via CANBus, but probably easier to do it via the Modbus interface. Also see this thread about controlling the Solis...
 
calling @rpdom :) I think he has done an integration between Octopus and his Solis via the Solis RS486 / modbus control parameters - maybe not that automated though :unsure:
Only semi automated, and using my own bits of code in C and Python, but not with Home Assistant, so of little help here. I can point to register numbers if needed, but that's about it.
 
OK - in which case, as the OP "can now read off the tariff data and other data thanks to the integration", then surely all that is needed is to add some logic to the tariff data to define when he wants the batteries to be charged...

e.g. some code that does something like this...

while (1)
{
float tariffRateNow = getCurrentTariff();
if ((tariffRateNow < 0.1 && (SOC < 50%)) || (tariffRateNow < 0 ))
{
StartChargingFromGrid();
}
else
{
StopChargingFromGrid();
}
}

and where the function StartChargingFromGrid() runs code that either:-
a) implements a MITM on the CANBus to adjust what the Solis sees as the SOC. This is what I do, but IMO would be overly complex for the OP's requirements.
b) implements a MITM on the RS485 meter port to force the Solis to charge from grid, as @peufeu does in his grugbus project that I linked to above or
c) sends an RS485 Modus command to the Solis logging port, as @rpdom does (manually) and tweaks whatever ModBus register is needed to force the charge.

I suspect option (c) would be the simplest to implement.
 
I'm in the middle of doing that, though aimed at the Flux tariff. Considerably simpler, but could be used as a basis for extending to Agile.

I'm tapping in to the modbus logger RS-485 port for Solis observe/control and to the battery console RS-232 for observe.
For this purpose you wouldn't need the latter (only needs SOC, and the Solis gives that out too).
Hardware all running off PoE.
Using SolaX and Solcast for HA, and some (likely poor quality) yaml to tell me when to manually twiddle charge current and times.

Yet to do is the automation bit to do the twiddle about midnight.

The only python I've needed so far is for getting to the battery data.
 

Attachments

  • Screenshot from 2024-03-22 16-14-58.png
    Screenshot from 2024-03-22 16-14-58.png
    181.5 KB · Views: 1
The first cut at the automation is:
YAML:
id: '1711135569910'
alias: Update Solis charge-from-grid
description: ''
trigger:
  - platform: time
    at: '23:55:00'
condition:
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: state
            entity_id: sensor.battery_gridcharge_rate
            state: '0'
          - condition: not
            conditions:
              - condition: state
                entity_id: number.solax_solis_timed_charge_current
                state: '0'
      - condition: and
        conditions:
          - condition: not
            conditions:
              - condition: state
                entity_id: sensor.battery_gridcharge_rate
                state: '0'
          - condition: state
            entity_id: number.solax_solis_timed_charge_current
            state: '0'
action:
  - service: number.set_value
    metadata: {}
    data:
      value: '{{states("sensor.battery_gridcharge_rate")}}'
    target:
      entity_id: number.solax_solis_timed_charge_current
  - choose:
      - conditions:
          - condition: state
            entity_id: sensor.battery_gridcharge_rate
            state: '0'
        sequence:
          - service: number.set_value
            metadata: {}
            data:
              value: '2'
            target:
              entity_id: number.solax_solis_timed_charge_end_hours
          - service: number.set_value
            metadata: {}
            data:
              value: '1'
            target:
              entity_id: number.solax_solis_timed_charge_end_minutes
    default:
      - service: number.set_value
        metadata: {}
        data:
          value: '4'
        target:
          entity_id: number.solax_solis_timed_charge_end_hours
      - service: number.set_value
        metadata: {}
        data:
          value: '59'
        target:
          entity_id: number.solax_solis_timed_charge_end_minutes
  - service: button.press
    metadata: {}
    data: {}
    target:
      entity_id: button.solax_solis_update_charge_discharge_times
mode: single

I guess I now need some really cloudy days to see if it works.
 
Back
Top