THIS ONE DOES A CALCULATION ONLY alias: aaaf CAVAN Calculate Solis Discharge current at 8:00PM description: > Calculates discharge current based on battery at 8.00PM, sends email to notify value. triggers: - at: "20:00:00" trigger: time conditions: - condition: template value_template: > {{ states('sensor.solis_inverter_YOUR INVERTER_solis_cavan_remaining_battery_capacity') | float(0) > 0 }} actions: - variables: battery_capacity: >- {{ states('sensor.solis_inverter_YOUR INVERTER_solis_cavan_remaining_battery_capacity') | float(0) }} discharge_current: "{{ ((32000 * battery_capacity / 100 / 6.00 / 52) | round(2)) }}" - data: title: CAVAN Solis Discharge Current Estimate message: > BASED ON MATH CALCULATION OF REMAINING CAPACITY. At 8.00PM, based on a battery capacity of {{ battery_capacity }}%, the discharge current should be set to {{ discharge_current }}A to reach a SOC of 6% by 2am. action: notify.gmail mode: single XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX THIS ONE SETS THE DISCHARGE CURRENT BASED ON SOC OF BATTERIES alias: aaSet CAVAN set Solis Discharge current at 8:01PM WITH FAILURE EMAIL description: > Calculates and sets discharge current based on battery at 8.01PM, sets Slot1 Discharge Current at Cavan, and sends email to notify value or failure. triggers: - at: "20:01:00" trigger: time conditions: - condition: template value_template: > {{ states('sensor.solis_inverter_YOUR INVERTER_solis_cavan_remaining_battery_capacity') | float(0) > 0 }} actions: - variables: battery_capacity: >- {{ states('sensor.solis_inverter_YOUR INVERTER_solis_cavan_remaining_battery_capacity') | float(0) }} discharge_current: "{{ ((32000 * battery_capacity / 100 / 6.00 / 52) | round(2)) }}" - choose: - conditions: - condition: template value_template: | {{ battery_capacity > 0 }} sequence: - data: value: "{{ discharge_current }}" target: entity_id: number.inverter_control_YOUR INVERTER_slot1_discharge_current action: number.set_value - data: title: CAVAN Solis Discharge Current Set Cavan message: > At 8.01PM, based on a battery capacity of {{ battery_capacity }}%, the discharge current has been set to {{ discharge_current }}A to reach a SOC of 6% by 2am. action: notify.gmail default: - data: title: ⚠️ CAVAN Solis Discharge Setting Failed message: > Automation failed at 8.01PM. Could not determine a valid battery capacity or set discharge current. Last known value: {{ battery_capacity }}%. action: notify.gmail mode: single xxxxxxxxXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX