User guide - flashg1/evSolarCharger GitHub Wiki

GUI display examples

Dashboard Tesla style power card

https://github.com/reptilex/tesla-style-solar-power-card

image

type: custom:tesla-style-solar-power-card
name: Power usage
show_w_not_kw: 1

# 3 flows between bubbles
grid_to_house_entity: sensor.grid_power_import
generation_to_grid_entity: sensor.grid_power_export
generation_to_house_entity: sensor.solar_power_consumption

# Optional appliance 1: EV
appliance1_consumption_entity: sensor.tesla23m3_home_charger_power
appliance1_extra_entity: sensor.battery

# Optional appliance 2: hot water
appliance2_consumption_entity: sensor.hotwater_bottom_element_power
appliance2_extra_entity: sensor.hotwater_top_element_power

# Optional 3 main bubble icons for clickable entities
grid_entity: sensor.main_power_net
grid_extra_entity: sensor.grid_power_net_1_minute_moving_average
house_entity: sensor.envoy_[YourEnvoyId]_current_power_consumption
# Watch this for car charge limit change
house_extra_entity: number.charge_limit
generation_entity: sensor.solar_power_production
generation_extra_entity: sensor.solar_power_production_5_minute_moving_average

Dashboard EV solar charger control

The running instance count shows whether the automation is running or not.

image

type: entities
entities:
  - type: attribute
    entity: automation.[YourEvName]_solar_charger_automation
    attribute: current
    name: Running instance count
  - type: attribute
    entity: automation.[YourEvName]_solar_charger_automation
    attribute: last_triggered
    name: Last triggered
  - entity: input_button.[YourEvName]_start_solar_charger
  - entity: binary_sensor.charger
  - entity: button.wake_up
  - entity: button.force_data_update
  - entity: device_tracker.location_tracker
  - entity: binary_sensor.charging
  - entity: number.charging_amps
  - entity: sensor.range
  - entity: sensor.battery
  - entity: number.charge_limit
  - entity: sensor.time_charge_complete
  - entity: lock.charge_port_latch
title: Tesla solar charger
show_header_toggle: true

Dashboard EV charge control

image

type: entities
entities:
  - entity: input_boolean.[YourEvName]_secondary_power_source
  - entity: input_number.[YourEvName]_charger_minimum_current
  - entity: input_number.[YourEvName]_power_offset
  - entity: input_boolean.[YourEvName]_stop_charging
  - entity: input_boolean.[YourEvName]_set_daily_charge_limit
  - entity: input_boolean.[YourEvName]_adjust_charge_limit_based_on_weather
  - entity: input_datetime.[YourEvName]_next_charge_time_trigger
  - entity: input_button.[YourEvName]_charge_limit_restore_defaults
title: Charge control
show_header_toggle: false

Dashboard EV charge limit 7 days schedule

Install Lovelace card-mod card to remove left margins for icon and name in order to fit time into 2-column Grid card. (Note that your HA login profile has configuration for time format, ie. either 24 or 12 hour time format.)

image

square: false
type: grid
cards:
  - type: entities
    entities:
      - entity: input_number.[YourEvName]_charge_limit_monday
        name: Monday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_number.[YourEvName]_charge_limit_tuesday
        name: Tuesday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_number.[YourEvName]_charge_limit_wednesday
        name: Wednesday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_number.[YourEvName]_charge_limit_thursday
        name: Thursday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_number.[YourEvName]_charge_limit_friday
        name: Friday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_number.[YourEvName]_charge_limit_saturday
        name: Saturday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_number.[YourEvName]_charge_limit_sunday
        name: Sunday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
    show_header_toggle: false
    title: Limit
  - type: entities
    entities:
      - entity: input_datetime.[YourEvName]_charge_completion_time_monday
        name: Monday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
                div {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_datetime.[YourEvName]_charge_completion_time_tuesday
        name: Tuesday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
                div {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_datetime.[YourEvName]_charge_completion_time_wednesday
        name: Wednesday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
                div {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_datetime.[YourEvName]_charge_completion_time_thursday
        name: Thursday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
                div {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_datetime.[YourEvName]_charge_completion_time_friday
        name: Friday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
                div {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_datetime.[YourEvName]_charge_completion_time_saturday
        name: Saturday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
                div {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
      - entity: input_datetime.[YourEvName]_charge_completion_time_sunday
        name: Sunday
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
                div {
                  display: none;
                }
                .info {
                  margin-left:0 !important;
                }      
    show_header_toggle: true
    title: End time
columns: 2
title: Charge schedule

Create permanent scene to set charge limit defaults

Settings > Automations and scenes > Scenes > Create scene, eg.

Name: [YourEvName]_charge_limit_defaults
Entities:
 input_number.[YourEvName]_charge_limit_monday
 input_number.[YourEvName]_charge_limit_tuesday
 input_number.[YourEvName]_charge_limit_wednesday
 input_number.[YourEvName]_charge_limit_thursday
 input_number.[YourEvName]_charge_limit_friday
 input_number.[YourEvName]_charge_limit_saturday
 input_number.[YourEvName]_charge_limit_sunday
 input_datetime.[YourEvName]_charge_completion_time_monday
 input_datetime.[YourEvName]_charge_completion_time_tuesday
 input_datetime.[YourEvName]_charge_completion_time_wednesday
 input_datetime.[YourEvName]_charge_completion_time_thursday
 input_datetime.[YourEvName]_charge_completion_time_friday
 input_datetime.[YourEvName]_charge_completion_time_saturday
 input_datetime.[YourEvName]_charge_completion_time_sunday

Note: Use scene editor to modify defaults.

Button to restore charge limit defaults

Create the button, eg

input_button.[YourEvName]_charge_limit_restore_defaults

Create automation for the button, eg.

alias: [YourEvName] charge limit restore defaults
description: Restore [YourEvName] charge limit defaults on button press.
triggers:
  - trigger: state
    entity_id:
      - input_button.[YourEvName]_charge_limit_restore_defaults
conditions: []
actions:
  - action: scene.turn_on
    target:
      entity_id: scene.[YourEvName]_charge_limit_defaults
    data: {}
mode: single

Automation cannot be triggered

The Tesla triggers and conditions are slow to update unless car is polled often. Polling too often can drain the car battery. So might have to wait up to 15 minutes for the conditions to refresh and the triggers to work. Please see below for a number of possible work-arounds.

Possible work-arounds:

  • Run the automation manually by selecting the automation and then select "Run Actions".
  • Plug in the charger and then press the "Wake up" button follow by the "Force data update" button.
  • Create a button to manually start the automation. See below.
  • Install the "Ping" integration to ping car, and then run an automation to wake up car and force update HA on first ping response.

Please see this for more info.

How to create a button in HA for manually starting the automation?

Create the button, eg.

  - entity: input_button.[YourEvName]_start_solar_charger

Create automation for the button, eg.

alias: [YourEvName] start solar charger automation
description: Start [YourEvName] solar charger on button press.
triggers:
  - trigger: state
    entity_id:
      - input_button.[YourEvName]_start_solar_charger
conditions: []
actions:
  - action: automation.trigger
    metadata: {}
    data:
      skip_condition: true
    target:
      entity_id: automation.[YourEvName]_solar_charger_automation
mode: single

Use "Ping" to detect car and trigger automation to get latest status

Install the "Ping (ICMP)" integration, and then configure it to ping the static IP address (don't use the host name since HA can take up to 10 minutes to resolve the host name) of your car. The first ping response will trigger the following automation to wake up car and force update HA on latest status. Car will respond to ping as long as car is awake.

alias: [YourEvName] presence update
description: "Wake up car and force update HA if charger is plugged in within 15 minutes of first ping response."
triggers:
  - trigger: state
    entity_id:
      - binary_sensor.[YourEvIpAddress]
    to: "on"
conditions:
  - condition: state
    entity_id: binary_sensor.[YourEvChargerPluggedInSensor]
    state: "off"
actions:
  - action: button.press
    metadata: {}
    data: {}
    target:
      entity_id: button.wake_up
  - delay:
      hours: 0
      minutes: 0
      seconds: 40
      milliseconds: 0
  - repeat:
      sequence:
        - action: button.press
          metadata: {}
          data: {}
          target:
            entity_id: button.force_data_update
        - delay:
            hours: 0
            minutes: 1
            seconds: 0
            milliseconds: 0
      until:
        - condition: or
          conditions:
            - condition: state
              entity_id: binary_sensor.[YourEvChargerPluggedInSensor]
              state: "on"
            - condition: template
              value_template: "{{ repeat.index >= 15 }}"
mode: single