-
-
Notifications
You must be signed in to change notification settings - Fork 731
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
Charger template for tesla-ble #18194
base: master
Are you sure you want to change the base?
Conversation
en: Port of the Tesla BLE HTTP Proxy | ||
render: | | ||
type: custom | ||
power: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andig I noticed that chargers can take a power
getter so I'm trying this since TeslaBleHttpProxy
provides voltage and amps. However, it works fine without this (I assume evcc just estimates this but I haven't found that code yet). Curious if you think it is worth keeping?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dunno. Worth keeping it its better than the estimate.
source: http | ||
uri: {{ .url }}:{{ .port }}/api/1/vehicles/{{ .vin }}/vehicle_data?endpoints=charge_state | ||
method: GET | ||
jq: (.response.response.charge_state.charging_state == "Charging" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This wont work. Enabled is not charging. Enabled is „allowed to charge“.
source: http | ||
uri: {{ .url }}:{{ .port }}/api/1/vehicles/{{ .vin }}/vehicle_data?endpoints=charge_state | ||
method: GET | ||
jq: .response.response.charge_state.charger_voltage * .response.response.charge_state.charger_actual_current |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for 1 phase. You should check if 1 oder 3 phases are used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wimaha should I be multiplying by charger_phases
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Friendly ping @wimaha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if charger_phases is >= 2 you should multiply by 3. this way old Tesla are also supported.
Is evcc polling one of the values to detect a new charging process? |
Like with every other wallbox evcc reads the connected/charging status each cycle. |
@wimaha yes, the polling is a bit of an issue -- it does keep my car awake all the time: Do any of the BLE commands not wake up the car? Perhaps there is something else that can be used for Charge flap closed = A (no vehicle connected) @andig I'm still not sure what |
@wimaha Ah unfortunately I see now that checking the charge flap state requires the car to be awake. Perhaps the best thing to do here is going to be to buy a wall charger 😢 |
All |
@Lenart12 oh that sounds promising! thanks, I'll dig into that 😄 |
Ah unfortunately it seems that |
It does! There is a bug in current version. wimaha/TeslaBleHttpProxy#87 (comment) |
@Lenart12 very cool! I'll test your branch out. I'm curious what you think of the logic for |
I guess I would add it like this, but I have no idea what this is about really... I'm using the proxy for another project; we just run in to the same problems :D status:
source: http
uri: {{ .url }}:{{ .port }}/api/1/vehicles/{{ .vin }}/vehicle_data?endpoints=charge_state&nowakeup=true
method: GET
jq: (if (.response.reason == "failed to get vehicle data: car is asleep") then "B"
elif (.response.response.charge_state.charging_state == "Charging") then "C"
elif (.response.response.charge_state.charging_state == "Stopped") then "B"
elif (.response.response.charge_state.charging_state == "NoPower") then "B"
elif (.response.response.charge_state.charging_state == "Complete") then "B"
else "A" end)
timeout: 30s |
@andig Perhaps you could offer some guidance here. In order to get the charger state without waking the car using I don't think there is an existing provider that can handle this complex logic -- there are no Alternatively, I can try adding a evcc-specific endpoint to |
I don‘t think you can do that with templates. |
What about fetching with source: javascript? source: js
script: >-
let bcs = fetch(...) |
@Lenart12 this is a nice idea but unfortunately it seems that stuff like |
Unfortunately, I don't think this is going to work. According to teslamotors/vehicle-command#368 the charge port status is not correctly reported using the |
This change compliments the tesla-ble vehicle template (see #17866) by interfacing with TeslaBleHttpProxy to control charging. This is useful for folks that are using TeslaBleHttpProxy to communicate with their Tesla but who do not have the TWC (wall charger) but rather use the UMC (mobile charger).
Several of the field definitions are the same as the tesla-ble vehicle template since there seems to be a bit of overlap between the vehicle and charger devices.
An example config (has the same fields as the tesla-ble vehicle template):