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


Tiny QuickApp Emulator (TQAE)


jgab

Recommended Posts

8 minutes ago, jgab said:

Yes, it's a bit tricky how to match

Think about the device name you configure iosLocator to be a pattern that should match the real device name.

"iPhone Jan"

matches

"iPhone Jan" and "iPhone Jan (2)"

 

Because it's a pattern it needs to conform to pattern rules. A pattern with just a ")" like in ";)" is malformed because "()" is used for pattern captures.

You could specify your device as "Siljes %:%)" and it would match "Siljes :)". That is because % escapes pattern directives like the ")"

It's the same rules as for

Please login or register to see this link.

 

Would that work for you?

Yes - that worked :-) am grateful as always

8 minutes ago, jgab said:

Yes, it's a bit tricky how to match

Think about the device name you configure iosLocator to be a pattern that should match the real device name.

"iPhone Jan"

matches

"iPhone Jan" and "iPhone Jan (2)"

 

Because it's a pattern it needs to conform to pattern rules. A pattern with just a ")" like in ";)" is malformed because "()" is used for pattern captures.

You could specify your device as "Siljes %:%)" and it would match "Siljes :)". That is because % escapes pattern directives like the ")"

It's the same rules as for

Please login or register to see this link.

 

Would that work for you?

do you have a way like this, to get GEO Position from Android devices? - my son is not an AppleFanboy ;-)

Edited by ChristianSogaard
P
Link to comment
Share on other sites

  • Topic Author
  • 32 minutes ago, ChristianSogaard said:

    Yes - that worked :-) am grateful as always

    do you have a way like this, to get GEO Position from Android devices? - my son is not an AppleFanboy ;-)

    No, and mainly because I don't have any Android devices.

    But as I understand it, it should be possible. Maybe someone with Android devices can develop it?

    Link to comment
    Share on other sites

    31 minutes ago, jgab said:

    No, and mainly because I don't have any Android devices.

    But as I understand it, it should be possible. Maybe someone with Android devices can develop it?

    I will go for the Android position from the Yubii app first - is there a way i can merge that location into IOSLoctor?

    Link to comment
    Share on other sites

  • Topic Author
  • IosLocator post the same triggers as Fibaro's own apps

     post({type='location',id=d.userId,property=d.locationId,value=d.geofenceAction,timestamp=d.timestamp})

    and use the same locations as defined in the panel.

    So it should behave just like another source of position data.

    ...Scenes should be able to trigger on location events from iosLocator

    • Like 1
    Link to comment
    Share on other sites

    1 hour ago, jgab said:

    IosLocator post the same triggers as Fibaro's own apps

     post({type='location',id=d.userId,property=d.locationId,value=d.geofenceAction,timestamp=d.timestamp})

    and use the same locations as defined in the panel.

    So it should behave just like another source of position data.

    ...Scenes should be able to trigger on location events from iosLocator

    i see :-) But i like that the IOSLocator QA creates global variable IOSHome shows status like - all_home.

    I was wondering if you can create an IOSLocator update for Yubii APP locations, that i can be used for Android????

    i think... 

    {source=local, name='Marius_Nielsen',   id = 949, device='iPhone', home=false, icloud="XXXX1"},

    so if "source=local" it uses the local information from the APP

    Or something like that  :-)   

    2022-01-09_20-13-26.png.559c5f1ac820e293c6a49d5e6a30727f.png

     

    Link to comment
    Share on other sites

    • 3 weeks later...
    On 10/29/2021 at 10:36 AM, jgab said:

    This  one  I use

    Please login or register to see this attachment.

    Hi @jgab

     

    I have used you IOSLocator for half a year ish - it's very accurate and simple to use.

    I have a wish for next version - i am using 0.2.

     

    Usecase

    We have 3 iPhones on the family and one Android - the IOSLocator works perfect with Iphones, but not for the One Plus.

    The One Plus is detected by an ARP request like api.post("/networkDiscovery/arp" and have a Child sensor - not as accurate as your IOSLocator but it works

     

    Wish ?.

    I would love each iPhone to have a Child presence sensor

    Please login or register to see this image.

    /monthly_2022_03/2022-03-12_14-04-42.png.e3391148ac26c5808d4441a1629b05e1.png" />

    In that way it's  easier to merge presence from both iPhone and Android for other actions.

     

    what do you think?

     

     

    Link to comment
    Share on other sites

    On 3/12/2022 at 2:12 PM, ChristianSogaard said:

    Hi @jgab

     

    I have used you IOSLocator for half a year ish - it's very accurate and simple to use.

    I have a wish for next version - i am using 0.2.

     

    Usecase

    We have 3 iPhones on the family and one Android - the IOSLocator works perfect with Iphones, but not for the One Plus.

    The One Plus is detected by an ARP request like api.post("/networkDiscovery/arp" and have a Child sensor - not as accurate as your IOSLocator but it works

     

    Wish ?.

    I would love each iPhone to have a Child presence sensor

    Please login or register to see this link.

    In that way it's  easier to merge presence from both iPhone and Android for other actions.

     

    what do you think?

     

     

     

     

    Hi @jgab

     

    I have some struggle solving this myself and I hope you can spread some of your magic here..

    Using your HUE examples 

    Please login or register to see this link.

    I can successful create the sub childs when having a list like

    MyGEODevices = { [3] = 'Simba',[2] = 'Marius', [1] = 'Christian' }

    but the format provided in IOSLocator is

    local USERS = { 
    {name='admin', id = 2,  device='XXXX', home=true, icloud={user='[email protected]', pwd='XXX'}},
    {name='Simba', id = 3,  device='XXXX)', home=true, icloud={user='[email protected]', pwd='XXX'}},
    {name='Nala', id = 4,  device='XXXX', home=true, icloud={user='[email protected]', pwd='XXX'}},
    }

     

    Second ...

    Where in the IOSLocator would be the right place to update the status of the Childs?

    I was looking at the "local function checkAllAtHome()"  section of IOSLocator to update each child if home or away?

     

    Best

    Christian

     

     

     

     

    Link to comment
    Share on other sites

  • Topic Author
  • On 4/18/2022 at 11:04 AM, ChristianSogaard said:

     

     

    Hi @jgab

     

    I have some struggle solving this myself and I hope you can spread some of your magic here..

    Using your HUE examples 

    Please login or register to see this link.

    I can successful create the sub childs when having a list like

    MyGEODevices = { [3] = 'Simba',[2] = 'Marius', [1] = 'Christian' }

    but the format provided in IOSLocator is

    local USERS = { 
    {name='admin', id = 2,  device='XXXX', home=true, icloud={user='[email protected]', pwd='XXX'}},
    {name='Simba', id = 3,  device='XXXX)', home=true, icloud={user='[email protected]', pwd='XXX'}},
    {name='Nala', id = 4,  device='XXXX', home=true, icloud={user='[email protected]', pwd='XXX'}},
    }

     

    Second ...

    Where in the IOSLocator would be the right place to update the status of the Childs?

    I was looking at the "local function checkAllAtHome()"  section of IOSLocator to update each child if home or away?

     

    My suggestion would be to make a separate QA that creates a child device for each user and then get the data provided by iOSLocator to update their status. This way you could also let the QA react on other "stimuli" to set the presence of people.

    • Thanks 1
    Link to comment
    Share on other sites

    • 4 weeks later...
    On 4/20/2022 at 4:29 PM, jgab said:

     

    My suggestion would be to make a separate QA that creates a child device for each user and then get the data provided by iOSLocator to update their status. This way you could also let the QA react on other "stimuli" to set the presence of people.

    Hi @jgab

     

    I am using the iOSLocator, and could see you are storing each user i a Global Variable,

    Rule 1+2 are working

    But 3,4 seems to trigger but the output format is wrong - can you explain why, and show the syntax?

    The error is

    ./include/EventRunner.lua:1953: ./include/EventRunner.lua:1820: bad deviceID 'nil' for '%prop' '"SiljeLoc"?'

    1 rule("$adminLoc =='HC3-XXXXXX'=> log('Dad is home')")
    2 rule("$adminLoc =='Away' => log('Dad has left the building')")

    3 rule("$SiljeLoc => log('SiljeLoc:%s',SiljeLoc:value)")

    4 rule("$iOSHome => log('iOSHome:%s',iOSHome:value)")

     

    global-variable is selected in the self:enableTriggerType

    self:enableTriggerType({"global-variable","custom-event","alarm"})

    Edited by ChristianSogaard
    P
    Link to comment
    Share on other sites

    Hello @jgab,

    Just one question, I use your very good TQAE quick app emulator with ZeroBrane to try to develop a QA for my swimming pool HVAC.

    IT is base on Http call and it works great on my PC with TQAE.

    Here is the code.

    Please login or register to see this code.

    Here is the return on the emulator

    Please login or register to see this code.

    But the same code on Fibaro HC3 produce the "end of file error"

    Please login or register to see this code.

     

    When I try the code using fiddler, I get the following warning/error.

    Please login or register to see this code.

     

    Do you have any Idea on how to circumvent the "end of file" error I have on the HC3 ?

    Link to comment
    Share on other sites

  • Topic Author
  • It seems like the HC3 is a bit strict and unforgiving (I though I was using the same http library as the HC3 but it may be a different version).

    You could experiment with different accept headers and content types headers

    ["Accept"] = "*/*"

    ["Content-Type"] =  "application/json"

     

    If you don't get this to work, I would suggest that you roll your own http request using net.TCPSocket.

     

    On the socket write

    "GET /askOnOff.cgi HTTP/1.1\nAccept: */*\n\n"

    and then read the reponse and parse it accordingly
     

     

     

    Edited by jgab
    Link to comment
    Share on other sites

  • Topic Author
  • It turns out that net.TCPSocket in TQAE is a bit buggy - will try to fix.

    On the HC3 one can do something like this to do your own simple and more forgiving http get

    Please login or register to see this code.

     

    Edited by jgab
    Link to comment
    Share on other sites

  • Topic Author
  • Ok, pushed TQAE v0.56 with a fix for TCPSocket so it can run the same code as above (that works with HC3)

     

    TQAE's version of readUntil still needs a fix but I know how to do it....

    Edited by jgab
    • Thanks 1
    Link to comment
    Share on other sites

    Thank you jgab, I'll try this out as soon as I can?

     

    Amazing, doing my own http handler based on you recommendation works ;-)

    Thank you so much !
     

    Edited by chelson
    Update on the status
    Link to comment
    Share on other sites

  • Topic Author
  • 22 hours ago, chelson said:

    Thank you jgab, I'll try this out as soon as I can?

     

    I updated the example, a bit smaller code. Note also that you need to set copas=true flag in the TQAE header for the tcp example to work.

    Link to comment
    Share on other sites

    On 5/14/2022 at 1:47 PM, ChristianSogaard said:

    Hi @jgab

     

    I am using the iOSLocator, and could see you are storing each user i a Global Variable,

    Rule 1+2 are working

    But 3,4 seems to trigger but the output format is wrong - can you explain why, and show the syntax?

    The error is

    ./include/EventRunner.lua:1953: ./include/EventRunner.lua:1820: bad deviceID 'nil' for '%prop' '"SiljeLoc"?'

    1 rule("$adminLoc =='HC3-XXXXXX'=> log('Dad is home')")
    2 rule("$adminLoc =='Away' => log('Dad has left the building')")

    3 rule("$SiljeLoc => log('SiljeLoc:%s',SiljeLoc:value)")

    4 rule("$iOSHome => log('iOSHome:%s',iOSHome:value)")

     

    global-variable is selected in the self:enableTriggerType

    self:enableTriggerType({"global-variable","custom-event","alarm"})

    Hi Jan

     

    Is there a way I can make iOSLocator trigger in a smaller area - today it triggers when everyone is within about 1000 m

     

    Best Regards

    Christian

    Edited by ChristianSogaard
    P
    Link to comment
    Share on other sites

  • Topic Author
  • iOSLocator uses the locations that you have setup on the HC3 (general->location) and the locations defined has a radius parameter.

    Link to comment
    Share on other sites

  • Topic Author
  • On 5/14/2022 at 1:47 PM, ChristianSogaard said:

    Hi @jgab

     

    I am using the iOSLocator, and could see you are storing each user i a Global Variable,

    Rule 1+2 are working

    But 3,4 seems to trigger but the output format is wrong - can you explain why, and show the syntax?

     

    Please login or register to see this code.

     

    Link to comment
    Share on other sites

    • 4 weeks later...

    Hi here,

     

    I'm trying to trap / get the datafrom a device that regularly send UDP broadcast to 255.255.255.255 on port 1031.

    See wireshark capture sample...

    Please login or register to see this image.

    /monthly_2022_06/image.png.806e06c80926335188bc8a66f70b9fc5.png" />

     

    There is no need to send a packet to start the UDP broadcast, it starts as soon as the device is online.

     

    I do not find my way on how to do it or even if it is possible to do it with net.UDPSocket function on HC3

     

    Any idea if possible and if yes, how to ?

    Many thanks

    Link to comment
    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...