# Leaving the house

**URL:** <https://community.gladysassistant.com/t/depart-de-la-maison/7006>\
**Category:** Scènes\
**Tags:** mqtt, scene\
**Created:** [March 1, 2022, 2:06pm UTC](https://community.gladysassistant.com/t/depart-de-la-maison/7006 "2022-03-01T14:06:03Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [March 1, 2022, 2:06pm UTC](https://community.gladysassistant.com/t/depart-de-la-maison/7006/1 "2022-03-01T14:06:03Z")

</div>

I want to report my departure from the house to check if all windows and doors are closed, turn off all the lights…

@lmilcent uses the [Presence publisher](https://play.google.com/store/apps/details?id=org.ostrya.presencepublisher&hl=fr) application which will allow you to check if you are connected to your wifi network. Thanks for the tip.

**Warning** this technique requires Gladys plus.  
You can however use Bluetooth keychains if you don’t have Gladys plus yet.

I will be able to explain how to do this in another topic.

The first thing to do is to retrieve the login and password in the MQTT integration in Gladys and create a fake device with presence, battery and status.

 ![fake device mqtt](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/a/a9d1fb64245a819a983c98f0179bff45d5cd23f4.png)

 ![Capture d’écran 2022-03-01 121243](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/0/062065505cdbd9ea95a1164636e94be70b483688.png)

 ![Capture d’écran 2022-03-01 121306](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/0/0aec9a47372a7b5c267a8197e16e3ba93e3e8d04.png)

 ![Capture d’écran 2022-03-01 121323](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/cd6bab25a2aa797d817acb4423e2268ef184c537.png)

The second thing to set up is a «&nbsp;away from home&nbsp;» scene. We will create a scene for example «&nbsp;Vincent absent&nbsp;»

Trigger:

 ![Capture scene 1](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/8/87d3466db9632bec13378a55c9f9e2440ad9668b.png)

Action:

 ![Capture scene 2](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/d/d477fc2e2571a6efc478e837f796487327f9ca23.png)

In the Presence publisher application  
Connection tab fill in:

- the port of your instance
- the Mqtt login
- the Mqtt password

At the bottom of the page you will be able to test your connection.

 ![Screenshot_20220301-120417_Presence Publisher_2](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/1/1083572c6364e229623d891f6834c68902721ee0.jpeg)

Schedule tab:  
see screenshot

 ![Screenshot_20220301-120522_Presence Publisher_2](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/3/3a0b9ad2b062b829824d3fef9b40e853330aac05.jpeg)

Conditions tab:  
You must fill in your wifi network under which you connect.

 ![Screenshot_20220301-120629_Presence Publisher_2](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/7/734940aa4810d24ae6380fe2ec20f04b33dc5fff.jpeg)

Enable “Send without wifi”  
In the “None of the above matches” section, enable “Send absence message” and modify the “Absence message” value to “1”.

Messages tab:  
click on Add message to fill in the Mqtt topic of your fake device in Gladys that you will find in the Mqtt integration:

- 1st message: battery click on batteryLevel
- 2nd message: phone click on ConditionContent

After a few moments in the Mqtt integration, you will see the battery level of your phone. This indicates that it works.

I will add information as needed.

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [March 1, 2022, 2:21pm UTC](https://community.gladysassistant.com/t/depart-de-la-maison/7006/2 "2022-03-01T14:21:27Z")

</div>

And for those who don’t have Gladys Plus:

> [@MQTT - Permettre l'intégration d'un "device" externe (smartphone)](https://community.gladysassistant.com/t/mqtt-permettre-lintegration-dun-device-externe-smartphone/6288/40?u=lmilcent):
>
> Désolé je crois que je me suis emmêlé les pinceaux ! Pour résumer et redonner du contexte : Gladys est installé chez moi, sur un Raspberry pi et n’est pas exposée ni accessible sur internet. Je n’ai pas encore d’abonnement Gladys Plus, donc aucun accès à Gladys en direct depuis internet. Besoin : Me définir “présent” quand mon téléphone est en wifi uniquement. Procédure : J’utilise [presence publisher](https://play.google.com/store/apps/details?id=org.ostrya.presencepublisher&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1) pour Android, qui permet, une fois connecté en Wifi chez moi, d’envoyer des messages en MQ…

It’s almost the same procedure with a few changes.

---

<div class="post-metadata">

**Author:** ![Tlse-vins](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/tlse-vins/32/6054_2.png) [@Tlse-vins](https://community.gladysassistant.com/u/Tlse-vins)\
**Post date:** [March 1, 2022, 2:23pm UTC](https://community.gladysassistant.com/t/depart-de-la-maison/7006/3 "2022-03-01T14:23:17Z")

</div>

Thank you Louis, you did well.

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [March 7, 2022, 9:28pm UTC](https://community.gladysassistant.com/t/depart-de-la-maison/7006/4 "2022-03-07T21:28:46Z")

</div>

Thank you both!

I don’t see the difference with or without G+?

I use, as we exchanged in the [base topic](https://community.gladysassistant.com/t/mqtt-permettre-lintegration-dun-device-externe-smartphone/6288/6), the application and I am also under G+.

Except that I don’t use G+ for this feature. As I have it, can you explain it to me?

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [March 14, 2022, 7:46am UTC](https://community.gladysassistant.com/t/depart-de-la-maison/7006/5 "2022-03-14T07:46:19Z")

</div>

This is done via the open API, check the owntracks example

> **[Owntracks | Gladys Assistant](https://gladysassistant.com/docs/integrations/owntracks/)**
>
> Owntracks is an open-source mobile app which sends the phone location to a server, periodically.
