I’ve found myself with a problem, and I’m not sure how to solve it. I’m due to have a person staying in my house, looking after my cat, while I’m away on holidays, and I want to try and figure out how to register their presence in the house, without installing home assistant on their phone etc.
So I have, what I call a “Guest mode”, but it was never intended to function without myself or my fiance in the house, basically all it does is stop some lights automatically turning off and others automatically turning on.
Would something like a BLE tag on a set of keys work in this instance? (Eg. If guest mode is active, system will treat the presence of the tag as someone being in the house and its absence as the house being empty). Are BLE tags able to provide reliable bluetooth connectivity?
Are there other solutions that I’m not thinking of?
I do have motion sensors in the house, which work well enough, but them on their own wouldn’t be enough to guarantee the system would register someone’s presence / absence. In this case, they’d be used in conjunction with something else.
Bluetooth can be tricky, because it might not always be on to see.
WiFi can be tricky because the person might not connect to it.
Both might use masquerading technics to prevent tracking, but since tracking is what you are trying to do, then it will work against you here.
Best solution is to have a scanner and then use a tag that the person scans on the scanner.
You can then have the person scan it at leaving, but back that up with an auto le e at night or similar.
Hmm, part of the issue is that I want it to be as low impact as possible, ie. the person won’t have to do a thing.
I think I saw somewhere that a ble tag (airtag or similar) could be used (I’ll be damned if i can find it again though). If that’s the case, that would be perfect, as it’d just be on the set of keys and requires no input from the user. I just don’t know if those tags constantly transmit or do so intermittently, what their battery life is like, what I’d need to do to use with home assistant if it’s even possible.
You can use a few ESPhome bluetooth proxies to ensure you have whole house coverage and use a BLE tag on their key ring. I am about to try this myself. I have the proxies set up but haven’t got the BLE tag sorted yet.
ESPhome is really easy. You can do everything with your PC and a USB cable to the device. For BLE you need an ESP32 which can be bought as a mini board very cheap. Or use the pre-packaged M5 stack devices.
What devices do you already have to track BT? If you have eg. a tablet or phone running the HA companion app, that is near your front door, you can already track BT. But the ESPHome route is one, you’d go anyway over time, ESPHome is such a neat and very useful Add-on and integration. You’ll soon see, what’s all possible with ESPHome.
Anyway, I’d try to work with two approaches to get your guest identified.
Put a BLE tracker on the key chain for the keys you give the guest.
Setup a guest wifi or something like that for WIFI tracking. You could set this up before you leave, and the phone of the guest connects automatically.
Setup a few BT tracker, this could be ESPHome devices and/or tablets with the HA companion app and/or the simple BT stick on your HA server.
This btw is, what most people do to track their own presence at home, BT and WIFI, ideally from different trackers (eg. the WIFI in a phone is trackable by the router or a direct ping to the device, so two trackers).
I personally would go that route, it is what I’m doing with my mother in law, if she comes by or needs to sit our house. She has a BT tracker (in my case a G-Tag) on the key chain, and here phone connects automatically to the guest WIFI. Works very good, but I do have a few BT scanner around the house, mostly with tablets, as Amazon is at least once a year thinking it could bind me to its ecosystem with really good prices for tablets. Nice try guys, but the Fire-Toolbox is always ahead of you!
I don’t actually track bluetooth currently. Both I and my fiance have the companion app, which takes care of location tracking, with a little geofencing.
I did wonder about that, actually. I can set up a purely guest network for guests. Can you use presence detection based on someone using the guest network without knowing their mac address or ip address before hand? If you can, that would also be useful. Ideally, I would actually like to have multiple methods for determining whether the guest is in the house or not. Granted I do have motion detectors in every room, but on their own, they are not sufficient, as if you’re absorbed in a movie or game, you may not move enough to register on the sensors. This is also complicated by my cat, who can also set off the motion sensors.
In terms of preference, I’d like bluetooth as the primary method (using a fob on a set of keys), then wifi (if possible, given the constraints) and then motion detection.
I’ve not had to deal with this issue before, as when we have someone staying, obviously one of us is always here, but obviously not so in this case.
For clarity - the guest will be a person from a house/pet minding service, and the presence detection is purely for inside the house use, ie. is guest in the house or not.
The problem with method is that they might not bother to use your wifi. At least with the BLE tag, it can be attached to the keys that the guest uses so there is no guest input required.
I use guest mode frequently because I have a young dog and I have a couple of different people stopping in to check on him during the day. It also gets used when I go away and someone is staying at the house.
Guest mode in my system is triggered multiple ways. Guest presence is controlled with an input boolean which in turn controls the guest / away occupancy mode (I have Home, Guest, Night, Away and Vacation modes).
My guest boolean can be toggled with multiple methods without installing the mobile app. I can enter a guest code remotely and give someone guest access without ever seeing them or worrying about tracking bluetooth, wifi, gps, nfc tags etc etc.)
This method is simple and has been very reliable for me.
Guest code with the entry lock keypad which also disarms the alarm system. Locking the door from the exterior turns off the boolean which triggers away mode and arms the alarm
Manual activation from the wall tablet. Turning on manually here does not disarm the alarm, but it does arm the alarm when turned off and that triggers away mode. Disarming the alarm on the wall tablet with a guest code turns the guest boolean on automatically and arming the alarm will turn it off automatically.
Voice activation through cloud/google home “Hey Google, Turn on Guest Mode”. The alarm must then be disarmed manually (usually on the wall tablet). The alarm will arm manually if the boolean is turned off by voice with Google Home.
In practice, it is the keypad code entry which effectively controls it. The only issue I’ve had is when multiple guests are present (couple watching house) and one of them locked the door from the outside when they left while the other person was still home. In that instance the at home person just had to disarm the alarm on the wall tablet after I got a “Uhh, help me! Everything turned off and I’m still here!” text
Guest mode automatically turns off if I arrive home and cannot be turned on if I am home.
Yes, but this implies buying this iTag Button and setting up ESPhome and an M5 stack just for this (since this particular use of ESPhome allows for only a maximum of 3 devices to be tracked). Wouldn’t it be more useful to use an iBeacon for this, and then use ESPhome as a Bluetooth Proxy?
Possibly, just to make sure that with (only) 1 M5stack you won’t get constant pings of being home/not_home create an MQTT device tracker for this specific device.
As for iBeacon vs iTag…? iBeacon meaning a software version right? ie: a phone… well that mean knowing the BLE MAC address of each guest that uses the guest set of house keys. Having a tag on that very set of keys completely simplifies the situation. MAC address known and doesn’t change when you give a different person the keys.
That won’t work with this particular iTag. Your suggestion (I’ve tried that myself because of a similar case) excludes running Bluetooth Proxy on the same device. The link has a very specific implementation for a very specific mac address for a very specific iTag device.
One of the Feasycom tags is what I have, I just didn’t link to that particular one previously (the tag used on the ESPhome page I linked in my second post was not a particular device suggestion of mine)
The concept is surely the same from the ESPhome page but with HA doing the work.
I’ve ordered a singe M5 stack for testing as a bluetooth proxy.
For the tag on the key, I’ve ordered a tag that has a nrf-52810 chips in it, so hopefully it’ll work.
At some stage, I may spring for a fancy number-pad lock for my front door, but it’s not a priority currently, though I do love the idea of being able to create a guest code and having that trigger states and automations, as the unobtrusiveness of it appeals to me. My whole thought behind automating my house is that it should just work in the background, with little to no input from anyone in the house. The logical next step, for me, is that the system will also operate as normal with a guest in the house while I and my partner are not there.
Thanks for the input folks, I’ll let you know how this little experiment goes.
Obviously, if someone has another idea of how to achieve what we’ve been discussing, leave a message.
Just wondering, did you have any issues setting up ESPhome bluetooth proxy? I got an M5stack, and I keep running into CMake error, and the entire thing fails. It just refuses to work. I must have attempted this 9 or 10 times by now, but I’m getting no where.
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
framework-espidf @ 3.40404.0 (4.4.4)
tool-cmake @ 3.16.9
tool-ninja @ 1.10.2
toolchain-esp32ulp @ 2.35.0-20220830
toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch5
Reading CMake configuration…
– The C compiler identification is GNU 8.4.0
– The CXX compiler identification is GNU 8.4.0
– The ASM compiler identification is GNU
– Found assembler: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc
– Check for working C compiler: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc
– Check for working C compiler: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc – broken
– Configuring incomplete, errors occurred!
See also “/data/esp32-bluetooth-proxy-83f680/.pioenvs/esp32-bluetooth-proxy-83f680/CMakeFiles/CMakeOutput.log”.
See also “/data/esp32-bluetooth-proxy-83f680/.pioenvs/esp32-bluetooth-proxy-83f680/CMakeFiles/CMakeError.log”.
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
CMake Error at /data/cache/platformio/packages/tool-cmake/share/cmake-3.16/Modules/CMakeTestCCompiler.cmake:60 (message):
The C compiler
Change Dir: /data/esp32-bluetooth-proxy-83f680/.pioenvs/esp32-bluetooth-proxy-83f680/CMakeFiles/CMakeTmp
Run Build Command(s):/data/cache/platformio/packages/tool-ninja/ninja cmTC_7116c && [1/2] Building C object CMakeFiles/cmTC_7116c.dir/testCCompiler.c.obj
[2/2] Linking C executable cmTC_7116c
FAILED: cmTC_7116c
: && /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gcc -mlongcalls -Wno-frame-address CMakeFiles/cmTC_7116c.dir/testCCompiler.c.obj -o cmTC_7116c && :
/data/cache/platformio/packages/toolchain-xtensa-esp32/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/../libexec/gcc/xtensa-esp32-elf/8.4.0/liblto_plugin.so: error loading plugin: /data/cache/platformio/packages/toolchain-xtensa-esp32/bin/../libexec/gcc/xtensa-esp32-elf/8.4.0/liblto_plugin.so: cannot open shared object file: No such file or directory
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
/data/cache/platformio/packages/framework-espidf/tools/cmake/project.cmake:296 (__project)
CMakeLists.txt:3 (project)
I tried installing through the esphome Bluetooth proxy site, and I just will not work.
(Obviously incredibly frustrating)
Initially I set it up but didn’t include the Bluetooth aspect, through esphome and had the device working. Then realised that that wasn’t how the Bluetooth bit was supposed to be set up, so then went through the “official” way, as I said above.
Going to now see if I can get it working and add in your code, see what happens.
I’ve been searching for answers to the CMake problem for 2 days, and no one gives their solution, or it doesn’t apply to me.
Anyway, I appreciate the assist. Hopefully this attempt will work, though I am in danger of becoming the definition of insanity at this point…