Jump to content

Recommended Posts

Posted (edited)

image.png.a16cba642eb6dca1e2a4f84f99d758c2.png

 

image.png.976a63ce14bb5e3042b881c877a1d3db.png

 

 

so,. now you can trigger event if nobody at home.

 

V2

 

{
    type = "custom-event",
    property = "unifi_presence",
    operator = "==",
    isTrigger = true
}
 
print(json.encode(sourceTrigger))
print(fibaro.getValue(1842"userDescription"))
 

 

V3

 

username / password

 

V4

 

V5 - improvements

 

 

 

Unifi_presence (V5).fqa

Edited by 10der
  • Like 2
Link to post
Share on other sites

almost, getting after each init 401 (probably set Cookie)

image.png.c8c4475e663b2e2a1cbd42e4a3e7b5cc.png

 

but it works second later

image.png.47db766da31e75d74819a526bca3732b.png

 

On HC2 i was using modified solution from Lazar, measured Signal strenght and availibility of smart watch, iPhone and Laptop (to reduce/avoid issues with empty battery on one device = Alarm set and siren activated just after i moved a bit in my bed …)

Link to post
Share on other sites

Seems to work fine but how can I do if I want to run a scene if person 1 comes home and person 2 is gone ?. (I'm still pretty new at LUA so I ask to learn)

Link to post
Share on other sites

@Freddan67 fixed

 

[19.05.2020] [10:01:11] [DEBUG] [SCENE30]: {"Oleg":{"state":true,"oldState":false}}

 

DECLARATIONS (Conditions/Triggers)

{
    type = "custom-event",
    property = "unifi_presence",
    operator = "==",
    isTrigger = true
}
 
ACTIONS
print(json.encode(sourceTrigger))
print(fibaro.getValue(1842"userDescription"))
 
 
QA updated.
 

 

 

Link to post
Share on other sites
25 minutes ago, 10der said:

@Freddan67 fixed

 

[19.05.2020] [10:01:11] [DEBUG] [SCENE30]: {"Oleg":{"state":true,"oldState":false}}

 

DECLARATIONS (Conditions/Triggers)

{
    type = "custom-event",
    property = "unifi_presence",
    operator = "==",
    isTrigger = true
}
 
ACTIONS
print(json.encode(sourceTrigger))
print(fibaro.getValue(1842"userDescription"))
 
 
QA updated.
 

 

 

Thanks. I'll try when I get home if I understand :)

Link to post
Share on other sites
local events = json.decode(fibaro.getValue(fibaro.getDevicesID({name="Unifi presence"})[1], "userDescription"))
local msg = ""
for k, v in pairs(events) do
    msg = msg .. k .. " now is " .. tostring(v.state) .. "\r\n"
end
fibaro.alert('push', {2}, msg)

image.png.0004fc0484eaea2690abb88f5226c7fd.png

  • Like 1
Link to post
Share on other sites
12 minutes ago, 10der said:
local events = json.decode(fibaro.getValue(fibaro.getDevicesID({name="Unifi presence"})[1], "userDescription"))
local msg = ""
for k, v in pairs(events) do
    msg = msg .. k .. " now is " .. tostring(v.state) .. "\r\n"
end
fibaro.alert('push', {2}, msg)

image.png.0004fc0484eaea2690abb88f5226c7fd.png

Thanks @10der. I want to start sonos in the kitchen when I come home and my wife is not home so now it will be fun to try to get it together.

Link to post
Share on other sites
  • 2 months later...
On 5/18/2020 at 9:43 PM, tinman said:

almost, getting after each init 401 (probably set Cookie)

image.png.c8c4475e663b2e2a1cbd42e4a3e7b5cc.png

 

 

 

 

 

I got the same issue, keeps saying Login OK and Wrong status in the debug screen. Restarted the Unifi Controller and Homecenter 3, but doesn't help.

Link to post
Share on other sites
Posted (edited)

btw 401 always will be here... when token is expire or missing.

OK - said what token now OK and all went OK

Edited by 10der
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...