-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tesla custom integration configuration for charger-card #37
Comments
Looks good. Is |
Yes, duka is the car name added by the Tesla Custom Integration. |
Maybe post your yaml and some of the sensor values |
type: custom:charger-card
entity: binary_sensor.charger
customCardTheme: black
customImage: /local/tesla.png
details:
name: Model Y
location:
entity_id: device_tracker.location_tracker
status:
entity_id: binary_sensor.charger
attribute: charging_state
substatus:
entity_id: sensor.charging
attribute: charge_port_latch
smartcharging:
entity_id: binary_sensor.charger
attribute: fast_charger_type
currentlimits:
- 0
- 1
- 8
- 16
info_left:
- entity_id: binary_sensor.online
attribute: state
info_right:
- entity_id: sensor.battery
icon: mdi:car-electric-outline
unit: '%'
unit_show: true
- entity_id: sensor.charger_power
text: Power
unit_show: true
unit: kW
icon: mdi:lightning-bolt
- entity_id: sensor.charger_power
attribute: charger_volts
text: voltage
unit: V
unit_show: true
icon: mdi:sine-wave
- entity_id: number.charging_amps
text: amp
unit: A
unit_show: true
icon: mdi:current-ac
stats:
default:
- entity_id: sensor.charging_rate
attribute: time_left
text: remaining
unit_show: true
unit: hrs
- entity_id: sensor.energy_added
text: Energy Added
unit_show: true
unit: kWh
- entity_id: sensor.charger_power
attribute: charger_amps_request
text: Request
unit: A
unit_show: true
- entity_id: number.charging_amps
text: Actual
unit: A
unit_show: true
- entity_id: switch.charger
text: Switch
group2:
- entity_id: sensor.charging_rate
attribute: charger_voltage
text: voltage
unit: V
unit_show: true
- entity_id: sensor.charging_rate
attribute: charger_amps_actual
text: amp
unit: A
unit_show: true
- entity_id: sensor.charging_rate
attribute: charger_power
text: Power
unit_show: true
unit: kW
- entity_id: sensor.charging_rate
attribute: charge_energy_added
text: Energy Added
unit_show: true
unit: kWh
- entity_id: sensor.charging_rate
attribute: charge_current_request
text: Request
unit: A
unit_show: true
- entity_id: sensor.charging_rate
attribute: charger_actual_current
text: Actual
unit: A
unit_show: true
- entity_id: switch.charger
text: Charger Switch
toolbar_right:
default:
- service: script.tesla_charging_current_low
text: Excess Solar Charging
icon: mdi:solar-power
- service: script.tesla_high
text: 1A charging
icon: mdi:numeric-1
- service: script.tesla_16a
text: 16A charging
icon: mdi:numeric-9-plus |
Nice looking good. Any way to update the text for "not_home" to Away or something? Or even better geolocation? Whats the vertical grey bar, you have it on your image, as does mine. Do you have any more info on the service calls for charging? I have a 48a wall charger and the mobile charger too, so that would be handy. |
probably because you didn't have an updated image, which seems to be resolved in your latest update. |
Vertical grey bar is a legacy from the charging lights on the original wallbox graphics. @tmjo is there any way to remove the grey bar with a custom image? Setting show_leds: false Gets rid of the grey bars. |
nice, thanks |
Yes, sorry the service calls at the bottom for the sun icon, 1 & 9+ icons are using the legacy interface and are just calling some scripts I have setup locally. You can either use your own scripts, or here are the updated services for 1A & 16A amp charging. toolbar_right:
default:
- service: script.tesla_charging_current_low
text: Excess Solar Charging
icon: mdi:solar-power
- service: number.set_value
service_data:
entity_id: number.duka_charging_amps
value: '1'
text: 1A charging
icon: mdi:numeric-1
- service: number.set_value
service_data:
entity_id: number.duka_charging_amps
value: '16'
text: 16A charging
icon: mdi:numeric-9-plus |
just curious, when would you use 1A and 16A charging? 1A is super slow, and 16A is more than a standard 120v outlet allows, but way lower than a Nema outlet, or a wall connector. Think i'm going to do 12a, 24a and 48a |
For different applications, I generally want to run off my excess solar. Sometimes it runs away quicky so I wanted the 1A solution to bring down the charging rate. I'm in Australia and have three phase 230V supply, so the highest my HPWC can go is 16A x 3 phase x 230V = 11 kW, for single phase supply in Australia the highest we can go with HPWC is 32A x 230V = 7 kW. The great thing is the card can be setup to meet different needs.. Thanks @tmjo |
ah cool. well If I ever get solar, i'll do that. would be cool if it was variable charging based on excess |
Thats exactly what I do, the power of home assistant. I dynamically calculate the excess solar and convert that to a 'charging_amps' entity which I update the car with every minute. excess_solar_charging_amps:
friendly_name_template: 'Excess Solar Charging Amps'
value_template: >-
{{ max(0,(states('sensor.apf_solar2grid')|int(0)+states('sensor.ev_power')|int(0))
/ states('sensor.ev_phases')|int(1) /
max(220,states('sensor.ev_voltage')|int(230)))|int(0)}}
unit_of_measurement: A |
nice work! you keep it just a hair below excess, nice code. |
Updated to v0.2.0-alpha and haven't noticed any changes to my Tesla configuration/ functionality. Thanks @tmjo for your great work. |
Sounds good! Would you mind checking if the UI-editor looks ok now? Also, if you're feeling lucky, you may want to test the Tesla setup (from brands/template). Remember to backup your current YAML first so you can easily go back. Or even better, just setup a new additional card for experimenting. Perhaps we could edit the Tesla template to fit what you guys want/need? |
Starting with an empty card, entity selection dialogue doesn't seem to make it easy to find what you want :-( Screen.recording.2023-02-21.16.33.36.webm |
After I manually entered the correct entity via code editor: type: custom:charger-card
entity: binary_sensor.duka_charger selecting brand 'Tesla EV custom integration' presented a bunch of sensible defaults, and the card is usable. type: custom:charger-card
entity: binary_sensor.duka_charger
brand: tesla_custom
show_leds: true
details:
name:
entity_id: sensor.duka_state_data
attribute: vehicle_name
location:
entity_id: device_tracker.duka_location_tracker
status:
entity_id: binary_sensor.duka_charger
substatus:
entity_id: sensor.duka_charging
attribute: charge_port_latch
smartcharging:
entity_id: binary_sensor.duka_charger
attribute: fast_charger_type
currentlimits:
- 0
- 1
- 8
- 16
statetext: {}
collapsiblebuttons:
group1:
text: click_for_group1
icon: mdi:speedometer
group2:
text: click_for_group2
icon: mdi:information
group3:
text: click_for_group3
icon: mdi:cog
info_left:
- entity_id: binary_sensor.duka_online
text: state
info_right:
- entity_id: sensor.duka_battery
icon: mdi:car-electric-outline
unit: '%'
unit_show: true
- entity_id: sensor.duka_charger_power
text: power
unit_show: true
- entity_id: number.duka_charging_amps
text: amp
unit: A
unit_show: true
icon: mdi:current-ac
group2:
- entity_id: sensor.duka_charging_rate
attribute: charger_voltage
text: voltage
unit_show: true
unit: V
- entity_id: sensor.duka_charging_rate
attribute: charger_amps_actual
text: amp
unit_show: true
unit: A
- entity_id: sensor.duka_charging_rate
attribute: charger_power
text: Power
unit_show: true
unit: kW
- entity_id: sensor.duka_charging_rate
attribute: charge_energy_added
text: Energy added
unit_show: true
unit: kWh
- entity_id: sensor.duka_charging_rate
attribute: charge_current_request
text: Request
unit_show: true
unit: A
- entity_id: sensor.duka_charging_rate
attribute: charger_actual_current
text: Actual
unit_show: true
unit: A
- entity_id: switch.duka_charger
text: Charger switch
- entity_id: sensor.duka_charging_rate
attribute: charger_voltage
text: voltage
unit_show: true
unit: V
- entity_id: sensor.duka_charging_rate
attribute: charger_voltage
text: voltage
unit_show: true
unit: V
- entity_id: sensor.duka_charging_rate
attribute: charger_voltage
text: voltage
unit_show: true
unit: V
stats:
default:
- entity_id: sensor.duka_charging_rate
attribte: time_left
text: remaining
unit_show: true
unit: hrs
- entity_id: sensor.dukaenergy_added
text: Energy added
unit_show: true
unit: kWh
- entity_id: sensor.duka_charger_power
text: Request
attribute: charger_amps_request
unit: A
unit_show: true
- entity_id: number.duka_charging_amps
text: Actual
unit: A
unit_show: true
- entity_id: switch.duka_charger
text: Request
toolbar_left:
default: []
toolbar_right:
default: []
show_status: true
show_collapsibles: true
show_toolbar: true
chargerImage: Darkblue
customCardTheme: theme_default |
Some minor amendments are needed (energy added button not functional) and my bespoke setup presents slightly different data. type: custom:charger-card
entity: binary_sensor.duka_charger
customCardTheme: black
customImage: /local/tesla.png
show_leds: false
details:
name:
entity_id: sensor.duka_vehicle_state_data
attribute: vehicle_name
location:
entity_id: device_tracker.duka_location_tracker
status:
entity_id: binary_sensor.duka_charger
attribute: charging_state
substatus:
entity_id: sensor.duka_charging
attribute: charge_port_latch
smartcharging:
entity_id: binary_sensor.duka_charger
attribute: fast_charger_type
currentlimits:
- 0
- 1
- 8
- 16
info_left:
- entity_id: binary_sensor.duka_online
attribute: state
info_right:
- entity_id: sensor.duka_battery
icon: mdi:car-electric-outline
unit: '%'
unit_show: true
- entity_id: sensor.duka_charger_power
text: Power
unit_show: true
unit: kW
icon: mdi:lightning-bolt
- entity_id: sensor.duka_charger_power
attribute: charger_volts
text: voltage
unit: V
unit_show: true
icon: mdi:sine-wave
- entity_id: number.duka_charging_amps
text: amp
unit: A
unit_show: true
icon: mdi:current-ac
stats:
default:
- entity_id: sensor.duka_charging_rate
attribute: time_left
text: remaining
unit_show: true
unit: hrs
- entity_id: sensor.duka_energy_added
text: Energy Added
unit_show: true
unit: kWh
- entity_id: sensor.duka_charger_power
attribute: charger_amps_request
text: Request
unit: A
unit_show: true
- entity_id: number.duka_charging_amps
text: Actual
unit: A
unit_show: true
- entity_id: switch.duka_charger
text: Switch
group2:
- entity_id: sensor.duka_charging_rate
attribute: charger_voltage
text: voltage
unit: V
unit_show: true
- entity_id: sensor.duka_charging_rate
attribute: charger_amps_actual
text: amp
unit: A
unit_show: true
- entity_id: sensor.duka_charging_rate
attribute: charger_power
text: Power
unit_show: true
unit: kW
- entity_id: sensor.duka_charging_rate
attribute: charge_energy_added
text: Energy Added
unit_show: true
unit: kWh
- entity_id: sensor.duka_charging_rate
attribute: charge_current_request
text: Request
unit: A
unit_show: true
- entity_id: sensor.duka_charging_rate
attribute: charger_actual_current
text: Actual
unit: A
unit_show: true
- entity_id: switch.duka_charger
text: Charger Switch
toolbar_right:
default:
- service: script.tesla_charging_current_low
text: Excess Solar Charging
icon: mdi:solar-power
- service: number.set_value
service_data:
entity_id: number.duka_charging_amps
value: '1'
text: 1A charging
icon: mdi:numeric-1
- service: number.set_value
service_data:
entity_id: number.duka_charging_amps
value: '16'
text: 16A charging
icon: mdi:numeric-9-plus |
diff -u tesla-bespoke tesla-template
--- tesla-bespoke 2023-02-21 16:51:39.267651168 +1000
+++ tesla-template 2023-02-21 16:51:56.886650358 +1000
@@ -1,17 +1,15 @@
type: custom:charger-card
entity: binary_sensor.duka_charger
-customCardTheme: black
-customImage: /local/tesla.png
-show_leds: false
+brand: tesla_custom
+show_leds: true
details:
name:
- entity_id: sensor.duka_vehicle_state_data
+ entity_id: sensor.duka_state_data
attribute: vehicle_name
location:
entity_id: device_tracker.duka_location_tracker
status:
entity_id: binary_sensor.duka_charger
- attribute: charging_state
substatus:
entity_id: sensor.duka_charging
attribute: charge_port_latch
@@ -23,63 +21,44 @@
- 1
- 8
- 16
+ statetext: {}
+ collapsiblebuttons:
+ group1:
+ text: click_for_group1
+ icon: mdi:speedometer
+ group2:
+ text: click_for_group2
+ icon: mdi:information
+ group3:
+ text: click_for_group3
+ icon: mdi:cog
info_left:
- entity_id: binary_sensor.duka_online
- attribute: state
+ text: state
info_right:
- entity_id: sensor.duka_battery
icon: mdi:car-electric-outline
unit: '%'
unit_show: true
- entity_id: sensor.duka_charger_power
- text: Power
+ text: power
unit_show: true
- unit: kW
- icon: mdi:lightning-bolt
- - entity_id: sensor.duka_charger_power
- attribute: charger_volts
- text: voltage
- unit: V
- unit_show: true
- icon: mdi:sine-wave
- entity_id: number.duka_charging_amps
text: amp
unit: A
unit_show: true
icon: mdi:current-ac
- stats:
- default:
- - entity_id: sensor.duka_charging_rate
- attribute: time_left
- text: remaining
- unit_show: true
- unit: hrs
- - entity_id: sensor.duka_energy_added
- text: Energy Added
- unit_show: true
- unit: kWh
- - entity_id: sensor.duka_charger_power
- attribute: charger_amps_request
- text: Request
- unit: A
- unit_show: true
- - entity_id: number.duka_charging_amps
- text: Actual
- unit: A
- unit_show: true
- - entity_id: switch.duka_charger
- text: Switch
group2:
- entity_id: sensor.duka_charging_rate
attribute: charger_voltage
text: voltage
- unit: V
unit_show: true
+ unit: V
- entity_id: sensor.duka_charging_rate
attribute: charger_amps_actual
text: amp
- unit: A
unit_show: true
+ unit: A
- entity_id: sensor.duka_charging_rate
attribute: charger_power
text: Power
@@ -87,35 +66,64 @@
unit: kW
- entity_id: sensor.duka_charging_rate
attribute: charge_energy_added
- text: Energy Added
+ text: Energy added
unit_show: true
unit: kWh
- entity_id: sensor.duka_charging_rate
attribute: charge_current_request
text: Request
- unit: A
unit_show: true
+ unit: A
- entity_id: sensor.duka_charging_rate
attribute: charger_actual_current
text: Actual
- unit: A
unit_show: true
+ unit: A
- entity_id: switch.duka_charger
- text: Charger Switch
- toolbar_right:
+ text: Charger switch
+ - entity_id: sensor.duka_charging_rate
+ attribute: charger_voltage
+ text: voltage
+ unit_show: true
+ unit: V
+ - entity_id: sensor.duka_charging_rate
+ attribute: charger_voltage
+ text: voltage
+ unit_show: true
+ unit: V
+ - entity_id: sensor.duka_charging_rate
+ attribute: charger_voltage
+ text: voltage
+ unit_show: true
+ unit: V
+ stats:
default:
- - service: script.tesla_charging_current_low
- text: Excess Solar Charging
- icon: mdi:solar-power
- - service: number.set_value
- service_data:
- entity_id: number.duka_charging_amps
- value: '1'
- text: 1A charging
- icon: mdi:numeric-1
- - service: number.set_value
- service_data:
- entity_id: number.duka_charging_amps
- value: '16'
- text: 16A charging
- icon: mdi:numeric-9-plus
+ - entity_id: sensor.duka_charging_rate
+ attribte: time_left
+ text: remaining
+ unit_show: true
+ unit: hrs
+ - entity_id: sensor.dukaenergy_added
+ text: Energy added
+ unit_show: true
+ unit: kWh
+ - entity_id: sensor.duka_charger_power
+ text: Request
+ attribute: charger_amps_request
+ unit: A
+ unit_show: true
+ - entity_id: number.duka_charging_amps
+ text: Actual
+ unit: A
+ unit_show: true
+ - entity_id: switch.duka_charger
+ text: Request
+ toolbar_left:
+ default: []
+ toolbar_right:
+ default: []
+show_status: true
+show_collapsibles: true
+show_toolbar: true
+chargerImage: Darkblue
+customCardTheme: theme_default |
You mean the list is huge and the lack of "search" or "search-as-you-type" possibility right? If so, I agree. This is something I am aware of but haven't figured out how to fix. If you have any other ideas on how to improve the entity selection, please let me know. It would be interesting to make it more automatic or easy. Filtering could be one option. I'm just not sure what will be more "safe" for most people and what would feel most intuitive. |
The list is both huge and unable to be searched like entity dialog boxes for other integrations, which do allow searching and type ahead. It might be hard to filter given the diversity of platforms out there. |
Yes. Do you have an example of a custom integration that searches? If you do, I can take a look and see if I can steel some code. I guess that would be the best and most intuitive way. |
Hi! I'd love to add support for this charger, but kindly read the wiki on how-to. Let me know if anything is unclear and I'll update it or try to explain. Cheers! |
The Tesla Custom Integration v3 has gone through a bit of a rewrite, including some new naming schema for sensors. It now provides most of the necessary sensors to work with with the tmjo/charger-card and I have documented my configuration here, to assist others and maybe have this included as a template.
Note this accesses vehicle data/ controls via the Tesla cloud API and not the Tesla high powered wall connector (HPWC) wallbox.
The text was updated successfully, but these errors were encountered: