I’m experiencing the following (haven’t read it in this discussion):
Whenever Tesla is offline, the start or stop charging commands don’t work. Probably nothing to do with the automation, because of: when you start charging manually via HA (button f.e.), you experience the same thing (I have to click it twice).
In other words: is there a way to wake up the car before sending the “start charge” command?
I’ve got it installed, however I dont seem to have a powerwall_reserve so am getting this error…
2021-12-04 10:35:46 ERROR (SyncWorker_7) [homeassistant.components.python_script.auto_charge_tesla.py] Error executing script: float() argument must be a string or a number, not 'NoneType'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 222, in execute
exec(compiled.code, restricted_globals)
File "auto_charge_tesla.py", line 16, in <module>
TypeError: float() argument must be a string or a number, not 'NoneType'
you need to create two input numbers with below names. Also I made slight changes to my code (in my original code above), so please make sure you got those changes.
@cpuram I wonder if you wouldn’t mind helping me, I’m trying to dumb down your script a little by just setting my cars to 16A when two cars are plugged in, or 32A if only one car is plugged in.
when you plug in the charger, I don’t think it would change the car at 32A (even if that is what the car is set to). It slowly ramps up in a few seconds. You just have to make sure you automation kicks in just in time to change the AMPS. For that to work I would
first add the charger sensor (binary_sensor.red3_charger_sensor) to trigger entities. So that the the automation gets triggered as soon as you plug in the charger (hopefully before it ramps up all the way up)
in the main section put in the logic to check the status of the other car and set the AMPS to appropriate levels.
I’m guessing the charge rate is the max (32A for single phase), and powerwall_reserve is self explanatory. I dont however see in the script how you are changing the Amps to match solar production and only use what would normally be exported to the grid?
I dont need to do that because of my unique situation (solar prod = powerwall max delivery). Occasionally I change it manually by sliding the target_charge_rate slider. Anyway you can call the service as below. Its part of my start_tesla_charging in my code.
OK, I think I’ve made progress - thanks for your tips cpuram. You were right the input number needed to be renamed to target_charge_rate. I missed the change in your python script.
I can now manually set the Amps charge rate via the ‘target_charge_rate’ input number.
I’m a little confused by your statement above, in relation to matching excess solar production to the Amp charge rate: “I dont need to do that because of my unique situation (solar prod = powerwall max delivery).”
Could you elaborate a bit on your situation and what you mean by this? Surely you would still want to optimise the use of excess solar to match your car charge rate?
Either way, I would like to expand this so that the Amp charge rate of the car is matched to the excess solar production. Being a newbie to Hass (and not a python coder) do you have any tips on how I could do this?
I assume I would have to utilise one of the powerwall HA sensors and match grid export power to set the target_charge_rate input number?
@Chacsam
Have you changed anything to your coding or elsewhere since you’ve posted this ? I intend to create the exact same (also including homewizard p1)
I have MCU2 and use and will keep on using on/off, for now. I drive enough so charging on the remaining of my solar panels wouldn’t bring me very far (literally ).
Could be that this changes in summer (my max solar panel output on the best summer day is 40 kWh).
Have to say I don’t have a home battery.
Hmm I’d definitely need it to be able to also change the amperage automatically. I have 60kw days in the summer and it would be nice to push all excess on the car without suddenly having high peak if the sun is gone for a bit.
I first need to find a raspberry pi which is difficult given chip shortage, or an odriod n2+ which seems more easy to get (does it really matter?)
Good Morning,
I have just read in the 2022.2 release notes that HomeWizard has become an official integration.
Might be useful to start from that one at once:
I have tried to use (kind of all) options but i am still not there yet. I landed on the @Chacsam one for now which i inputted in the visual editor as putting the code in the YAML did not work so i must have done something wrong there
So now it works when i press ‘run action’, but it does not seem to trigger it on its own? Is there anyone who can help me with this? the below is what i have
condition:
- condition: state
entity_id: device_tracker.tesla_model_3_location_tracker
state: Away
That means that the automation only kicks off when the car is not at home.
Could that be the issue? (You can also check the trace of the automation when clicking on the clock)
I thought I explained that in my post but apparently I did not save that part.
The location always shows ‘away’ so I probably have to adjust some settings in the car itself
So I don’t think that is the issue at this point as it is constantly on ‘away’ in case.
I have a feeling I have just forgotten something very stupid here so that it actively checks every X seconds or minutes or so. Like a loop Function if that makes sense
OK, Slice the elephant.
As the condition is not relevant here, remove it from your automation.
The technical state for “Away” is “not_home”, so your condition should match “not_home” anyway.
A test you can do is manually activate the switch from the services tab in the development tools. Does that work?