-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[teslascope] Initial contribution #16956
Conversation
How does this binding relate to the Tesla binding? my actual question is if this should be a separate binding or included in the other Tesla binding |
This uses the API provided by a 3rd party - https://teslascope.com/ - it is definitely a separate binding. The problem is that Tesla are going to start charging for accessing their API, and it's problematic as it requires a proxy. Using services like Teslascope (which I already use as a Tesla owner for other reasons) avoids paying Tesla for the use of the API. |
And why should it then be a different binding as it is similar to the existing binding, just using a different api? |
Whether it's a new binding I guess is a decision for the OpenHAB maintainers. It's an alternative way to access Tesla vehicles using a different API. For anyone buying a new Tesla, the current tesla binding using the legacy API won't work. But for people with older vehicles, the current tesla binding will work (for now). |
@kgoderis as you are codeowner for the tesla binding, can you comment? Or maybe @hakan42 or @kaikreuzer as frequent contributers to that binding. |
It's a tricky question as both perspectives have valid arguments. Then again, the thing-types for the cars are likely identical in our case here and they are very extensive (huge number of channels). It feels wrong to duplicate all of this and treat it as something different. (Note: for LED bulbs, we have at least system channel types, which are shared by the different bindings). @psmedley What are your thoughts on this? Do you think something like that would be feasible? |
I follow Kai's argumentation It is no different than other bindings where different protocols (ex IP or serial) can be used to access Things in the real world. If there would be a change in policy by Tesla, then this also the route with least resistance for users to switch over at some point in time |
Teslascope is using the Fleet API which is aimed at fleet operators/business. Little information exists on when the Owners API will really be phased out. Also, apparently the Fleet API is not compatible with older MCU based cars Similar discussions are ongoing in other open source initiatives @kaikreuzer We could investigate whether the openHAB foundation could act as a partner in line with the Tesla terms and conditions, and implement something equivalent to openhabcloud as a shared service |
Unfortunately I don't think this is feasible. There is (for example) no way to get a 'Products List' out of teslascope, so I have only a single 'Thing' and all channels are listed whether they are available or not (eg sunroof). Teslascope implements a subset of the channels the Tesla binding does - most are there but a good number don't exist. |
The issue will be that likely Tesla will charge for access to the fleet-api. Right now it's free, but this will change "soon". I implemented fleet-api already (https://github.com/psmedley/openhab-addons/tree/tesla-fleet-api) but it relies on a proxy which I'm currently hosting. Owners API should have already been phased out based on their timeline https://developer.tesla.com/docs/fleet-api?shell#announcements-amp-api-changelog "Fleet API is Tesla's official 3rd party API and the only supported API for vehicle interactions. The list of available endpoints can be found at Endpoints and Regional Requirements. Starting April 2024, any vehicle APIs not part of this list will be phased out." |
That's indeed no good news for the tesla binding - it sounds as if it will cease working soon. 😢 Tesla published a new message yesterday:
I've registered an openHAB application, but I am not sure if this will be the right way for us - the discovery plan is said to be only temporary and the only option for open source applications and it has very limited request quotas. But I guess we should create a dedicated issue for that discussion, I am getting out of scope here. Wrt teslascope: It is ok for me to keep it separate, if the channels are a fairly different set than for the Tesla API as you say. And especially in the light of a soon to be broken Tesla binding, it definitely gives you much less headache, if you can work independently, @psmedley. |
Thanks Kai.... I do have FleetAPI mostly working too - see https://github.com/psmedley/openhab-addons/tree/tesla-fleet-api but the question around the access to the API stopped me raising a PR.... |
Signed-off-by: Paul Smedley <[email protected]>
Signed-off-by: Paul Smedley <[email protected]>
Signed-off-by: Paul Smedley <[email protected]>
Signed-off-by: Paul Smedley <[email protected]>
Signed-off-by: Paul Smedley <[email protected]>
Signed-off-by: Paul Smedley <[email protected]>
Signed-off-by: Paul Smedley <[email protected]>
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.
Some more comments.
...ding.teslascope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeHandler.java
Outdated
Show resolved
Hide resolved
...ding.teslascope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeHandler.java
Outdated
Show resolved
Hide resolved
...g.teslascope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeWebTargets.java
Outdated
Show resolved
Hide resolved
...g.teslascope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeWebTargets.java
Outdated
Show resolved
Hide resolved
...g.teslascope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeWebTargets.java
Show resolved
Hide resolved
...g.teslascope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeWebTargets.java
Outdated
Show resolved
Hide resolved
...g.teslascope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeWebTargets.java
Outdated
Show resolved
Hide resolved
...inding.teslascope/src/main/java/org/openhab/binding/teslascope/internal/api/ChargeState.java
Outdated
Show resolved
Hide resolved
...ding.teslascope/src/main/java/org/openhab/binding/teslascope/internal/TeslascopeHandler.java
Show resolved
Hide resolved
There are multiple bindings with this model, for developer documentation check here: https://www.openhab.org/docs/developer/bindings/#bridges |
Thanks for this. Please correct me if I'm mistaken - but for a bridge to be feasible - wouldn't there need to be an endpoint that uses only the apikey and not the publicID in order to validate the apikey is correct? Looking at https://teslascope.com/developers/documentation/vehicles there is (currently) no such endpoint. At some point in the fututet, Tesla scope will move away from an apikey to an oauth login - which should allow a move to a bridge/thing design. |
Ok, in that case it is better to leave it as is. I would still opt to rename the |
Signed-off-by: Paul Smedley <[email protected]>
Signed-off-by: Paul Smedley <[email protected]>
Signed-off-by: Paul Smedley <[email protected]>
Signed-off-by: Paul Smedley <[email protected]>
Done :) |
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.
Thanks for fixing the comments quickly, LGTM.
Now, you could add your binding's logo to the openHAB website. See https://next.openhab.org/docs/developer/addons/#add-your-add-on-s-logo-to-the-openhab-website-and-the-ui
Thanks again for your patience and help supporting this addon! I learned a lot from the comments on this binding, as well as the previous bindings that made it into 4.2 :) |
* Initial source Signed-off-by: Paul Smedley <[email protected]>
* Initial source Signed-off-by: Paul Smedley <[email protected]>
* Initial source Signed-off-by: Paul Smedley <[email protected]> Signed-off-by: Patrik Gfeller <[email protected]>
* Initial source Signed-off-by: Paul Smedley <[email protected]>
* Initial source Signed-off-by: Paul Smedley <[email protected]>
* Initial source Signed-off-by: Paul Smedley <[email protected]> Signed-off-by: Ciprian Pascu <[email protected]>
Title
Description
Binding to support Tesla vehicles via the Teslascope API