{"id":368,"date":"2018-05-23T13:06:33","date_gmt":"2018-05-23T17:06:33","guid":{"rendered":"http:\/\/www.thesmarthomehookup.com\/test_install\/?p=368"},"modified":"2023-04-24T15:48:16","modified_gmt":"2023-04-24T19:48:16","slug":"add-siri-to-your-tesla-model-3-using-home-assistant-smart-home","status":"publish","type":"post","link":"http:\/\/www.thesmarthomehookup.com\/test_install\/add-siri-to-your-tesla-model-3-using-home-assistant-smart-home\/","title":{"rendered":"Add Siri to Your Tesla Model 3 Using Home Assistant Smart Home"},"content":{"rendered":"<p><iframe width=\"560\" height=\"315\" src=\"https:\/\/www.youtube.com\/embed\/l1YROYQUS5s\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen=\"\"><\/iframe><\/p>\n<p><strong>Tesla Model 3 Integration<\/strong><\/p>\n<p>Today on the hookup I\u2019m going to brag about my new tesla model 3!&nbsp;&nbsp; Wait, what?&nbsp; That\u2019s a terrible intro for this video.&nbsp; Lets try that again:&nbsp; Today on the hookup we\u2019re going to talk about how the tesla model 3 connects to home assistant, and how you can use home assistant to add Siri and Alexa voice controls and other automations to your tesla that aren\u2019t available without home assistant integration.<\/p>\n<p>So this is my beautiful new tesla model 3.<\/p>\n<p>Okay fine, it\u2019s actually my wife\u2019s car, it\u2019s her beautiful tesla model 3.&nbsp; The tesla model 3 is a car of the future, so much so that many of the coolest things that this car can do will only be available\u2026 in the future&#8230;&nbsp; Thankfully there is still a pretty great set of advanced features available right now.&nbsp; The model 3, like all teslas, is equipped with an always on LTE cellular connection that lets it communicate with an app on your phone, and of course with the tesla mothership.&nbsp; Tesla has also been so kind as to release an API to communicate with many of the sensors and switches on the car.<\/p>\n<p>Like almost every piece of technology that has an API released, a tesla component is also available for home assistant.&nbsp; To connect my the model 3 to home assistant all I needed to do was add \u201ctesla\u201d to my configuration.yaml file along with my login and password to the tesla app.<\/p>\n<p>After saving my configuration.yaml file and restarting home assistant the group sensors and components that the tesla API makes available appeared in home assistant.&nbsp; Here\u2019s a list of all of the components that get automatically added.<\/p>\n<p>I actually only wanted a few of these sensors to show up on my home assistant dashboard.&nbsp; Specifically I chose to keep the lock switch, climate control, charging state, battery percentage sensor, range sensor, and location.&nbsp; These components have long and unintelligible entity IDs when added, but you can easily change these names by going to configuration, then customization, then selecting the entity you want to change and editing the name entry.<\/p>\n<p>Adding these components to home assistant didn\u2019t automatically change much about the way I could interact with the car aside from not having to open up a separate app on my phone.&nbsp; But there are a couple of things that home assistant integration allows you to do with your model 3, that wouldn\u2019t otherwise be possible:<\/p>\n<p>&nbsp;<\/p>\n<p>Once you install the tesla app on your phone you can use the siri voice commands \u201cunlock my car\u201d, or \u201clock my car\u201d, or \u201chonk the horn on my car\u201d.&nbsp; But there\u2019s no ability to use it from your apple watch, and you can\u2019t access the climate control at all.<\/p>\n<p>It just so happens that an official homekit component was added into hassio about 2 months ago, and the updates have been rolling in since.&nbsp; Home assistant\u2019s homekit component allows you to easily expose your home assistant devices to homekit to enable functionality through iOS and siri.<\/p>\n<p>To enable the homekit component you just need to add homekit to your configuration.yaml file.&nbsp; If you\u2019re like me and have literally hundreds of devices in home assistant, I would also highly recommend only including specific entities in your homekit discovery using the filter functionality.&nbsp; You can either chose to filter by excluding entities or domains, or including them.&nbsp; Since I only had a few things that I wanted to expose, I decided to use the include entities method.&nbsp; After giving home assistant a restart I now have a temporary new card that appears in home assistant.&nbsp; This card contains the pin for linking your included devices with home kit.<\/p>\n<p>Next we hop over to our iOS device and open the apple home app.<\/p>\n<p>Choose Add Accessory, than select \u201cDon&#8217;t Have a Code or Can&#8217;t Scan?\u201d and enter the pin code.<\/p>\n<p>Confirm the you are adding an Uncertified Accessory by clicking on Add Anyway.<\/p>\n<p>Follow the setup be clicking on Next and finally Done in the top right hand corner.<\/p>\n<p>Since I exposed the tesla\u2019s climate control system I can say&nbsp; \u201cHey Siri, Set viserions AC to 72\u201d and the climate system will update to 72 degrees.&nbsp; But the most useful function is that you can start cooling the car remotely so the black leather interior is not blazing hot when you get in.&nbsp; Being able to do this from my apple watch would greatly increase my likelihood of remembering and it\u2019s so simple\u2026&nbsp; all I have to say is (\u201cHey Siri, Turn on viscerions AC\u201d) and the\u2026&nbsp; umm.&nbsp; (\u201cHey Siri, Turn on viscerions AC\u201d) and that will\u2026 uh\u2026<\/p>\n<p>Nothing is ever that easy is it?&nbsp; It seems that whenever the tesla integration was written it uses the commands \u201coperation_mode: on\u201d and \u201coperation_mode: off\u201d, but homekit is only able to send auto, heat, cool, and off as payloads for \u201coperation_mode\u201d meaning that homekit has no way of turning on the AC.&nbsp; If you thought I was just going to give up there, then you\u2019ve probably never watched one of my videos before.&nbsp; The fix was actually ridiculously quick and simple.&nbsp; All I did was create an input Boolean in home assistant (I called it \u201cviserions air\u201d) and added it to my homekit included entities.&nbsp; I then went into node red and set up a quick automation where flipping the input Boolean calls the \u201cclimate.set_operation_mode\u201d service and uses the correct values of \u201con\u201d or \u201coff\u201d as the payload.&nbsp; NOW I can say (\u201cHey Siri, turn on viserions air\u201d) and the climate control kicks on remotely.<\/p>\n<p>One quick note about homekit:&nbsp; You can set up homekit without having to have a permanently connected device in your home wifi like a google home mini or an amazon echo dot, but if you want to be able to access your devices remotely you\u2019ll need some kind of hub in your house to act as a go between like the mini or the dot would, your options for this are appleTV 3<sup>rd<\/sup> generation or higher, homepod, or an always on ipad running the latest version of iOS.<\/p>\n<p>Just for fun and because it was really easy, I also set up amazon echo to have the same functionality, but as you can imagine the use cases are significantly less since I can\u2019t talk to alexa without opening up a specific app on my phone, it\u2019s mostly just a fun party trick\u2026 And an excuse to tell you to stay tuned next week for part 2 of my mastering node-red series where I\u2019ll cover how to easily create amazon alexa automations using node-red.&nbsp; Anyway\u2026..<\/p>\n<p>The other thing that home assistant allows me to is create some useful automations using the data from home assistant.&nbsp; One neat feature of the tesla is \u201cwalk away locks\u201d, where you just get out of the car and walk away and after your phone gets a certain distance from the car the doors will automatically lock. This is a neat feature, but also an annoying feature if you just need to pop into the garage and grab something out of the car without your phone in your pocket.<\/p>\n<p>To fix this I\u2019ve set up this simple node-red flow that uses the gps location of the tesla along with the current state of the garage door to keep the doors unlocked as long as the garage door is closed and the tesla is in the garage.<\/p>\n<p>This flow starts out with an event state node for the door locks, if the doors go from unlocked to locked it will send on a payload to this current state node where the gps location is polled to check if the car is in the garage.&nbsp; Luckily I don\u2019t have to worry about the lock and gps location being out of sync because they are both updated at the same 300 second interval.&nbsp; Next it will travel through another current state node where the garage door state is polled.&nbsp; If the garage door is open it will halt the flow, if it\u2019s closed it will continue on to a \u201ccall services\u201d node to unlock the car using the lock.unlock service.<\/p>\n<p>&nbsp;<\/p>\n<p>What about if we need to park it in the driveway, wouldn\u2019t this automation prevent us from locking the car? Amazingly, the tesla\u2019s GPS sensor is plenty accurate to determine if it\u2019s in the garage or in the driveway, you just need to make sure you\u2019ve set the zone to be small enough in home assistant, in my case I changed the default 100 meter radius of the \u201cgarage\u201d zone to 3 meters.<\/p>\n<p>Now that my wife has this cool new toy I\u2019m feeling a little bit of tech envy\u2026&nbsp; The tesla model Y can\u2019t come soon enough. Stay tuned next week for part 2 of my mastering node red series.&nbsp; If you enjoyed this video, please consider subscribing, and as always, thanks for watching the hook up.<\/p>\n<h3>Links<\/h3>\n<p>YAML + Node-RED Flows:<br \/>\n<a href=\"https:\/\/github.com\/thehookup\/Tesla_Model3\">https:\/\/github.com\/thehookup\/Tesla_Model3<\/a><\/p>\n<p>Get started with Hassio:<br \/>\n<a href=\"https:\/\/amzn.to\/2KOpeNN\">https:\/\/amzn.to\/2KOpeNN<\/a><br \/>\n<a href=\"https:\/\/amzn.to\/2kiLKTN\">https:\/\/amzn.to\/2kiLKTN<\/a><\/p>\n<p>Support my channel:<br \/>\nPatreon:&nbsp;<a href=\"https:\/\/www.patreon.com\/thehookup\">https:\/\/www.patreon.com\/thehookup<\/a><\/p>\n<p>Twitter: @TheHookUp1<br \/>\nMusic By: www.BenSound.com<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tesla Model 3 Integration Today on the hookup I\u2019m going to brag about my new tesla model 3!&nbsp;&nbsp; Wait, what?&nbsp; That\u2019s a terrible intro for this video.&nbsp; Lets try that again:&nbsp; Today on the hookup we\u2019re going to talk about how the tesla model 3 connects to home assistant, and how you can use home [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":2611,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-368","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"acf":[],"mb":[],"mfb_rest_fields":["title","gutenberg_elementor_mode"],"_links":{"self":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/368","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/comments?post=368"}],"version-history":[{"count":4,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/368\/revisions"}],"predecessor-version":[{"id":2366,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/posts\/368\/revisions\/2366"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/media\/2611"}],"wp:attachment":[{"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/media?parent=368"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/categories?post=368"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.thesmarthomehookup.com\/test_install\/wp-json\/wp\/v2\/tags?post=368"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}