How to check presence of Beacon ?
Moderators: leecollings, remb0
-
- Posts: 402
- Joined: Wednesday 26 February 2014 15:28
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: the Netherlands
- Contact:
Re: How to check presence of Beacon ?
I have this working but it only works for a few seconds. After that no updates are made. When I do a reset then it works for a few seconds again.
-
- Posts: 18
- Joined: Thursday 17 August 2017 20:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to check presence of Beacon ?
Hi jimieglise,
i installed your script and it is running as a service. All is fine Thanks for the Great Work.
But there is one thing which makes me crazy.
Example: i sit nearby the Bluetooth dongle location (with the beacon laying down on the desk) the Presence should be ok but on each checking of the script it returns the beacon Away then a value then Away then a Value and so on...
The Beacon is not Moving. But the status is flapping
any ideas?
thx
jens
i installed your script and it is running as a service. All is fine Thanks for the Great Work.
But there is one thing which makes me crazy.
Example: i sit nearby the Bluetooth dongle location (with the beacon laying down on the desk) the Presence should be ok but on each checking of the script it returns the beacon Away then a value then Away then a Value and so on...
The Beacon is not Moving. But the status is flapping
any ideas?
thx
jens
-
- Posts: 69
- Joined: Monday 30 November 2015 11:36
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to check presence of Beacon ?
Hi! I just got a Mini Nut 2. Is it possible to call mi nut from domoticz like I can do from the iOS app? I want to be able to search my keys currently attached to the Nut. So, can I get my Nut to beep via domoticz? Thanks
Enviado desde mi iPhone utilizando Tapatalk Pro
Enviado desde mi iPhone utilizando Tapatalk Pro
-
- Posts: 129
- Joined: Saturday 01 October 2016 14:48
- Target OS: Raspberry Pi / ODroid
- Domoticz version: LastBeta
- Location: Italy BG
- Contact:
Re: How to check presence of Beacon ?
hi, i have reinstall all bluez with fw 5.46.
in the folder attribute i can't find the file gatttool,so i can't take the command
sudo cp attrib/gatttool /usr/local/bin/ as in the wiki.
any info for me ?
in the folder attribute i can't find the file gatttool,so i can't take the command
sudo cp attrib/gatttool /usr/local/bin/ as in the wiki.
any info for me ?
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: How to check presence of Beacon ?
mine gets at 30% after almost a year
battery check will drain the battery, so do not check it too much... once a week should be enough.
I use to check it every time the nut will appear back in the network... soon I'll move this to once a day as soon as it is back availble
ciao
M
battery check will drain the battery, so do not check it too much... once a week should be enough.
I use to check it every time the nut will appear back in the network... soon I'll move this to once a day as soon as it is back availble
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
Re: How to check presence of Beacon ?
Hello, i'm using this script since 6 month ago circa with my PI3 internal BT. All is working fine but the signal is so strong that the variable "home/away" changes also when i'm out of the building and i go from my car to my garage
Any trick for set in the script an RSSI max value for the discovery?
Any trick for set in the script an RSSI max value for the discovery?
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: How to check presence of Beacon ?
RSSI is gather once the beacon is discovered as available in the network...
this means that if your beacon bumps off and on it means that is not seen during the scan... this is possible for a wide range of reasons:
- BT atenna is shielded by walls, metals or other stuff
- BT interface is not availble by the time of scan (do you have other services that runs at the same time that use hci0?)
- Scan time is too short (specially when there are a lot of LE devices available)
my old script used to check 3 times in 10 seconds before setting off a device due to those bumps (my pi is inside a closet), than I placed a CRS bt4 dongle which was more efficient.. and did not get this issue anymore.
Sometimes the BLE itself won't beacon as it is supposed to do
this means that if your beacon bumps off and on it means that is not seen during the scan... this is possible for a wide range of reasons:
- BT atenna is shielded by walls, metals or other stuff
- BT interface is not availble by the time of scan (do you have other services that runs at the same time that use hci0?)
- Scan time is too short (specially when there are a lot of LE devices available)
my old script used to check 3 times in 10 seconds before setting off a device due to those bumps (my pi is inside a closet), than I placed a CRS bt4 dongle which was more efficient.. and did not get this issue anymore.
Sometimes the BLE itself won't beacon as it is supposed to do
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
- solidum90
- Posts: 37
- Joined: Tuesday 01 August 2017 20:59
- Target OS: NAS (Synology & others)
- Domoticz version: Debian
- Location: Milan
- Contact:
Re: How to check presence of Beacon ?
Hello to everyone,
this script works great.. but I have two questions:
I have a nut 3 Beacon, when the Beacon is associated iphone's app this script doesn't see beacon, is it correct?
There's no way to works both ?
Otherwise, can not you run this script even to detect iphone?
(I try to add my iphone on TAG_DATA but it doesn't work)
Thanks to everyone and congratulations for this project!
this script works great.. but I have two questions:
I have a nut 3 Beacon, when the Beacon is associated iphone's app this script doesn't see beacon, is it correct?
There's no way to works both ?
Otherwise, can not you run this script even to detect iphone?
(I try to add my iphone on TAG_DATA but it doesn't work)
Thanks to everyone and congratulations for this project!
-
- Posts: 129
- Joined: Saturday 01 October 2016 14:48
- Target OS: Raspberry Pi / ODroid
- Domoticz version: LastBeta
- Location: Italy BG
- Contact:
Re: How to check presence of Beacon ?
Hi, i think the nut can't work in 2 system. Actually i have 5 nut and all work ok, but no nut is connected to the app.solidum90 wrote: ↑Tuesday 05 September 2017 22:40 Hello to everyone,
this script works great.. but I have two questions:
I have a nut 3 Beacon, when the Beacon is associated iphone's app this script doesn't see beacon, is it correct?
There's no way to works both ?
Otherwise, can not you run this script even to detect iphone?
(I try to add my iphone on TAG_DATA but it doesn't work)
Thanks to everyone and congratulations for this project!
But i'm waiting a response from Mr. Emme.
Bye Bye.
Master (pi3) - MB sensors + Dummy + Sysfs gpio + 1 NodOn MSP-3 + 1 Aeotec DSB28 Energy Meter + 3 Danfoss RS Room + 7 Danfoss Z Thermostat + 1 Swiid Inter + 9 FGS222
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
Slave01 (pi2) - MB sensors + Dummy + Weather Underground + 2 FGS223 + 1 FGWPE/F
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: How to check presence of Beacon ?
unfortunately yes
if the BLE is paired than it disappear from the scan, unfortunately there is no workaround to have it works either way
presence of iOS devices is quite wired...
since they do NOT reply to WLAN ping, it looks they do on Bluetooth...
so you could use hcitool scan (instead of lescan) to identify it, of course you cannot use gatttool for battery, but you could only discover its presence
just remember to leave bt On on the device
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
- solidum90
- Posts: 37
- Joined: Tuesday 01 August 2017 20:59
- Target OS: NAS (Synology & others)
- Domoticz version: Debian
- Location: Milan
- Contact:
Re: How to check presence of Beacon ?
Thanks for reply (sei italiano? )emme wrote: ↑Wednesday 06 September 2017 8:35unfortunately yes
if the BLE is paired than it disappear from the scan, unfortunately there is no workaround to have it works either way
presence of iOS devices is quite wired...
since they do NOT reply to WLAN ping, it looks they do on Bluetooth...
so you could use hcitool scan (instead of lescan) to identify it, of course you cannot use gatttool for battery, but you could only discover its presence
just remember to leave bt On on the device
ciao
M
I found a "workaround", I use l2ping on inside an ula script that they already use to detect presence with ping, but with iphone has no sense because when it is locked it does not respond to ping.
Then I use your script to query the nut.
In this way if the nut is connected to the ap I ping iphone via l2ping, otherwise I query the nut directly.
Every minute runs an ula script that verifies if at least one device responds to determining the presence.
Is it a good way?
This is a part of my ula script:
Code: Select all
DisposiviPresenza = {};
DisposiviPresenza[1] = {nome="iPhoneLorenzo", ip = "ip.xxx.xxx.xxx", bluetooth="mac:xx:xx:xx:xx:xx"}
-- ping dispositivi di presenza
for i, v in pairs(DisposiviPresenza) do
local ping = false;
local string;
if v.bluetooth ~= nil then
string = 'l2ping -c1 -s32 -t1 '..v.bluetooth
TraceLog ("l2ping : " .. string)
ping = os.execute(string);
if (ping) then
TraceLog ("==> "..v.nome.." ping OK")
else
TraceLog ("==> "..v.nome.." ping NOK")
end
end
if not ping and v.ip ~= nil then
string = 'ping -c 1 -w 1 '..v.ip
TraceLog (">ping : " .. string)
ping = os.execute(string);
if (ping) then
TraceLog ("==> "..v.nome.." ping OK")
else
TraceLog ("==> "..v.nome.." ping NOK")
end
end
ping_success = ping_success or ping
end
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: How to check presence of Beacon ?
..abbastanza (Milano )
I think your script is GREAT solution
I did not knew the iOS device does not reply in standby mode (thanks Apple! ) and your way to seek for the device and then the nut is good!
ciao
M
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
- solidum90
- Posts: 37
- Joined: Tuesday 01 August 2017 20:59
- Target OS: NAS (Synology & others)
- Domoticz version: Debian
- Location: Milan
- Contact:
Re: How to check presence of Beacon ?
Allora siamo anche vicini di casa (io Monza :p)
Always say thanks to Apple (my girlfriend given iphone, otherwise I would never have taken it! :p)
-
- Posts: 48
- Joined: Friday 31 January 2014 14:32
- Target OS: Windows
- Domoticz version:
- Location: Norway
- Contact:
Re: How to check presence of Beacon ?
I do have problems understanding the concept of user variables and thus getting the script to work with domoticz.
I've installed the script and manually running the script gives me a log file without errors:
PS! Running the script as a service fails. I don't know if this is relevant as the script seems to work by manually starting the script.
I've installed the script and manually running the script gives me a log file without errors:
- Spoiler: show
- Spoiler: show
PS! Running the script as a service fails. I don't know if this is relevant as the script seems to work by manually starting the script.
- Spoiler: show
- emme
- Posts: 909
- Joined: Monday 27 June 2016 11:02
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest
- Location: Milano, Italy
- Contact:
Re: How to check presence of Beacon ?
The external script does update a user variable, if you want to act a device istead you have 2 ways:
1) change the script in order to
use a UserVariable event in domoticz by which you switch a device based on the variable...
for my needs I used this way and here is the portion of my script that apply a device..
note that both user variable and switch have the same name and same prefix (NUT_*)
ciao
M
1) change the script in order to
- replace HOME/AWAY with On/Off
- do not use REPEAT_MODE but only SWITCH_MODE
- change the http request to update the variable with the request to update a switch
use a UserVariable event in domoticz by which you switch a device based on the variable...
for my needs I used this way and here is the portion of my script that apply a device..
note that both user variable and switch have the same name and same prefix (NUT_*)
ciao
M
Code: Select all
return {
active = true,
on = { variables = { 'NUT_*' } },
logging = {
level = domoticz.LOG_FORCE,
marker = "[NUT Script] ==> "
},
execute = function(dz, nVar)
if nVar.value == 'AWAY' then
dz.devices(nVar.name).switchOff().checkFirst()
else
dz.devices(nVar.name).switchOn().checkFirst()
end
end
}
The most dangerous phrase in any language is:
"We always done this way"
"We always done this way"
- Ascari
- Posts: 30
- Joined: Thursday 28 September 2017 21:35
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 4.9
- Location: Belgium
- Contact:
Re: How to check presence of Beacon ?
Any Solution with Synology ?
-
- Posts: 56
- Joined: Tuesday 22 August 2017 20:50
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Belarus
- Contact:
Re: How to check presence of Beacon ?
Python plugin for Beacon detection with multi-scanners:
viewtopic.php?f=65&t=20577
viewtopic.php?f=65&t=20577
-
- Posts: 5
- Joined: Tuesday 12 December 2017 16:17
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to check presence of Beacon ?
Hi I apologize for bothering but would it be a trouble for you to provide the script for checking the battery level of the NUT3?emme wrote: ↑Monday 04 September 2017 17:00 mine gets at 30% after almost a year
battery check will drain the battery, so do not check it too much... once a week should be enough.
I use to check it every time the nut will appear back in the network... soon I'll move this to once a day as soon as it is back availble
ciao
M
I mean a script integrated with the one which scans or one to be added to events. I have been using your script for a while which works great but I would rather prefer not to spend time to learn how to write python scripts (I already had to learn dzvents)...
Thank you very much in advance
Grazie
G
Update
I have modified the script for Mini Nut http://www.domoticz.com/forum/viewtopic.php?t=16349
thanks
-
- Posts: 6
- Joined: Thursday 17 May 2018 1:18
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to check presence of Beacon ?
Hello,
I have followed the wiki to install the script in my RPi3, with internal BT, to use with 2 Nut Mini.
I have added 2 virtual switch to simulate presence detection. It works ok, since by any reason, Domoticz stops detecting any of them, while it seems that the check_beacon_presence.service script is active and running.
Any idea how to check what is happening?
Thanks
EDIT: I have just changed critical to debug to see what's is doing...
EDIT 2: Just has stopped 6 minutes ago, at 01:00. Here is the stopped log. Nothing else:
I have followed the wiki to install the script in my RPi3, with internal BT, to use with 2 Nut Mini.
I have added 2 virtual switch to simulate presence detection. It works ok, since by any reason, Domoticz stops detecting any of them, while it seems that the check_beacon_presence.service script is active and running.
- Spoiler: show
- Spoiler: show
Any idea how to check what is happening?
Thanks
EDIT: I have just changed critical to debug to see what's is doing...
EDIT 2: Just has stopped 6 minutes ago, at 01:00. Here is the stopped log. Nothing else:
- Spoiler: show
-
- Posts: 6
- Joined: Thursday 17 May 2018 1:18
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: How to check presence of Beacon ?
Hello again,
Today I have restarted again the script, in SWITCH_MODE.
Here is the result of start the script, and how it stops around 30 min later:
If I restarted the service, both comes alive.
Any help?
Today I have restarted again the script, in SWITCH_MODE.
Here is the result of start the script, and how it stops around 30 min later:
- Spoiler: show
- Spoiler: show
If I restarted the service, both comes alive.
Any help?
Who is online
Users browsing this forum: No registered users and 1 guest