I have a Wemos D1 Mini Pro v2 on my motorcycle, and following this guide (https://github.com/aderusha/MQTTCarPresence), I’m able to get it to show when the bike is present by when it’s connected to my network. I’m also using the Android Companion App (tell HA if I’m home or away) and Frigate (to detect a motorcycle object in the driveway).
CLOSING the garage door when I leave:
This is my process when I’m getting ready to leave the house on the motorcycle: I pull the motorcycle out of the garage and park it in the driveway before I start it. Frigate confirms there’s a motorcycle in my driveway. I then start the bike (which turns on the Wemos and has it connect to my home network), and have the garage door close while the motorcycle is still in the driveway. I don’t want it closing after I leave. I want to be sure it’s going to close. I also don’t want it to close before I start the bike. This automation works well in my testing thus far.
Here’s the YAML for closing the garage door when I leave:
alias: Garage Door - Close - Leaving on the bike
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.vehiclepresence_cb1000r
to: "on"
from: "off"
condition:
- condition: and
conditions:
- condition: state
entity_id: cover.garage_door
state: open
- condition: state
entity_id: binary_sensor.cam_driveway_2_motorcycle_occupancy
state: "on"
- condition: state
entity_id: person.husband
state: home
action:
- device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
domain: cover
entity_id: cover.garage_door
type: close
enabled: true
- device_id: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
domain: mobile_app
type: notify
message: Leaving home on the bike. CLOSING garage door.
mode: single
OPENING the garage door when I get home:
This is where I’m having trouble…
alias: Garage Door - Open - Arriving on the bike
description: ""
trigger:
- platform: state
entity_id:
- person.husband
from: not_home
to: home
condition:
- condition: and
conditions:
- condition: state
entity_id: cover.garage_door
state: closed
- condition: state
entity_id: binary_sensor.cam_driveway_2_motorcycle_occupancy
state: "on"
- condition: and
conditions:
- condition: state
entity_id: binary_sensor.vehiclepresence_cb1000r
state: "on"
- condition: numeric_state
entity_id: sensor.vehiclepresence_cb1000r_uptime
above: 180000
alias: CB1000R is on for at least 3 minutes
- condition: zone
entity_id: person.husband
zone: zone.home
action:
- device_id: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
domain: cover
entity_id: cover.garage_door
type: open
- device_id: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
domain: mobile_app
type: notify
message: Arriving home on the bike. OPENING garage door.
mode: single
Maybe my order is wrong, or my checks. I’m wondering if HA is seeing me as Home before the Wemos connects to my network and shows up in HA. However, this is not working.
What I’m wanting, is to ensure that it is ME pulling up to the house on the bike. I want it to detect me from the app, and detect the bike’s Wemos. However, I sat outside for far too long and ended up opening the garage manually when the automation wouldn’t work. Any thoughts here?
Also, I would like to set a state or something to tell HA that I am away from the house and am on the motorcycle. How can I go about doing that? That way, I could maybe call that variable when I’m home to then open the door. Thinking out loud here. How would you setup this automation to open the garage door? So many examples only check that the wemos connects to the network, and I need more piece of mind than that.