Skip to content
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

Missing commands #28

Closed
henrikalthofknudsen opened this issue Mar 25, 2024 · 24 comments · Fixed by #35
Closed

Missing commands #28

henrikalthofknudsen opened this issue Mar 25, 2024 · 24 comments · Fixed by #35
Assignees
Labels
help wanted Extra attention is needed

Comments

@henrikalthofknudsen
Copy link

henrikalthofknudsen commented Mar 25, 2024

The integration works very good. It´s stable and fast responding.
Thanks for that :-)

However are missing a few important commands.
In Teslafi.com -> Settings -> TeslaFi API -> Commands - All relevant is checked of (see screenshot)

When testing from Home Assistant e.g. the Horn and that works fine.
But I am missing a few especially :

  • Set Charge Limit
  • Set Charging Amps
  • Start Charging
  • Stop Charging

They are all checked off in TeslaFi.com but are not available in Home Assistant.
Am I missing something or is the TeslaFi pluging missing this?

I would be so happy if those was available :-)

TeslaFi commands

@AlisterGill
Copy link

Any chance you can also add an "open charge port" command natively? Those of us without tesla chargers with the button to open the flap either need to get our phone out and open the app or open the car and do this on the screen. I've been doing this in the past with the Tesla intergration and calling this from a zigbee button press by my front door. It would be great to get this functionality natively within the intergration. Many thanks

@dktrekkie
Copy link

dktrekkie commented Apr 9, 2024

I also added this integration, because I use TeslaFi anyways. I used the custom Tesla integration before, but can’t get it to work anymore. I mostly used it to simply unlock the car and release the charge port every morning. I can’t get that to work here. I have checked all charge port commands on TeslaFi but they don’t become available in this integration. Am I missing something?

@AlisterGill
Copy link

@dktrekkie Indeed - I couldn't find the commands in the integration and installed this one as the old tesla intergration needed fleet API etc. I can fire the charge port opening (and assumingly other commands) direct from the API so it just looks like it could be added to the intergration controls along with honking the horn and flashing the lights.

@dktrekkie
Copy link

@dktrekkie Indeed - I couldn't find the commands in the integration and installed this one as the old tesla intergration needed fleet API etc. I can fire the charge port opening (and assumingly other commands) direct from the API so it just looks like it could be added to the intergration controls along with honking the horn and flashing the lights.

Yeah. It could be really nice to get those commands available in this integration, because then this is actually a pretty good alternative to the custom integration – requiring proxies etc to work now, for people who already use TeslaFi.

@dktrekkie
Copy link

Hmm. Have been playing a bit around in Node-Red calling the API manually. But it seems it's not possible to just unlocking the charge port. You can open the charge port door, but not unlock it :(

@AlisterGill
Copy link

Does opening the charge point door not also unlock it? On the alandtse tesla integration I had a button by the door and the "Unlock Charge port latch" action would open the port and if it was already connected would unlock the charge cable.

@dktrekkie
Copy link

It actually does. Nice! My mistake! I actually only checked it on the phone, expecting it to show as unlocked there - which it does not.

@snooty83

This comment was marked as off-topic.

@jhansche
Copy link
Owner

@snooty83 please open a new issue for sentry mode.
For the charger entities, those are unavailable if the car is not plugged in, or in some cases if it is plugged in but not charging. Also some of the entities are hidden or disabled by default and will need to be enabled manually if you want to use them.

@snooty83
Copy link

@jhansche I'm not sure. Unfortunately I can't check it until next week due to the lack of charging options.
But if it were the case that it would only be available when a charger is connected, then in my opinion this would be wrong. I should have the opportunity to set the charging limit and voltage before charging. Just like on TeslaFI.

Greetings Dani

@jhansche
Copy link
Owner

Those entities I'm talking about are read-only. They report the current and voltage that are being delivered to the car. They cannot be changed.

@snooty83
Copy link

@jhansche I mean this one:

TeslaFI

@jhansche
Copy link
Owner

I know what you mean 🙂 And that is what the rest of this ticket is about: adding support for additional TeslaFi commands.

I'm referring to these that you mentioned above:

They also have a few commands listed as unavailable. How can this be activated?
Charger level
Charger power
Charger Voltage
Charger Current
Charge Time Remaining

Those are "Unavailable" like this in Home Assistant, when the car is not plugged in (or not charging). They are read-only entities.
Screenshot 2024-04-11 at 10 07 33 AM

@snooty83
Copy link

It would be great if we could manage that.
Unfortunately, I'm also a Tesla integration nerd because of the new API. and their integration is a great alternative.
I've been using TeslaFI for years.
Thanks for your work

Greetings Dani

@snooty83

This comment was marked as off-topic.

@jhansche

This comment was marked as outdated.

jhansche added a commit that referenced this issue Apr 13, 2024
@jhansche jhansche linked a pull request Apr 13, 2024 that will close this issue
@jhansche
Copy link
Owner

jhansche commented Apr 13, 2024

I've opened 2 new PRs for testing, if anyone would like to test these before releasing.

I tested the new entities from #35 (my car does not have a heated steering wheel, so I only "tested" that it shows an error 😅), but now the other half has the car so I can't test #36 until later.

Anyone interested in testing these, please install the HACS version by PR branch, which you can do with the following service in Developer Tools > Services:

service: update.install
target:
  # This entity is provided by HACS
  entity_id: update.teslafi_update
data:
  # Uncomment just ONE of these `version` lines

  ## for #35 only
  #version: fix-28/add-commands

  ## for #35 plus #36 (with start/stop charge)
  #version: fix-28/charger-switch

Keep in mind that if you do this, HACS will likely offer the current latest release (v2.5) as an update -- but that will downgrade you back to v2.5, so just ignore it unless you want or need to roll back.

Also note that these new entities are disabled by default - this is because the TeslaFi API commands must be manually enabled. So once you've enabled the TeslaFi commands, go to the device info page, and find and enable the entities you want to test:
Screenshot 2024-04-13 at 1 48 43 PM

I tried to handle various error cases, but there may still be some edge cases that are not handled. If you're going to test this, and especially if you need to report any issues with the new entities, please enable debug logging for the integration, either from the Settings > Integrations > TeslaFi screen, or in your configuration.yaml:

logger:
  default: info
  logs:
    custom_components.teslafi: debug

@jhansche jhansche added the help wanted Extra attention is needed label Apr 13, 2024
@jhansche jhansche self-assigned this Apr 13, 2024
@snooty83
Copy link

@jhansche I would like to update, but I don't understand your code. Sorry, I'm still a beginner :-)

What exactly needs to be entered into the services if I want to update it?

for #35 plus #36 (with start/stop charge)

Can you show the code as it should be so I can copy it and learn from it?

Greetings Dani

@jhansche
Copy link
Owner

@snooty83 exactly as it is in the block above, but remove the # in front of the version line you want to use. So to use the version with start/stop charge, go to Developer Tools > Services, and then click "GO TO YAML MODE" button. Paste this into the box, and click "CALL SERVICE"

service: update.install
target:
  entity_id: update.teslafi_update
data:
  version: fix-28/charger-switch

Read Developer Tools to learn more about HA dev tools.

Then once HA restarts, remember you need to enable the entity(ies) that you want to test:

  1. Settings > Integrations > TeslaFi
  2. "N Device(s)"
  3. in the "Diagnostic" section click "+N entities not shown" to expand the list and show the disabled entities
  4. select the entity you want to enable (Charging for the start/stop switch)
  5. in the top-right of the dialog, click the settings cog ⚙️ icon
  6. toggle the switch for "Enabled"
  7. click Update
  8. Repeat for other entities you want to enable
  9. wait ~30 seconds for the integration to reload and add the enabled entities

jhansche added a commit that referenced this issue Apr 13, 2024
@jhansche
Copy link
Owner

I just had a chance to test these myself, and there was an issue with the charge port door cover entity - that is fixed now, so if you tried it before now, you may need to run the update service again (same version, just run it again and restart HA again).

I also tested the Charging switch, and it is working correctly - but there is a small bug where the switch reverts back to the state it was in before clicking. The vehicle got the correct command, and if you wait for the entity to update on the polling interval, it will correct itself. I'm pushing a fix for that now, so it will also be included when you run the update service, as of now.

jhansche added a commit that referenced this issue Apr 14, 2024
* Add start/stop charge switch

This switch can take the place of the binary_sensor.charging entity,
where the switch can be toggled off/on in order to stop/start charging.

The command(s) must be enabled in TeslaFi for this to work, and the
way the entity appears in Home Assistant might be less desirable
for some - that is why the entity is disabled by default.

If you want to keep the binary_sensor, but also still have the
ability to stop/start charging, you can set the switch entity to
hidden, and use some other means to toggle the switch, like with
a Button or automation calling switch.* services.

* Set charging state optimistically
jhansche added a commit that referenced this issue Apr 14, 2024
* Raise API errors

* Add charge port door cover

This is part of #28

* Add TURN_ON/TURN_OFF ClimateEntityFeatures

These were added in 2024.2, so they need to be recreated.

This adds to the fix for #30, which implemented the callbacks, but
did not add the supported feature.

* Add steering wheel heater switch

* Add charging configs

Adds charger SOC setting, and charger current

* Fix SOC number unit

NumberEntity does not support .unit_of_measurement, requires using
.native_unit_of_measurement (%).

* Add start/stop charge switch [part of #28] (#36)

* Add start/stop charge switch

This switch can take the place of the binary_sensor.charging entity,
where the switch can be toggled off/on in order to stop/start charging.

The command(s) must be enabled in TeslaFi for this to work, and the
way the entity appears in Home Assistant might be less desirable
for some - that is why the entity is disabled by default.

If you want to keep the binary_sensor, but also still have the
ability to stop/start charging, you can set the switch entity to
hidden, and use some other means to toggle the switch, like with
a Button or automation calling switch.* services.

* Set charging state optimistically
@jhansche
Copy link
Owner

These new entities are released in version 2.6

@snooty83
Copy link

@jhansche I have installed pre-release 2.6.
I tested Set Charge Limit during sleep mode. This error message comes:

image

This wakes up Dau’s car. I can then set the limit again and it will be applied.

Greetings Dani

@jhansche
Copy link
Owner

If there is any error from TeslaFi, we just raise it up. So that's what you're seeing.

I can add a flag that should work around this error by instructing TeslaFi to wake the car and wait before proceeding with the command.

@jurviz
Copy link

jurviz commented May 12, 2024

Somehow i can't find out how to set the charge current in the car using this custom integration. Currently i'm using the Go-eCharger integration to set the current of the charger, but this only allows me to adjust as low as 6A. To set even lower i would like to use this integration.

PS: Found solution, it is working when i set request_charger_current.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants