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"
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"