Home Assistant Mitsubishi Outlander PHEV Detector
I have created a project here on GitHub that allows me to detect if my Mitsubishi Outlander PHEV is home or not.
This is essentially a WiFi scanner that will look for my car’s WiFi access point and update Home Assistant with a status of ‘home’ or ‘away’.
Prerequisites
Software
- Arduino IDE - I’m using v1.8.12
- Arduino JSON - v6.15.1
- PubSubClient - v2.7.0
- ESP8266WiFi
- ArduinoOTA
Hardware
- Either the Wemos D1 Mini or, if you need better range a Wemos D1 Mini Pro with Antenna
- A Micro USB to USB cable.
Integrating with Home Assistant
The simplest way to integrate with Home Assistant is to turn on MQTT discovery. With this activated the device will be added automatically.
Alternatively you can add a new binary_sensor
to the configuration.yaml
like this:
binary_sensor:
- platform: mqtt
name: Car Home Sensor
state_topic: "car/home"
qos: 1
payload_on: "home"
payload_off: "away"
device_class: presence
For a more interesting integration you can take it one step further with a sensor that will change the displayed status from on/off
to Home/Away
and change the icon from a house to a car respectively.
sensor:
- platform: template
sensors:
car_home_sensor:
friendly_name: Car Home Sensor
entity_id: binary_sensor.car_home_sensor
value_template: >
{% if is_state('binary_sensor.car_home_sensor', 'on') %}
Home
{% else %}
Away
{% endif %}
icon_template: >
{% if states('binary_sensor.car_home_sensor') == 'on' %}
mdi:home
{% else %}
mdi:car
{% endif %}
Finally here is a really basic lovelace card: