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.

11 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)

3 Likes

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:

3 Likes

Hey! just wondering if you ever managed to re-visit the topic you mentioned regarding your shower plugin? I am also starting to dig into this. I can't find any info on the API which is odd because I did find the API for the MOEN Flo. If you have any info you could share, maybe we can work together on this one? I would love to see this shower in Hubitat. it is the only divide in my house that doesn't seem to have a way to directly integrate with Hubitat and that has to change!!

I have not revisited it. Still just using my local server to pull status and feed it to HE/WC as needed.
One thing I have not gotten around to trying is using home assistant and HomeKit and HADB as a “proxy”. HA supports direct connection to HomeKit devices using the HomeKit device integration. Again I have not tried it, but it supposedly supports switches (including valves). I’ve been wondering if since the U is a HomeKit device, it can be connected directly to HA and then share it back to HADB. At this point, I’m working on other projects, but would be curious if someone tried this approach.

Edit: just found this - looks like a possible solution in HA. U by Moen Shower Control Setup - #4 by JDogg016 - Configuration - Home Assistant Community

I also outlined how I was able to get current status on the shower in this post. Integrated Habitat Device Can't Be Used In HomeKit Automation - #11 by woodsby

Every time this topic gets bumped to the top by a reply I get a nice smile.

"Presence, Vehicle and Shower"

Isn't the shower always "present" at home, and if it isn't, seems like you have issues that go far beyond this forum's ability to solve w/presence devices. :wink:

image

2 Likes

Looks like the home assistant community is about to release an update with support

I’ll keep a close eye to see if there is anything they discover that might be useful

Please report back if you try it. I suspect even if it works well in HA, you’ll only be able to pull it into HE as a switch through HADB. But would love to hear either way.

So sorry to bring this topic back to the top, but I did decide to try this. I removed the Moen U from my Apple Home and it was immediately discovered as a HomeKit Device in HA. After putting the Moen in HomeKit pairing mode and attempting to pair it with the code 12345678, the Moen then displayed the correct pairing code and I was able to pair it. My HA is up to date, and as of today, the device includes a master switch, a switch for each outlet and a climate device to control temperature - but that only goes up to 99 degrees. I also noticed that the Moen acts pretty flaky when controlled through HA. Will post back if any updates improve performance. As it currently stands, I find the echo speaks and Alexa routine to be more reliable.

I am pleased to say that the HA Moen U via HomeKit device is working well now. I can set the temperature, and the valves to be turned on, then turn it on. I can turn it on, then select the valves and temp. I can turn it on manually, and HA shows it come on. This is now workable. I have not yet brought the device/entities into HADB, but I have to assume that’s the easy part.