Tesla Hardware Module

Use this forum to discuss possible implementation of a new feature before opening a ticket.
A developer shall edit the topic title with "[xxx]" where xxx is the id of the accompanying tracker id.
Duplicate posts about the same id. +1 posts are not allowed.

Moderators: leecollings, remb0

Post Reply
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Tesla Hardware Module

Post by hamster »

Thanks for this module, it's pretty sweet!

I'd like to see the option for input of an API key directly, instead of needing to input a user/pass. I think having both options available would be great!

edit: also be cool if Charge Switch could be created as a dimmer to set and monitor Charge Limit. Unless there is another, existing way that I'm missing?
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla Hardware Module

Post by MrHobbes74 »

Hi! Thanks! Glad to hear it’s being used! It has been hard work but fun!

Regarding your comments:
- I’ll have a look at the api key
- the slider isn’t a bad idea. I’ll explore it. But you can already do it, the Tesla module has a device that provides the percentage so you could check that device value in a dzVents script every minute during charging and stop the charging when a threshold is reached
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Re: Tesla Hardware Module

Post by hamster »

Good ideas. How about proactively setting a charge limit, is that possible currently? Ex. Car not charging, sitting at 50%, change limit to 70% to start charging?
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla Hardware Module

Post by MrHobbes74 »

Hi, yes this is all possible already inside domoticz, if you learn how to use dzVents. The Tesla module is currently providing you relevant information and allowing you to take actions like start/stop charging.
With dzVents and your own dummy slider you can already do all you want. The hardware module is dumb, I don’t want to build too much intelligence in it, because domoticz allows you to do automation exactly how you want it.
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Re: Tesla Hardware Module

Post by hamster »

Cool, I'll dig into it, appreciate the work.
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Re: Tesla Hardware Module

Post by hamster »

I'm having a small issue with the refresh interval settings...

I currently have my Default fairly high at 720 ('allow wake up' set false anyway) and Active set to 1...

When my car goes to sleep, I see the background refresh rate in the log (be nice to have box for this also) pinging the api every minute and sees the car asleep, but when the car wakes, it seems to refresh the status once, then seemingly fall back on the Default interval and stops refreshing every minute and gets stuck on "Home, Complete" until the car sleeps again and it goes back to "asleep."

Same thing happens when I get home. It refreshes to status "Home, Cable unplugged" but then doesnt continue to refresh every minute and sticks on that status until the car sleeps.

If I go into Hardware and manually Update, it then properly uses the Active internal and refreshes charge status, etc every minute.
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla Hardware Module

Post by MrHobbes74 »

Hi,

the behavior should be:

- every minute, the Tesla is checked if it is awake or asleep. This is independent of the refresh rates provided. This does not cost battery, that is why this can be done.
- when the Tesla is asleep, it does not poll for more information (charge/temp etc)
- when the Tesla wakes up, it refreshes once (and starts the default refresh interval)
- when the Tesla is awake, it refreshes using the default refresh interval
- only when the Tesla is actively charging it refreshes using the active refresh interval. So when charging is finished, it goes back to default interval.

I would suggest not to use such a high default refresh interval, 20 or 30 minutes is a good number. The problem with your interval is that when you arrive home, and plugin the cable, this is not detected for a very long time (max 720 minutes). And when the 720 minutes is over, the car sleeps already and it cannot detect its charging status (and hence, does not go to the active refresh rate). With a refresh rate of 20/30 minutes, Domoticz will always detect a charging car before it sleeps.
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Re: Tesla Hardware Module

Post by hamster »

Oh I see. That makes sense.

So, with default set to 20, there could still potentially be a refresh gap of 20 minutes before 'home, cable unplugged' would be updated to 'charging?' Is that correct? What do you think about some sort of "Use active interval X times when first getting home/awaking" box? Or something along those lines? I know that may be a bit clunky, but could also just be a background tweak of some sort. That way it would catch any actions that may happen quickly after the initial refresh, such as plugging in.
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla Hardware Module

Post by MrHobbes74 »

Yes, you are right. There will indeed be a potential refresh gap of max 'default refresh rate'.
However, the same actually counts for detecting that you are home. It may take max 'default refresh rate' before it is detected the car is home.

If you come home, and plugin the cable (I guess that's the usual habit for us Tesla drivers ;-)), there is only a small chance (2? out of 20) that the detection takes place right after you are home, but before plugging in. However, doing a few minutes of active-rate-polling after coming home, may indeed solve this small chance. It cannot solve the gap between not-home and home however.
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Re: Tesla Hardware Module

Post by hamster »

True, it would just be bad luck if the refresh happened the moment before arriving home and/or plugging in, ha! I guess that small chance is probably not worth the effort to code and potential confusion another box could cause. So, totally up to you of course.

Thank you for the great explanation of how the intervals work tho!
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla Hardware Module

Post by MrHobbes74 »

Note that it is important to check whether with a setting of 20 minutes, you car is able to fall asleep. I know my Model 3 usually takes 16-17 minutes. But other Tesla models may have a different interval. So play with that number until you see that the Tesla indeed falls asleep (when not charging....when it's charging the 1 minute interval will prevent the tesla to sleep at all, which is not a problem as it won't drain the battery when you're plugged in).
hamster
Posts: 42
Joined: Friday 28 April 2017 19:11
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: USA
Contact:

Re: Tesla Hardware Module

Post by hamster »

Indeed. I have the tesla parameters on an always-on tablet via dashticz, so I'll make sure 20 allows it to sleep. :D
MrHobbes74
Posts: 115
Joined: Sunday 19 January 2020 22:29
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Netherlands
Contact:

Re: Tesla Hardware Module

Post by MrHobbes74 »

I will put the 'refresh using active refresh rate for a few minutes after coming home' on my to-do-list. I think it's a nice addition. I don't see the need for a box, it will make it too confusing, but this could be standard behavior.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests