flashg1 / TeslaSolarCharger

Home Assistant Blueprint to charge Tesla car using surplus solar electricity and weather forecast.
MIT License
16 stars 6 forks source link

Automation won't run? #5

Open changer1198 opened 1 year ago

changer1198 commented 1 year ago

New at this but I have followed everything but the automation doesn't seem to be running? Even if I manually try "Run Actions", it just says "Last Triggered - Never"

I see this in the error log.

Logger: homeassistant.helpers.template Source: helpers/template.py:240 First occurred: 10:49:05 AM (8 occurrences) Last logged: 11:34:39 AM

Template variable error: list object has no element 0 when rendering '{{ expand(car_chargelimit_ent)[0].last_changed | as_timestamp }}'

Logger: homeassistant.components.automation.tesla_solar_charger_automation Source: components/automation/init.py:269 Integration: Automation (documentation, issues) First occurred: 10:49:05 AM (8 occurrences) Last logged: 11:34:39 AM

Error rendering variables: UndefinedError: list object has no element 0

Not sure where to start looking...?

Thanks

flashg1 commented 1 year ago

Hi @changer1198, please double check your installation steps, and also the Tesla integration device is working, ie.

Settings > Devices & Services > Tesla Custom Integration >

You should see something like this,

image

changer1198 commented 1 year ago

The Tesla Integration is working.

I have a Tesla Wall connector instead of the UMC. Would that make a difference?

flashg1 commented 1 year ago

I don't think it is wall connector or UMC related since the script is only talking to the car. You might still want to test with the UMC to see if it works, but I doubt it.

What is your charge limit set to?

changer1198 commented 1 year ago

Was set to 32amp.

Can test the UMC tomorrow

flashg1 commented 1 year ago

I mean the battery charge limit. 70% ?

That is what the error is complaining about.

changer1198 commented 1 year ago

Oh sorry. It was at 90%

changer1198 commented 1 year ago

Ok, it may be working now, it started charging at least and no errors.

Will monitor to see if it reacts to the solar properly.

One quick question, how did you get the Tesla to show up on the Solar graphic above home?

flashg1 commented 1 year ago

I've updated the github page with the answer, ie.

https://github.com/flashg1/TeslaSolarCharger#dashboard-tesla-power-card

optional appliances with consumption and extra values

appliance1_consumption_entity: sensor.charger_power appliance1_extra_entity: sensor.battery