jmcollin78/solar_optimizer

Always charge car during the night when below target charge level

Closed this issue · 6 comments

pvmil commented

The Optimizer can result in not having the car charged in the morning when there was not enough sugar power available to charge the car. I would not like to solve this with my own scripting, it works be nice to manage this in the solar Optimizer

I'd like to see a parameter activate device time to enable a forced start (charging car, starting dishwasher,..). Typically this is during night time in my case

Describe alternatives you've considered
Using the manual control option to accomplish this wich I expect will work

Thanks for your great efforts!

Yes, I have in mind for doing that one day. I keep it.

Please be patient, I have really no time for doing that quickly.

I made an automation for this particular case, in order to keep the battery level of my car at a minimum. I understand that you'd like the addon to handle this part as well, but in any case I think it could help you or someone else.

Pre-requisite :

  • This work on my tesla, with the HA integration you can find on Hacs. I don't know about other vehicles.
  • The car is scheduled to charge at night using the tesla app.

What the automation does : Based on the charge plan defined using an input_select, the charge limit of the car is adjusted before the scheduled charging begins. The optimizer is turned off if needed and turned back on in the morning. Minimum battery level is set to 50%.

alias: 🌞 Solar Optimizer - Titine
description: ""
trigger:
  - alias: At 06:00 AM
    platform: time
    at: "06:00:00"
    id: morning
  - alias: At 10:00 PM
    platform: time
    at: "22:00:00"
    id: night
condition:
  - condition: state
    entity_id: device_tracker.titine_location_tracker
    state: home
    alias: Titine is at home
action:
  - alias: Depending on the time of day
    choose:
      - conditions:
          - condition: trigger
            id:
              - morning
            alias: When triggered in the morning
        sequence:
          - alias: >-
              Adjust battery level based on Titine's charging plan
            choose:
              - conditions:
                  - condition: state
                    entity_id: input_select.titine_charge_plan
                    state: Solar
                    alias: Charging plan is set to solar
                sequence:
                  - alias: Set battery charge limit to 100%
                    service: number.set_value
                    metadata: {}
                    data:
                      value: "100"
                    target:
                      entity_id: number.titine_charge_limit
                  - service: switch.turn_on
                    target:
                      entity_id: switch.enable_solar_optimizer_titine
                    data: {}
                    alias: Enable solar optimization for Titine
                alias: Charging plan is set to solar and battery level is below 50%
              - conditions:
                  - condition: state
                    entity_id: input_select.titine_charge_plan
                    state: Off-peak hours
                    alias: "Charging plan: Off-peak hours"
                sequence:
                  - alias: Set battery charge limit to 75%
                    service: number.set_value
                    metadata: {}
                    data:
                      value: "75"
                    target:
                      entity_id: number.titine_charge_limit
                  - service: switch.turn_off
                    target:
                      entity_id: switch.enable_solar_optimizer_titine
                    data: {}
                    alias: Disable solar optimization for Titine
                alias: Charging plan is set to off-peak hours
        alias: In the morning
      - conditions:
          - condition: trigger
            id:
              - night
            alias: When triggered in the evening
        sequence:
          - alias: >-
              Adjust battery level based on Titine's charging plan
            choose:
              - conditions:
                  - condition: state
                    entity_id: input_select.titine_charge_plan
                    state: Solar
                    alias: Charging plan is set to solar
                sequence:
                  - alias: Set battery charge limit to 50%
                    service: number.set_value
                    metadata: {}
                    data:
                      value: "50"
                    target:
                      entity_id: number.titine_charge_limit
                  - if:
                      - condition: numeric_state
                        entity_id: sensor.titine_battery
                        below: 50
                        alias: If battery level is below 50%
                    then:
                      - service: switch.turn_off
                        target:
                          entity_id: switch.enable_solar_optimizer_titine
                        data: {}
                        alias: Disable solar optimization for Titine
                    alias: If battery level is below 50%, disable solar optimization.
                alias: Charging plan is set to solar
              - conditions:
                  - condition: state
                    entity_id: input_select.titine_charge_plan
                    state: Off-peak hours
                    alias: "Charging plan: Off-peak hours"
                sequence:
                  - if:
                      - alias: >-
                          Battery charge limit is below 75%
                        condition: numeric_state
                        entity_id: number.titine_charge_limit
                        below: 75
                    then:
                      - alias: Set battery charge limit to 75%
                        service: number.set_value
                        metadata: {}
                        data:
                          value: "75"
                        target:
                          entity_id: number.titine_charge_limit
                    alias: If battery charge limit is below 75%, set it to 75%
                  - service: switch.turn_off
                    target:
                      entity_id: switch.enable_solar_optimizer_titine
                    data: {}
                    alias: Disable solar optimization for Titine
                alias: Charging plan is set to off-peak hours
        alias: In the evening
mode: single

I should turn this into a blueprint but I'm lazy

I will intégrate this directly in the integration. It is very interesting for many people (and I).

Hi

I'm using this to charge my car:
https://github.com/jonasbkarlsson/ev_smart_charging/

And my plan is to use it in parallel with Solar Optimizer:

  • use as much as possible of Solar energy in daytime
  • and EV Smart Charging for nights or periods with cheaper energy

Same logic in both: Turn a switch on or off for a certain period and optionally adjust the load.
And automations can handle that they are not interfering with each other (one app turns devices on and another off)

Similar issue: #47

Hello,

this is now implemented with release 2.1. Please have a look.

https://github.com/jmcollin78/solar_optimizer/releases/tag/2.1.1