How to check presence of Beacon ?
Moderators: leecollings, remb0
-
- Posts: 192
- Joined: Monday 12 January 2015 23:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: FRANCE
- Contact:
How to check presence of Beacon ?
EDIT :
All informations of this thread is resume in the wiki, here :
https://www.domoticz.com/wiki/Presence_ ... _Beacon%29
Hi,
My idea is to automatically arm/disarm my domoticz alarm system by checking presence of beacon. I plan to equip all the familly keys with beacon. Domoticz will trigger the alarm on when the last beacon leaves the home. (Small home. 7m is enough. And as my domoticz speaks, i don't fear false alarms).
So: did someone already have experience with that ?
How domoticz can test presence of beacon ? I read topic on the opposite usage (raspberry is the beacon, and phone made the check). For me, the raspberry must be the receiver. Not the Beacon.
All informations of this thread is resume in the wiki, here :
https://www.domoticz.com/wiki/Presence_ ... _Beacon%29
Hi,
My idea is to automatically arm/disarm my domoticz alarm system by checking presence of beacon. I plan to equip all the familly keys with beacon. Domoticz will trigger the alarm on when the last beacon leaves the home. (Small home. 7m is enough. And as my domoticz speaks, i don't fear false alarms).
So: did someone already have experience with that ?
How domoticz can test presence of beacon ? I read topic on the opposite usage (raspberry is the beacon, and phone made the check). For me, the raspberry must be the receiver. Not the Beacon.
Last edited by jmleglise on Sunday 22 May 2016 11:44, edited 2 times in total.
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
Re: How to check presence of Beacon ?
Not sure which technology you are planning to use for your beacons, but for bluetooth I'm using the setup described in this topic: viewtopic.php?t=5214
-
- Posts: 192
- Joined: Monday 12 January 2015 23:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: FRANCE
- Contact:
Re: How to check presence of Beacon ?
I moved forward in my searches and I have choosen Ble (Bluetooth 4.0 Low Energy)
I have ordered :
- Bluetooth 4.0 Low Energy Tag tracker : http://www.banggood.com/Sfd-p-985626.html
- BLe v4 usb dongle : http://www.amazon.fr/gp/product/B00L317 ... TE_3p_dp_1
And found some HowTo :
http://www.switchdoc.com/2014/08/ibeaco ... er-python/
http://play.with.free.fr/index.php/pebb ... domotique/
I will report here my implementation. (in 1 month, after a very long time to wait the delivery from China...)
I have ordered :
- Bluetooth 4.0 Low Energy Tag tracker : http://www.banggood.com/Sfd-p-985626.html
- BLe v4 usb dongle : http://www.amazon.fr/gp/product/B00L317 ... TE_3p_dp_1
And found some HowTo :
http://www.switchdoc.com/2014/08/ibeaco ... er-python/
http://play.with.free.fr/index.php/pebb ... domotique/
I will report here my implementation. (in 1 month, after a very long time to wait the delivery from China...)
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
-
- Posts: 157
- Joined: Thursday 27 August 2015 18:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6028
- Location: Greece
- Contact:
Re: How to check presence of Beacon ?
Edit: Another flavor for BLE precence detection using FHEM
viewtopic.php?f=28&t=10640&start=160#p87194
Thanks jmleglise for youe first ports, that was the way I found FHEM
viewtopic.php?f=28&t=10640&start=160#p87194
Thanks jmleglise for youe first ports, that was the way I found FHEM

Last edited by korniza on Thursday 26 May 2016 22:20, edited 1 time in total.
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
-
- Posts: 192
- Joined: Monday 12 January 2015 23:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: FRANCE
- Contact:
Re: How to check presence of Beacon ?
Hi,
I have received my order. So I think, i will test it in the next 10 days.
I have received my order. So I think, i will test it in the next 10 days.
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
-
- Posts: 157
- Joined: Thursday 27 August 2015 18:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6028
- Location: Greece
- Contact:
Re: How to check presence of Beacon ?
I have the same ble trackers but they disabled if are not connected after a while. If have a way to keep them alive and broadcast their mac address it is an info I like to hear.
instead i bought, also from same shop, a set of NUT tracker ( http://www.banggood.com/Mini-Smart-Patc ... 88462.html ) that can be active even they are not connected.
FHEM (another home automation platform: http://fhem.de/fhem.html )has a script (as you may find building your project) that check the presence of a bluetooth mac address and can trigger a commnad.
CAN SOMEONE TO USE THE SCRIPT ON PAGE http://svn.code.sf.net/p/fhem/code/trun ... /presenced AND ADJUST IT FOR DOMOTICZ USE?!?!?
THE DIFFERENCE IS THAT TRACK BLE DEVICES WITHOUT l2ping which is not applicable for Ble devices!!

instead i bought, also from same shop, a set of NUT tracker ( http://www.banggood.com/Mini-Smart-Patc ... 88462.html ) that can be active even they are not connected.
FHEM (another home automation platform: http://fhem.de/fhem.html )has a script (as you may find building your project) that check the presence of a bluetooth mac address and can trigger a commnad.
CAN SOMEONE TO USE THE SCRIPT ON PAGE http://svn.code.sf.net/p/fhem/code/trun ... /presenced AND ADJUST IT FOR DOMOTICZ USE?!?!?

THE DIFFERENCE IS THAT TRACK BLE DEVICES WITHOUT l2ping which is not applicable for Ble devices!!



>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
-
- Posts: 192
- Joined: Monday 12 January 2015 23:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: FRANCE
- Contact:
Re: How to check presence of Beacon ?
Hi,
I just made some test , and I came to the same conclusion. that the Tag switch off if not connected to the mobile Apps.
So :
1/ Are you sure, that your new NUT Tag continue to broadcast ? How do you test it ? (I don't want to buy if not certain)
2/ with your NUT, did you try this python script : testblescan.py
like this :
sudo git clone https://github.com/switchdoclabs/iBeacon-Scanner-.git
sudo python testblescan.py
or this :
sudo hcitool lescan
I just made some test , and I came to the same conclusion. that the Tag switch off if not connected to the mobile Apps.
So :
1/ Are you sure, that your new NUT Tag continue to broadcast ? How do you test it ? (I don't want to buy if not certain)
2/ with your NUT, did you try this python script : testblescan.py
like this :
sudo git clone https://github.com/switchdoclabs/iBeacon-Scanner-.git
sudo python testblescan.py
or this :
sudo hcitool lescan
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
-
- Posts: 157
- Joined: Thursday 27 August 2015 18:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6028
- Location: Greece
- Contact:
Re: How to check presence of Beacon ?
no need to worry that these iTags you bought are useless. you can use it as Panic Button (if they detected, run a alarm/start recording from cameras,ryc).
1/ The trick is that I installed the application on mobile, I paired them and after I removed application. NUT2 still broadcast their MAC address!
2/ I used a lot of scripts, commands and as always NUT are available!
Right now as I told i use FHEM (especially bluetooth presence module). I try to find a way to trigger domoticz from FHEM on presence/absence of NUT.
It is not a clean way as I have to use 2 different home automation systems.
I hope someone who knows better coding to port the previous script on domoticz and get a native bluetooth solution. Looking deeper on bluetooth le, I see that some ble tags like these you bought can be programmed via bluetooth. We need people from comminity to get involved on bluetooth solutions.
1/ The trick is that I installed the application on mobile, I paired them and after I removed application. NUT2 still broadcast their MAC address!
2/ I used a lot of scripts, commands and as always NUT are available!
Right now as I told i use FHEM (especially bluetooth presence module). I try to find a way to trigger domoticz from FHEM on presence/absence of NUT.
It is not a clean way as I have to use 2 different home automation systems.
I hope someone who knows better coding to port the previous script on domoticz and get a native bluetooth solution. Looking deeper on bluetooth le, I see that some ble tags like these you bought can be programmed via bluetooth. We need people from comminity to get involved on bluetooth solutions.
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
-
- Posts: 192
- Joined: Monday 12 January 2015 23:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: FRANCE
- Contact:
Re: How to check presence of Beacon ?
Hi,
I have received the NUT Tag and You were right, it broadcasts.
I read that you use FHEM for the detection : What is the latency of detection of this solution ? (I mean the frequency of the check).
I have received the NUT Tag and You were right, it broadcasts.
I read that you use FHEM for the detection : What is the latency of detection of this solution ? (I mean the frequency of the check).
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
-
- Posts: 157
- Joined: Thursday 27 August 2015 18:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6028
- Location: Greece
- Contact:
Re: How to check presence of Beacon ?

It took me long time to find how to put fhem connected with domoticz. here is the way I do: it's just sends once a nut it recognised only ONE trigger using the following
Code: Select all
define NUT_Maria PRESENCE lan-bluetooth xx:xx:xx:xx:xx:xx localhost:5333 [b]30 60[/b]
attr NUT_Maria event-on-change-reading state
define Maria_p notify NUT_Maria:present "curl -s "http://xx.xx.xx.xx:8080/json.htm?type=command¶m=switchlight&idx=18&switchcmd=On" &"
define Maria_a notify NUT_Maria:absent "curl -s "http://xx.xx.xx.xx:8080/json.htm?type=command¶m=switchlight&idx=18&switchcmd=Off" &"
take your time and check how can lower this value. I believe that it also depends of the devices to check you have on FHEM.
Edit: As I imagine you need it for presence detection, you may consider bluetooth range. increasing bluetooth dongle range can give you early detection (before entering home) and coverage. I suggest to get a class 1 BT v4 dongle as in theory can reach 100m coverage (50m in radius on open enviroment). I confirm that it getting better results. I can also suggest the following as it gave me more coverage that the cheap i replaced. http://www.ebay.co.uk/itm/271983450417? ... EBIDX%3AIT
It the next weeks I ll get an extra bluetooth dongle and an extra raspberry-like to install it to the other side of house, so to complete the full coverage of house. The idea is to trigger domoticz only NUT can not be found from any bluetooth dongle. If you know FHEM how can treat this scenario please drop a message!

>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
- blackdog65
- Posts: 311
- Joined: Tuesday 17 June 2014 18:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Norfolk, UK
- Contact:
Re: How to check presence of Beacon ?
I've just found this thread and found it very interesting.
I have problems with geofencing etc and all decent beacon ideas have been very apple orientated
To me the concept of multiple RasPi/BLE boxes dotted about looks quite cool. I'd be interested in being able to recognise the approach of either my wife's car or my own and turn on external lighting and open an electric gate.
I think I'll be buying some NUT tags soon, but what is their range like?
many thanks
Sean
I have problems with geofencing etc and all decent beacon ideas have been very apple orientated

To me the concept of multiple RasPi/BLE boxes dotted about looks quite cool. I'd be interested in being able to recognise the approach of either my wife's car or my own and turn on external lighting and open an electric gate.
I think I'll be buying some NUT tags soon, but what is their range like?
many thanks
Sean
CubieTruck Master
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
RasPi slaves
Aeon Labs Z-Stick, multi sensor
Fibaro Dimmers, relays, Universal sensors
EQ3 MAX!
TKB Sockets
RFXCOM
LightwaveRF sockets, switches, relays, doorbell
MySensors
ESPEasy ESP8266-12E
-
- Posts: 476
- Joined: Monday 14 March 2016 13:55
- Target OS: Linux
- Domoticz version: beta
- Location: Rome, Italy
- Contact:
Re: How to check presence of Beacon ?
korniza wrote:I'm glad to hear it!
It took me long time to find how to put fhem connected with domoticz. here is the way I do: it's just sends once a nut it recognised only ONE trigger using the following
if you omit the second line, FHEM will repeat send every 30 sec a new status. You see 30 is how much time will recheck status. lower= faster BUT as I see when using values smaller than 10 secs, BT detection gets unstable or FHEM crash.Code: Select all
define NUT_Maria PRESENCE lan-bluetooth xx:xx:xx:xx:xx:xx localhost:5333 [b]30 60[/b] attr NUT_Maria event-on-change-reading state define Maria_p notify NUT_Maria:present "curl -s "http://xx.xx.xx.xx:8080/json.htm?type=command¶m=switchlight&idx=18&switchcmd=On" &" define Maria_a notify NUT_Maria:absent "curl -s "http://xx.xx.xx.xx:8080/json.htm?type=command¶m=switchlight&idx=18&switchcmd=Off" &"
take your time and check how can lower this value. I believe that it also depends of the devices to check you have on FHEM.
Edit: As I imagine you need it for presence detection, you may consider bluetooth range. increasing bluetooth dongle range can give you early detection (before entering home) and coverage. I suggest to get a class 1 BT v4 dongle as in theory can reach 100m coverage (50m in radius on open enviroment). I confirm that it getting better results. I can also suggest the following as it gave me more coverage that the cheap i replaced. http://www.ebay.co.uk/itm/271983450417? ... EBIDX%3AIT
It the next weeks I ll get an extra bluetooth dongle and an extra raspberry-like to install it to the other side of house, so to complete the full coverage of house. The idea is to trigger domoticz only NUT can not be found from any bluetooth dongle. If you know FHEM how can treat this scenario please drop a message!
Hi korniza
can you explain how to implement BT scanning in Domoticz?
I have Nut and RPi3, so it should be ok to use it.
I tried the
Code: Select all
sudo hcitool -i hci0 lescan --duplicates
And now?
How can I scan and trigger it in Domoticz?
I don't have FHEM!!!

Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
-
- Posts: 86
- Joined: Sunday 01 May 2016 0:34
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: NL
- Contact:
Re: How to check presence of Beacon ?
Do you guys mind creating a Wiki? There's a lot scattered across this board.
Im very hype to test this and planning to buy devices for the whole family + maid + babysitter.
Whats the best advice you can give me? Go for the cheaper BLE or for NUTs? Only the BLE has the 'panic' button, right?
Thanks a lot for sharing all your info! Really appreciate the work you've put into this.
Im very hype to test this and planning to buy devices for the whole family + maid + babysitter.
Whats the best advice you can give me? Go for the cheaper BLE or for NUTs? Only the BLE has the 'panic' button, right?
Thanks a lot for sharing all your info! Really appreciate the work you've put into this.
-
- Posts: 157
- Joined: Thursday 27 August 2015 18:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6028
- Location: Greece
- Contact:
Re: How to check presence of Beacon ?
weekend TODO listmicbou wrote:Do you guys mind creating a Wiki? There's a lot scattered across this board.
Im very hype to test this and planning to buy devices for the whole family + maid + babysitter.
Whats the best advice you can give me? Go for the cheaper BLE or for NUTs? Only the BLE has the 'panic' button, right?
Thanks a lot for sharing all your info! Really appreciate the work you've put into this.

>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
-
- Posts: 476
- Joined: Monday 14 March 2016 13:55
- Target OS: Linux
- Domoticz version: beta
- Location: Rome, Italy
- Contact:
Re: How to check presence of Beacon ?
When I do a
don't know if it's a BLE issue, but I get the devicemacaddress twice, first row as (unknown) and second row with the right name
So if I try
I don't get anything because the first row is (unknown)
Is there a way just to know if the device is in the list of the scanned or is active?
Thanks
Code: Select all
sudo hcitool -i hci0 lescan --duplicates
So if I try
Code: Select all
hcitool name devicemacaddress
Is there a way just to know if the device is in the list of the scanned or is active?
Thanks
Cubietruck - Linux cubietruck 4.13.16 (Debian GNU/Linux 8 (jessie)) + Domoticz + RFLink, Xiaomi Gateway, Owl USB, Yeelight Color and B/W, ESP8266, Broadlink RM2, Netatmo Thermostat
-
- Posts: 157
- Joined: Thursday 27 August 2015 18:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6028
- Location: Greece
- Contact:
Re: How to check presence of Beacon ?
guys, hcitool can not provide by itself a real interface (at least not aby itslef) to domoticz.
I used FHEM (http://fhem.de/fhem.html ) .
using the following part to fhem.cfg, you can trigger a switch to domoticz.
NUT_Maria: the internal name of BLE NUT (not the real that is been broadcasted by NUT device)
xx:xx:xx:xx:xx:xx : Mac Address of the BLE NUT (http://www.banggood.com/Mini-Smart-Patc ... 88462.html)
localhost:5333 30 60 : the host:port that runs FHEM. 30 60 it is the seconds for checking the status of this BLE NUT
attr NUT_Maria event-on-change-reading state : FHEM sends status update to domoticz ONLY when FHEM find a change of state. Ommiting this will send every 30 secs the status of BLE NUT
Maria_p : Name of Presence status (you can put anything you like)
Maria_a: Name of Absence status (you can put anything you like)
curl -s "http://aa.aaaa.aa:8080/json.htm?type=co ... itchcmd=On : Send the Precence status to domoticz. please chance the idx inside link to match to you idx of your switch.
curl -s "http://aa.aaaa.aa:8080/json.htm?type=co ... itchcmd=On : Send the Absence status to domoticz. please chance the idx inside link to match to you idx of your switch.
Hope it helped a little
I used FHEM (http://fhem.de/fhem.html ) .
So in practice I run a second home automation system to the same raspberry (no conflict on ports/resources) and trigger domoticz. FHEM is very stable as I used it till now but the frontend interface is poor comparing with domoticz.FHEM (TM) is a GPL'd perl server for house automation. It is used to automate some common tasks in the household like switching lamps / shutters / heating / etc. and to log events like temperature / humidity / power consumption.
The program runs as a server, you can control it via web or smartphone frontends, telnet or TCP/IP directly.
In order to use FHEM you'll need a 24/7 server (Fritz!Box, NAS, RPi, PC, MacMini, etc) with a perl interpreter and some attached hardware like the CUL, FHZ1300PC, etc. to access the actors and sensors.
using the following part to fhem.cfg, you can trigger a switch to domoticz.
Code: Select all
define NUT_Maria PRESENCE lan-bluetooth xx:xx:xx:xx:xx:xx localhost:5333 30 60
attr NUT_Maria event-on-change-reading state
define Maria_p notify NUT_Maria:present "curl -s "http://aa.aaaa.aa:8080/json.htm?type=command¶m=switchlight&idx=18&switchcmd=On" &"
define Maria_a notify NUT_Maria:absent "curl -s "http://aa.aaaa.aa:8080/json.htm?type=command¶m=switchlight&idx=18&switchcmd=Off" &"
xx:xx:xx:xx:xx:xx : Mac Address of the BLE NUT (http://www.banggood.com/Mini-Smart-Patc ... 88462.html)
localhost:5333 30 60 : the host:port that runs FHEM. 30 60 it is the seconds for checking the status of this BLE NUT
attr NUT_Maria event-on-change-reading state : FHEM sends status update to domoticz ONLY when FHEM find a change of state. Ommiting this will send every 30 secs the status of BLE NUT
Maria_p : Name of Presence status (you can put anything you like)
Maria_a: Name of Absence status (you can put anything you like)
curl -s "http://aa.aaaa.aa:8080/json.htm?type=co ... itchcmd=On : Send the Precence status to domoticz. please chance the idx inside link to match to you idx of your switch.
curl -s "http://aa.aaaa.aa:8080/json.htm?type=co ... itchcmd=On : Send the Absence status to domoticz. please chance the idx inside link to match to you idx of your switch.
Hope it helped a little
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
-
- Posts: 192
- Joined: Monday 12 January 2015 23:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: FRANCE
- Contact:
Re: How to check presence of Beacon ?
Hi,
That's it, I got it ! I have a satisfactory solution to detect the presence of beacon (Bluetooth 4.0 Low Energy Tag tracker) with Domoticz on linux (raspberry).
This beacon works fine :
http://eu.banggood.com/Wholesale-Wareho ... 88462.html
Presence is detected in 4 to 8 secondes. (Thus on the contrary, the absence may be decided in less than 15 secondes when the tracker get out of range...)
The dongle below detects it to a distance of 12m (in direct view) or upstairs across 2 floors.
This other beacon, is useless. I don't succeed to use it. it stops emitting when it is disconnected from its Phone apps.
http://www.banggood.com/Sfd-p-985626.html
I use this usb dongle that works fine :
https://www.amazon.fr/SODIAL-Adaptateur ... TE_3p_dp_1
And then the installation :
First install the last Bluetooth stack. Check the last version here : http://www.kernel.org/pub/linux/bluetooth/ (mine was 5.39). The compilation take around 20 minutes. And at the end, you will need to reboot :
Then active the dongle :
In Domoticz I use an Uservariable for each beacon.
And now, here is the python script I have made : https://github.com/jmleglise/mylittle-d ... resence.py to detect the beacons and update the uservariable of Domoticz. Execute it with :
TODO :
- Transform this script in a linux service (/etc/init.d) ...
- check the battery life (to notify to replace the battery)
- use the Signal Strengh
That's it, I got it ! I have a satisfactory solution to detect the presence of beacon (Bluetooth 4.0 Low Energy Tag tracker) with Domoticz on linux (raspberry).
This beacon works fine :
http://eu.banggood.com/Wholesale-Wareho ... 88462.html
Presence is detected in 4 to 8 secondes. (Thus on the contrary, the absence may be decided in less than 15 secondes when the tracker get out of range...)
The dongle below detects it to a distance of 12m (in direct view) or upstairs across 2 floors.
This other beacon, is useless. I don't succeed to use it. it stops emitting when it is disconnected from its Phone apps.
http://www.banggood.com/Sfd-p-985626.html
I use this usb dongle that works fine :
https://www.amazon.fr/SODIAL-Adaptateur ... TE_3p_dp_1
And then the installation :
First install the last Bluetooth stack. Check the last version here : http://www.kernel.org/pub/linux/bluetooth/ (mine was 5.39). The compilation take around 20 minutes. And at the end, you will need to reboot :
Code: Select all
sudo mkdir bluez ; cd bluez ; sudo wget http://www.kernel.org/pub/linux/bluetooth/bluez-5.39.tar.xz
sudo tar -xJf bluez-5.39.tar.xz ; cd bluez-5.39 ; sudo ./configure --disable-systemd ; sudo make ; sudo make install ; sudo apt-get install python-bluez
sudo cp gatttool /usr/local/bin/
sudo shutdown -r now
Code: Select all
sudo hciconfig hci0 up
And now, here is the python script I have made : https://github.com/jmleglise/mylittle-d ... resence.py to detect the beacons and update the uservariable of Domoticz. Execute it with :
Code: Select all
sudo python check_beacon_presence.py
- Transform this script in a linux service (/etc/init.d) ...
- check the battery life (to notify to replace the battery)
- use the Signal Strengh
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
-
- Posts: 157
- Joined: Thursday 27 August 2015 18:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6028
- Location: Greece
- Contact:
Re: How to check presence of Beacon ?
Nice! I will try it ASAP! Does it update domoticz status every x secs, or if status is changed send an update to domoticz?jmleglise wrote: And now, here is the python script I have made : https://github.com/jmleglise/mylittle-d ... resence.py to detect the beacons and update the uservariable of Domoticz. Execute it with :TODO :Code: Select all
sudo python check_beacon_presence.py
- Transform this script in a linux service (/etc/init.d) ...
- check the battery life (to notify to replace the battery)
- use the Signal Strengh
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
-
- Posts: 192
- Joined: Monday 12 January 2015 23:27
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2022.1
- Location: FRANCE
- Contact:
Re: How to check presence of Beacon ?
I choose to update Domoticz only when the status changes. (beacon arrives in range or disappear).
My script : https://github.com/jmleglise
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
RFXTRX433E: Blind Somfy RTS, Portal Somfy Evolvia, chacon IO, Oregon, PIR sensor PT2262
My Last project : Location de vacances a Ouistreham vue mer
KMTronic USB relay
Chinese Z-WAVE: Neo CoolCam
-
- Posts: 157
- Joined: Thursday 27 August 2015 18:12
- Target OS: Raspberry Pi / ODroid
- Domoticz version: V3.6028
- Location: Greece
- Contact:
Re: How to check presence of Beacon ?
Thank you for sharing this script. I just tried it and I found a small bug: putting capital letters on MAC, it did not match with scanned MAC.jmleglise wrote:I choose to update Domoticz only when the status changes. (beacon arrives in range or disappear).
I suppose something has to do with string.
ALSO, there is no update for tags that are away but on status they seem to be HOME. I used the iTags and they stay on status HOME.
Some requests:
Can you please add a switch for devices to keep send updates even status has not changed? As you also have the BLE keys that stop broadcasting, I used them for PANIC button, so I like to trigger some devices to do repeated tasks (take snapshots, send repeated emails, etc).
Also can you softcode the delay for each device (you have 15 secs), so on some critical devices to be less or on other more (for example bluetooth speakers)
Thanks again for sharing your ideas & code

Last edited by korniza on Saturday 07 May 2016 0:04, edited 1 time in total.
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
Who is online
Users browsing this forum: No registered users and 0 guests