Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Search the Community

Showing results for tags 'presence'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • FIBARO Community
    • FIBARO Portal and Forum policy
    • FIBARO
    • Say hello!
    • Off-topics
  • FIBARO Update
    • FIBARO System Update
    • FIBARO Mobile Update
  • FIBARO Community Support
    • Scenes and Interface
    • FIBARO Products
    • FIBARO Mobile
    • FIBARO HomeKit
    • FIBARO Assistant Integrations
    • Other Devices / Third-party devices
    • Tutorials and Guides
    • Home Automation
    • Suggestions
  • FIBARO Społeczność
    • FIBARO
    • Przywitaj się!
    • Off-topic
  • FIBARO Aktualizacja
    • FIBARO System Aktualizacja
    • FIBARO Mobile Aktualizacja
  • FIBARO Wsparcie Społeczności
    • Sceny i Interfejs
    • FIBARO Urządzenia
    • FIBARO Mobilnie
    • FIBARO HomeKit
    • Integracja z Amazon Alexa i Google Home
    • Urządzenia Firm Trzecich
    • Poradniki
    • Automatyka Domowa
    • Sugestie

Categories

  • Scenes
  • Virtual Devices
  • Quick Apps
  • Icons

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Facebook


Google+


Skype


Website URL


WhatsApp


Country


Gateway/s


Interests

Found 11 results

  1. BLE Detector v1.2.zip HC3_iNode_-_BLE_Users_2.0.fqa I recently came up with an idea to keep track of each resident presence with Bluetooth devices they keep taking with them. To achieve that I bought iNode LAN device, which can bring BLE devices into existence in Ethernet network. The idea was not really that... fresh as I thought. Just see here. But I definitely didn't want to use any other pieces of equipment. And this post is about how to get all these things work together (HC2 + iNode LAN) with full source code attached. What you need (except your HC2): iNode LAN - it can detect any Bluetooth 4.0/4.1 device (Bluetooth Low Energy = BLE) BLE tag (iNode Beacon , TrackR , notiOne , etc.) Remarks about the list above: Instead of iNode LAN, you could buy an extended version iNode LAN Duos, but I don't recommend that. Why? The "Duos" version has equipment for both BLE and Bluetooth 2.1 so that you could detect older devices too. But these devices most probably will not be proper for the goal we want to achieve. Bluetooth 2.1 devices have shorter range and drain the battery much more quickly. If we use them for identifying persons we can experience more "flickering" about someone's presence (range issues). Moreover, changing the battery of a small device attached to a bunch of keys every few days or weeks (not months!) would make the solution too hard for maintenance. If we are going to stick to BLE devices, the "non-Duos" version is good enough. Instead of iNode Beacon you can use any device that you can carry with you. The device has to communicate via BLE, that's all. That might be your smartphone as long as you keep your Bluetooth ON all the time. What should you do: Configure your iNode LAN to use unicast or broadcast for sending datagrams (UDP packets) Go to the Setup page. For "BLE IP address" put your HC2 IP address (unicast) or broadcast address (192.168.1.255 e.g.) For "BLE IP port" you may leave the default value (20000). Create a new virtual device (BLE Detector). Update IP Address and TCP Port (use the same values as for iNode LAN in step 1). Create a new scene (BLE Users). Update config values in the scene (provide names and MAC addresses of persons and their belongings). That's all to make it work! Now you can use global variables you have defined in step "2-second-dot" to check if a person is away or home. Want to tweak it? Sure! There are more options. Please read all the comments in the source code. You may try to: define MACs of devices to ignore in discovery (your iNode LAN itself), define signal values for IN/OUT events (separately for each user), define the timeout value for each device (this also makes user away), turn on/off debug messages. What are these scripts missing? Only basic information is decoded from BLE datagrams (counter, MAC address, and signal strength). If you use iNode Sensors you will not get additional values (like temperature, pressure, magnetic or movement changes). Why is it better than other solution (x) of presence detection? It does not depend on any movement in your house, which can make many false positives - a running dog e.g. (x = motion sensors) It is independent of other devices. HC2 communicates directly with iNode LAN. (x = RaspberryPi to read iNode and press some virtual buttons in HC2) More stable results (x = python script from iNode website; explained below). The Python script published by iNode manufacturer for presence detection uses only signal strength. That means to detect that someone is leaving we need to use some (lower part) signal range to have the record of going away. This additionally reduces the signal range for detecting "being home" (higher part of the signal range) and can give effect to the person appearing and disappearing all the time. To avoid that we also check the latest timestamp of the device activity. Owing to this feature we may extend range signal for "being home" to all possible values, and use only timeout to decide whether a person is home or not (set "-100" to both signalIn and signalOut in users config to achieve that). A few more details. Here are some logs of the working device... [DEBUG] 23:29:58: No: 35216 MAC: 00:12:6F:E0:BB:DB Signal: -16 dBm [DEBUG] 23:30:03: No: 35217 MAC: C0:36:A0:DC:87:99 Signal: -79 dBm [DEBUG] 23:30:08: No: 35218 MAC: 00:12:6F:E0:BB:DB Signal: -16 dBm [DEBUG] 23:30:09: No: 35219 MAC: C0:36:A0:DC:87:99 Signal: -79 dBm [DEBUG] 23:30:12: No: 35220 MAC: C0:36:A0:DC:87:99 Signal: -69 dBm and the scene: [DEBUG] 23:30:21: MAC: C0:36:A0:DC:87:99 Signal: -79 (dBm) Time ago: 0 (sec) [DEBUG] 23:30:21: MAC: DF:12:45:F7:40:65 Signal: -84 (dBm) Time ago: 30 (sec) [DEBUG] 23:30:21: Gienia is home [DEBUG] 23:30:21: Zenek is home [DEBUG] 23:30:24: MAC: DF:12:45:F7:40:65 Signal: -84 (dBm) Time ago: 0 (sec) [DEBUG] 23:30:24: MAC: C0:36:A0:DC:87:99 Signal: -79 (dBm) Time ago: 3 (sec) [DEBUG] 23:30:24: Zenek is home [DEBUG] 23:30:24: Gienia is home For my configuration, I am using two pieces of notiOne. They are really tiny, the batteries are supposed to stay alive for about a year. Additionally, you can track them whenever someone with BLE and their App is near. The results I get in my flat, where walls are made of silicate blocks, are quite stable. iNode LAN can detect these notiOnes with the weakest signal (-90 to -88 dBm) from a distance of 7-8 meters even through two silicate walls (24cm + 12cm thick). So placing iNode LAN in the middle of the flat covers the whole area.
  2. Hello, I am trying to build a Lua script that will tell Fibaro if I am working from home, working at home or off work. Here is what I have so far but I need some help to get the scene trigger when either I am at home or at work when all the conditions have been met at the specific times. Does anyone have a similar scene or suggestions? --[[ %% properties %% events %% globals --]] local currentDate = os.date("*t"); local time=os.date('*t'); local ct=os.date('*t'),os.date("%H:%M",os.time()) if (fibaro:countScenes() > 1) then fibaro:abort(); end if ((fibaro:getGlobalValue("AndyPresentstate") == "Home") and (currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6) and ((ct>= "08:30") and (ct<"17:00")) ) then fibaro:setGlobal("Working", "At Home"); fibaro:debug("working at home"); elseif ((fibaro:getGlobalValue("AndyPresentstate") == "Home") and (currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6) and ((ct>= "17:00") or (ct<"08:30"))) then fibaro:setGlobal("Working", "Off Work"); fibaro:debug("off work"); elseif (fibaro:getGlobalValue("AndyPresentstate") == "Away" and (currentDate.wday == 2 or currentDate.wday == 3 or currentDate.wday == 4 or currentDate.wday == 5 or currentDate.wday == 6) and ((ct>= "08:30") and (ct<"17:00")) ) then fibaro:setGlobal("Working", "At Work"); fibaro:debug("Working at Work"); end
  3. Greetings, I see there is a value "atHome" for every user on HC2. Can be changed by API? It looks very promising for alarm functionality.
  4. A smart home should know you have arrived without being told. Arriving on a pitch dark freezing cold November evening in Oslo, Norway loaded with carrier bags and all lights turning on when you approach the door. Wonderful idea. So I dived into HC2 Geofencing. Only to find that a useful position update frequency (5-10 seconds) killed my mobile battery. Started thinking of ways your LAN could tell HC2 that the Master had returned, but found the limits of my network competence. Now enter this clever French guy: https://www.domotique-fibaro.fr/topic/2613-detection-de-présence/ who came upon the idea of checking the presence of the MAC address of your mobile device on your LAN. What he did was simply to make HC2 probe the presence of the mobile MAC address on the LAN ARP table. Frequently probing when not at home, less frequently when at home to ensure quick response when arriving at the door as well as reduce risk of "false departures" when at home. Seemed to work perfectly. The code is nicely written, clearly commented and implementation well explained. A true role model to follow for all the codeaholics out there publishing brilliant code that cannot be implemented or understood outside the immediate congregation. Happy for a while, until I learnt that iPhone has the habit of turning off WiFi after screen closes. Not only is WiFi turned off, but the MAC apparently disappears from the ARP table. My house went into all lights off Absent mode and WAF nosedived....:-( Turned out to be a well known fact and commented on numerous web sites. Here is my workaround: I kept Sebcbien´s presence/absence VDs running in its original form, but made my absence scene manual, with a 15 min delayed setting of a status variable to "Away". My thinking is that pushing a button when actually leaving is no big deal. And good security practise if and when I include a door lock in the system. The arrival scene is however kept automatic and will respond within seconds once you return on the LAN. But you will have to activate the mobile screen to ensure quick WiFi logon and response. Not perfect, but quite good actually. Here are the elements: (1) Sebcbien´s Virtual Device code above, version 2.10 (you might need to activate Google translate from French in the Domotique Forum). This VD code will set a 0/1 Absence/Presence variable. One VD and variable for each family member's mobile MAC address is advisable. You will need to modify in the code (a) The name of your absence/presence variable (b) Your mobile MAC address - to be entered in the VD address field (c) The ID numbering of your icons to be used. Seems I am the only person in the world not knowing that you can easily find this number by right clicking the icon and select "Inspect". Amazingly difficult to find this annoyingly simple procedure. (2) The code has the ability to change the VD icon depending on Absence/Presence. Quite nice and useful. (3) A (manual) "Leave" scene that when activated does the leave job, turns off lights etc and triggers a 15 min delayed second scene that eventually sets a status variable to "Away" once you are well away from your door. I had to set up a second scene, since a variable apparently cannot be set with delay in the block editor. This can probably be solved easily in LUA. (4) An automatic "Arrive" scene that is triggered whenever one of the above mentioned VD variables is set to 1 AND the status variable is "Away". This scene will then turn on lights and devices and set the status variable to "Home". This approach, although not as elegant as I would have liked to see this, will prevent the "Leave" scene from being triggered when iPhone goes to sleep. I would be great to receive improvement proposals or alternative ideas
  5. Hi all, I want to install Philips Hue lightstrip (led tape) under and over mirror and trigger this light basing on presence/absence in bathroom. I can't figure out how to determine: 1) if someone is still in the bathroom (maybe my wife is laying in the bath and relaxing ) 2) if someone came in / came out 3) if another person just opened and closed the door I was trying with variables whit determine if someone is in the bathroom base od motion detector and door sensor but all are mess. I have 2 move detectors and window/door sensor, can anyone help me how to do it in block scene? I don't have access to LUA because I am musing FIBARO LITE I saw some topics about it but no final anwer was given I would be very grateful for your help Kris
  6. Hello to all, I implemented to my HC2: IP Smartphone Presence Check V2.2 (http://www.domotique-fibaro.fr/index.php/topic/2613-detection-de-présence/) including some small changes but I identify one problem with data presentation on PC and on iPhone. Three way to view and three differents view:-( code are very simply: function Label(color, message) if color ~= "" then fibaro:call(selfId, "setProperty", "ui.Message.value", '<font color="'..color..'">'..message..'</font>') else fibaro:call(selfId, "setProperty", "ui.Message.value", message) end end Label ("green", os.date("On %d/%m/%y at %H:%M : ", timeVariable).."WIFI ON.") When I watch for this VD in Device/Advanced I see: When I watch for this VD in list of devices: And when I watch for this VD in mobile I see: Do you know how to apply text formatting "color" for viewing correct on iphone? Or how I code different view for mobile app and PC view? THX Peter
  7. Has anyone successfully implemented beacons into Fibaro? I have been looking around the forums but cannot find a solution that meets my needs. Overview: looking to turn on specific lights in the room depending on the person in the room. Logic: if user_1 walks into room_1 then lights_1 turns on if user_2 walks into room_1 then lights_2 turns on Devices: smartphone, beacons, z-wave lights execution: user_1 has smartphone in pocket. walks into room_1, beacon_1 sees that User_1 is in range, beacon_1 sends command to fibaro to turn on lights_1 Does anyone have any ideas solutions?
  8. Can someone help me. I have been thinking about how the logic would work and cannot come up with the correct Lua code to make this work correctly. Goal: want the door to unlock when I arrive at home and lock when I leave and send a message (push, email etc..) every time. but if I am home/not home I don't want it to keep locking/unlocking and sending me a message *I already have fibaro looking for my phone to see if I'm present. a global variable keeps a number count present =1 not present = 0 so the logic I came up with is like this: Check Present=0 then lock door and send message check present =0 (still not at home) do nothing check present = 1 unlock door and send message check present = 1 (still at home) do nothing etc... let me know if you have questions or suggestions.
  9. Version 1.0.0

    184 downloads

    Want to share my Geolocation and Presence Detector scene i use in my Fibaro setup In wife's and my own smartphone i use both geofency app and wifi presence to check if we are home. A VD runs scheduled and will update a global variable with value "0" or "1" depends if smartphone is active or not. Geofency app is the most reliable and correct app i use myself because the smartphones wifi turns into "sleep" mode often to save battery.. You could of course only run Geofency if you want. Instructions for Geolocation setup https://forum.fibaro.com/index.php?/topic/18383-tutorial-geofency-geo-location-based-fibaro-triggering-ioswindows-pc This scene can be setup and scheduled in Sankotronics "Main scene timebased events" https://forum.fibaro.com/index.php?/topic/23510-scene-main-scene-for-time-based-events-control-v-124/ Settings that can be changed by user: -- USER SETTINGS --------------------------------------------------------- -- "PresentState" is predefined global value that determines if you are at home -- away or on holidays. This variable value is set by other scene or VD. -- Enter name of your global variable between "" or leave as it is local presentState = "PresentState"; local presentStateMapping = {Home="Hemma", Away="Borta", Holiday="Holiday"}; -- GuestState is predefined global variable with possible values: "Yes", "No". local guestState = "GuestState"; local guestStateMapping = {Yes="Yes", No="No"}; -- Geo is predefined global variable with possible values: "1", "0" -- and name of users. This variable value is set by other scene or VD. -- variable example setup: --> "Geo_Jonny_Home" local geoState = "Geo_"; local geoUserMapping = {User1="Jonny", User2="Mona"}; local usegeoState = true; -- Smartphone is predefined global variable with possible values: "1", "0" -- and name of users. This variable value is set by other scene or VD. -- variable example setup: --> "Phone_JL_Present" local wifiState = "Phone_"; local wifiUserMapping = {User1="JL", User2="ML",User3="SL", User4="SW",User5="MW", User6="DD"}; local useWifiState = true; -- Telegram settings local varTelegram = "Telegram"; local useTelegram = true;
  10. amatt

    Guest presence

    Has anyone been able to create a functioning Guest "mode"? I was thinking about making my guest mode do something like the following but is not functioning correctly. everytime a guest is present add 1 to the "guests" variable then everytime a guest is not present minus 1 from the "guests" variable I already have the presence setup with a VD that finds the guests phone via Mac address. the problem is that when it detects that the guest is present it adds 1 to the variable everytime it finds the guests phone (I have it looking every 30min) has anyone found a better solution or can give some advise on how to keep a more accurate track of how many guests are present. Thanks!
  11. Witam jest stworzony przez kolegę z Germani " Boomx " prosty kod aby uzyskać ip i url do Kamerki Netatmo Welcom. A że dzisiaj zainstalowałem Netatmo Presence chciał bym wam ułatwić zadanie z dostępem do Presence. trzeba podmienić poniższy kod w wirtualce dla welkom cam. function oAuth(nextFunction) local request_body = 'grant_type=password&client_id=' .. client_id .. '&client_secret=' .. client_secret .. '&username=' .. username .. '&password=' .. password .. '&scope=read_presence access_presence' dla leniwych cały kod : --[[%% properties%% globals--]] -- DIESE DATEN ANPASSEN wprowadzić swoje dane local client_id = '55xxxxxxxxxxxxxxxxxxxxxx69' local client_secret = 'quoLyxxxxxxxxxxxxxxxxxxxtuRlwnpNPbP5'local username = 'dkonecko@xxxxxxxxx'local password = 'xxxxxxxxxx' local language = 'german' -- german/english -- AB HIER NICHTS MEHR ANPASSEN local token = ''local request_body = '' Debug = function ( color, message ) if (debug == 1) then fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span")) elseif (debug == 0) then endend DebugChange = function ( color, message ) fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span"))end DebugError = function ( color, message ) fibaro:debug(string.format('<%s style="color:%s;">%s', "span", color, message, "span"))end fibaro:debug('netatmo welcome cam finder v1.0b') if (language == 'german' or language == 'english') then DebugError( "green", "Debug: " ..language)else DebugError( "red", "Please choose a language for debug") fibaro:abort();end local sourceTrigger = fibaro:getSourceTrigger(); function oAuth(nextFunction) local request_body = 'grant_type=password&client_id=' .. client_id .. '&client_secret=' .. client_secret .. '&username=' .. username .. '&password=' .. password .. '&scope=read_presence access_presence' getResponseData('https://api.netatmo.net/oauth2/token', request_body, function(data) if (data.access_token ~= nil) then token = data.access_token gethomedata() else if (language == 'german') then DebugError( "red", "oAuth-API-Call konnte nicht durchgeführt werden! oAuth 2.0 lieferte keinen Wert zurück") elseif (language == 'english') then DebugError( "red", "oAuth-API-Call Error. oAuth 2.0 returns nothing.") end end end )end function getResponseData(url, body, func) local http = net.HTTPClient() http:request(url, { options = { method = 'POST', headers = { ['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8' }, data = body }, success = function(response) func(json.decode(response.data)) end }) end function gethomedata() request_body_cam = 'access_token=' ..token.. '' getResponseData('https://api.netatmo.net/api/gethomedata', request_body_cam, function(getData) --fibaro:debug(request_body_cam) if (getData.body ~= nil) then if (language == 'german') then DebugError( "green", "API-Call durchgeführt.") elseif (language == 'english') then DebugError( "green", "API-Call was done.") end for w, v in pairs(getData.body.homes) do for a, b in pairs(v.cameras) do if (b.is_local) then if (language == 'german') then DebugError( "green", "Lokale IP der Kamera gefunden.") elseif (language == 'english') then DebugError( "green", "Local IP of cam was found.") end findLocalPresence(b.vpn_url) else if (language == 'german') then DebugError( "green", "Lokale IP der Kamera NICHT gefunden.") elseif (language == 'english') then DebugError( "green", "Local cam NOT found.") end end end end else if (language == 'german') then DebugError( "red", "API-Call fehlgeschlagen") elseif (language == 'english') then DebugError( "red", "API-Call Error") end end end )end function findLocalPresence(url)local selfhttp = net.HTTPClient({timeout=2000})url = url..'/command/ping'selfhttp:request(url, { options={ headers = selfhttp.controlHeaders, method = 'GET', timeout = 5000 }, success = function(status) if status.status == 200 then if status.data ~= nil then --print(json.decode(status.data)) for k,v in pairs(json.decode(status.data)) do if (k == 'local_url') then local cam_url = v local url_new = string.sub(cam_url, 8, #cam_url) one, two = url_new:match("([^,]+)/([^,]+)") fibaro:debug('Cam-IP: '..one) fibaro:debug('JPG-Stream: /'..two.. '/live/snapshot_720.jpg') DebugError( "green", "coded 4 siio.de/siio.com") end end end else print ("failed") print(status.data) end end, error = function(error) print "ERROR" print(error) end}) end oAuth() dane uzyskane w wirtualce jak IP I url do obrazu kopiujemy do zakładki kamera bez użytkownika i hasła. miłej zabawy.
×
×
  • Create New...