Presence, Vehicle and Shower

I finally automated my morning routine the way I want - utilizing espresense, a local web server and some code I wrote. Equipment includes a Moen U shower controller, ESP32's (obviously), iphone, 2021 Toyota 4runner, Shower lights, bath fan, vizio tv, alexa and wttr.in.

If I walk into the bathroom with my phone in the morning, like I always do, the below happens when I double tap the light switch beside the shower:

  1. Turn on the shower to 107 degrees
  2. Turn on the shower downlights to 5%
  3. Turn on the bath fan
  4. Switch the bathroom TV speaker off to allow for sound to come only through the bluetooth speaker in the shower (if I feel like listening to the news).

Then, when I turn off the shower:

  1. Switch the TV audio back to internal speaker (works whether or not the TV is on)
  2. If the time is between 4am and 9am, and the outdoor temperature is below 45 degrees F, and the fuel range is above 25 miles, wait 10 minutes and start my truck
  3. Wait 15 minutes and turn the lights and bath fan back off

Conversely, if my wife double taps the same switch, the shower turns on to 105 degrees, the lights come on to 50%, and the tv speaker switches off. And obviously my truck won't start when she turns off the shower,

For the Moen shower, I wrote a simple web page and script that can be polled for shower status - I did this a long time ago - and it works for status only. I control the shower using alexa as a "proxy". I need to revisit this as it's been a couple years, and someone may have figured out how to control the moen directly.

For the TV, I did something similar - wrote scripts to control the TV - again several years ago, but I'm guessing this can possibly be done through the community vizio app.

For espresense, I obviously just stuck with the HA/HADB approach, but may consider writing a driver for this utilizing a separate MQTT broker. But not sure it's worth the effort - I only use HA for 2 things - espresense and genmon.

For the 4Runner, I initially tried the HA integration, but that proved a bit cumbersome, and the lock and door position status were completely unreliable. So, utilizing the existing python toyota-na client, I wrote a couple simple local web pages and scripts that can be polled for status or control the locks, remote start and hazards ("find my car").

ps. additionally, a single indicator LED on the HS-WX300 on my side of the bed illuminates a different color when the truck is unlocked (solid red), remote started and running (solid green), door(s) open (blinking red), tire pressure low (solid magenta), fuel range below 50 miles (solid yellow), and toyota-na health status is bad (blinking red). This now works more reliably than the HA Toyota-NA integration, and definitely doesn't require reauthentication as often as the Toyota ios app. I have had to re-login to the toyota app 3 times in the last 2 weeks, and not once through the python client.

Edit: I have since added an NFC sticker behind the switch plate in the adjacent toilet room… so now tapping my phone to that bottom of that switch plate also activates my shower automation.

10 Likes

Where I live you'd need an extra action. Call the Police and report truck stolen (not that the Police would respond...you'd just get a 'crime number' for your insurance company)

Lol, the driver I wrote also shows the location of the vehicle.

3 Likes

Holy moly please explain more detail about automating your 4Runner! Lol

There is an existing python project called toyota-na. The code does need to be modified a bit to allow for MFA, but the details on that can be found in the HA forums. Once I got that up and running, I created a couple simple cgi scripts on a local web server - one to run commands - lock, unlock, remote start, remote stop, flash hazards, and request update; and another that polls status and parses only the information I need and returns a list of those data points.
Then I wrote a driver that calls the script URLs - either the commands (on, off, lock, unlock, flash, refresh) or the status which populates the device attributes.

All that said, there is an existing HA integration that just recently properly integrated the MFA and should be much easier to use. However, using that HA integration, I noticed that if I left my truck doors unlocked, the Toyota app would return bad status on the door position - it shows the doors as open. I was able to get around this by watching when the door status changes to open - and when that happens, don’t populate the attributes, but instead request an update from Toyota, wait 2 minutes and then poll status again. At this point, the vehicle status returns accurately, and the attributes populate correctly.

Note the python project Toyota-na notes that door and window status are unreliable unless you request an update - which literally pings the vehicle. Don’t do this too often though as this will drain your battery quicker.

2 Likes

Thanks! I installed the app and got my 4Runner registered but I don't have any connected services so curious if I can add that. I took my Entune head unit out and replaced with a T9 android based unit.

My god .. you guys are just crazy!

If you don't have any connected services, you'll have to pay the $80/yr for the remote connect service. But if you have an older 4runner, remote connect may not be available for you.

The head unit shouldn't affect this service, but I'm not 100% sure.

What year is your runner?

Oh gotcha, that's not bad considering.
2014.

Ya, I think your vehicle is too old for that service... might be a reason to buy a new 4Runner.

1 Like

Lol well this escalated quickly.

Yep, they are the only crazy one's.... The rest of us are normal.... :wink:

2 Likes