Still I have FHEM as prefered solution as it supports even more PRESENCE types (wifi, SNMP, BLE remote/local). it is 100% stable and memory footprint is so small. The delay is less than 3 sec!
The only issue is that community is german speaking so for people that do not understand German, google translate is their friend.
Also it did not read battery or button status of beacon which would be great to have.
>>>> 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)
Describe a bit more your need. What do you want to do with this information ?
Because, you already have this information in uservariable.
If you succeed to install the system, you have done the most difficult.
This is what I want. When I (Tag_Michel with device IDX 23 ) am not home I want a switch to show AWAY and the same for my wife (Tag_Vanessa with device IDX 20). Obviously I'd like it to show 'HOME' when I am at home. When both me and my wife (Tag_Vanessa with device IDX 20) aren't in the house I want the alarm to trigger to 'AWAY'. Also when I come home I want a TTS switch to welcome me home with some news.
Is there a way to do this w/ Blocky? I have build 2 virtual switches, but they don't show an off and on state.
Thanks again for your patience and help...
To add: my log stopped working. When checking status I get
If you want to go into alarm and TTS things, I advise you to start discover Lua. You 're going to struggle a bit several days, and then you will go much more far than with blocky.
jmleglise wrote:If you want to go into alarm and TTS things, I advise you to start discover Lua. You 're going to struggle a bit several days, and then you will go much more far than with blocky.
However , that is a starting point in blocky :
blocky_presence.jpg
thanks. Could you help me 1 step back and show me how to add the 'away' and 'home' status?
- You create in domoticz manually 1 uservariable for each beacon.
- the python script update those uservariables accordingly of the presence of the beacons.
- you use those uservariables in your domoticz logic
So if your installation of the script (from the wiki) works, that means that the uservariables are always up to date : Away, home, or the RSSI of the beacon, accordingly to the mode that you chose in the python script.
jmleglise wrote:- You create in domoticz manually 1 uservariable for each beacon.
- the python script update those uservariables accordingly of the presence of the beacons.
- you use those uservariables in your domoticz logic
So if your installation of the script (from the wiki) works, that means that the uservariables are always up to date : Away, home, or the RSSI of the beacon, accordingly to the mode that you chose in the python script.
Ok so here's what I did.
SETUP > User Variable
Variable name Tag_Michel
Variable type: String
Variable Value AWAY
ADD
Variable name Tag_Vanessa
Variable type: String
Variable Value AWAY
ADD
is that all? So does my domoticz now know when the value isn't AWAY because it sends a signal to the RPi3 and do I also need to set up switches?
Again, sorry for being such a noob and thanks for you patience.
It's Ok for the uservariable.
And,
-Did you configure the python script ?
-Is the uservariable updated accordingly to the presence of beacon ? Refresh the domoticz uservariable page : "AWAY" shall be replaced by "Home" or a negativ number.
--Variable scripts receive 7 tables from Domoticz: otherdevices, otherdevices_lastupdate, otherdevices_svalues, otherdevices_idx, , uservariables, uservariables_lastupdate and uservariablechanged
commandArray = {}
--beaconAway=0
beaconHome=0
for variableName, variableValue in pairs(uservariables) do
if string.sub(variableName,1,3)=="Tag" and variableValue ~= "AWAY" then
beaconHome=beaconHome+1
--else
-- beaconAway=beaconAway+1
end
end
if otherdevices['Alarm'] == 'On' and beaconHome>=1 then -- switch Off Alarm because 1 beacon come back Home
table.insert (commandArray, { ['Alarm'] ='Off' } )
-- print("switch Off")
elseif otherdevices['Alarm'] == 'Off' and beaconHome==0 then -- switch On Alarm because all beacon are away
table.insert (commandArray, { ['Alarm'] ='On' } )
-- print("switch On")
end
return commandArray
--Variable scripts receive 7 tables from Domoticz: otherdevices, otherdevices_lastupdate, otherdevices_svalues, otherdevices_idx, , uservariables, uservariables_lastupdate and uservariablechanged
commandArray = {}
--beaconAway=0
beaconHome=0
for variableName, variableValue in pairs(uservariables) do
if string.sub(variableName,1,3)=="Tag" and variableValue ~= "AWAY" then
beaconHome=beaconHome+1
--else
-- beaconAway=beaconAway+1
end
end
if otherdevices['Alarm'] == 'On' and beaconHome>=1 then -- switch Off Alarm because 1 beacon come back Home
table.insert (commandArray, { ['Alarm'] ='Off' } )
-- print("switch Off")
elseif otherdevices['Alarm'] == 'Off' and beaconHome==0 then -- switch On Alarm because all beacon are away
table.insert (commandArray, { ['Alarm'] ='On' } )
-- print("switch On")
end
return commandArray
ah, this I can read. Thanks!
So I just go to 'SETUP' > 'More options' > 'Event's > LUA and paste above and then Im good to go?
But as far as I'm concerned, I use the old way : I prefer to write the script in filesystem.
=> in domoticz/script/lua
that's a few steps to advanced for me
I'm noticing that the NUT's sometimes go into 'AWAY' status even though they are more than in reach of the Bluetooth signal. Do you have this experience as well?
With my hardware, up to a distance of 7m, I've experienced no probleme. Beyond, it's more uncertain. If you need a distance between 7-12m, you should, extend the timeout parameter in the python script. Perhaps, the distance depends of the battery life too.
Don't take it wrong, but I like to share the experience I have using FHEM.
I just installed another raspberry to the rooms that NUT get out of range. I installed on the new raspberry (slave) a bluetooth dongle and followed the guide on http://www.fhemwiki.de/wiki/Anwesenheitserkennung
On slave device there is no domoticz required of full FHEM installation! just 3 services to run and using collectord I can now walk around home without losing the presence flag. As FHEM supports rooms, now I know where any bluetooth device is present! So for the panic buttons it is usefull to know where button is pressed and run different scenarios (if it pressed on bedroom, turn on the bedroom lamp etc).
Next step: Add an extra raspberry or lower power device to garden attached with usb bluetooth dongle, so I can get garden lights turned on/off.
Attachments
Home, Sweet Home.png (212.68 KiB) Viewed 5004 times
>>>> 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)