Skip to content

Dynamically set charge end time #23

@EoinOL7

Description

@EoinOL7

Hi,
Thanks for a great script - it saved me a lot of time. This is not an issue but I am new to HA (& git) so apologies if not appropriate to post here.
I got this script to set discharge time dynamically based on SOC (from solis.sensor) with the formula below; I hope this is useful
(variables for start time/amps could be used to avoid value duplication)

Calculate discharge end time from 17:00:
"17:00 + (current SOC - target SOC * (battery capacity/(voltage*amp)) *3600 for minutes)"

days:
- chargeCurrent: "30"
dischargeCurrent: "60"
chargeStartTime: "23:05"
chargeEndTime: "07:55"
dischargeStartTime: "09:00"
dischargeEndTime: "12:00"
- chargeCurrent: "30"
dischargeCurrent: "60"
chargeStartTime: "00:00"
chargeEndTime: "00:00"
dischargeStartTime: "17:00"
dischargeEndTime: >-
{{ (strptime('17:00:00','%H:%M:%S')|as_timestamp +
((int(states('sensor.solis_remaining_battery_capacity'))-20)/100)*(14910/(49.9 * 60))*3600)|timestamp_custom('%H:%M',
True) }}
- chargeCurrent: "30"
dischargeCurrent: "60"
chargeStartTime: "00:00"
chargeEndTime: "00:00"
dischargeStartTime: "00:00"
dischargeEndTime: "00:00"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions