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


Recommended Posts

Posted
6 minutes ago, Łukasz997 said:

For 0.44$ per day per user you can get the position of any phone in "family" service called life360...

 

If we do agree to this, the complications only begin. Next we would have to set up an intermediate integration service - our own kind of "translator" between the world of phones and the world of HC3. It would expose an HTTP server, and HC3 would fetch the position from it. Quite a lot of work, and that service would also need to be hosted somewhere. All in all - a good idea for a commercial solution for Fibaro HC3.

*

I absolutely agree with you - Fibaro should know the position (and also the tax office).

 

Well then, perhaps we should once again gather signatures for the idea that - since Yubii already knows the position and all this work has already been done by Fibaro - why not simply expose the users locations in the controller?
The issue of security? Sometimes I have the impression that this term in today world is a rather grim joke...

I just managed to make tasker send the location to a QA with my phones lat/longitude :D
With your script it gives me distance between the location of my house and my phone :)

The tasker app sends the location every 2min or when entering/leaving 30m, 300m or 2km.
image.png.9ac53b826f03f24baa98163248c4f09e.png

  • Like 1
Posted (edited)
4 godziny temu, Brors94 napisał:

I just managed to make tasker send the location to a QA with my phones lat/longitude :D
With your script it gives me distance between the location of my house and my phone :)

The tasker app sends the location every 2min or when entering/leaving 30m, 300m or 2km.

Excellent idea!

I decided to check - since it can be done in Tasker, maybe it can also be done in Shortcuts on the iPhone.
And it can: you can read the geographic location and call a specific function in a specific QuickApp with the retrieved latitude and longitude.

It's a very tedious task, but still far better than setting up a mid-point.

 

Of course there is one condition - user must be inside the local network, via VPN.

 

But there's a limitation: I can't make it send every n minutes in shortcuts. Maybe someone knows how to do it?

 

Edited by Łukasz997
Posted
58 minutes ago, Łukasz997 said:

Excellent idea!

I decided to check - since it can be done in Tasker, maybe it can also be done in Shortcuts on the iPhone.
And it can: you can read the geographic location and call a specific function in a specific QuickApp with the retrieved latitude and longitude.

It's a very tedious task, but still far better than setting up a mid-point.

 

Of course there is one condition - user must be inside the local network, via VPN.

 

But there's a limitation: I can't make it send every n minutes in shortcuts. Maybe someone knows how to do it?

 

Seems like IOS dont have an app like tasker for android. But AI gave me some hints like OwnTracks can do api/http calls with location update 🤔

But the looping is a problem on ios it seems like 😮 Daily loops is the limit it seems like 😅

  • Topic Author
  • Posted
    17 hours ago, Sankotronic said:

    Hi @Łukasz997,

     

    thanks for distance calculation on Earth. On the other hand I was asking for calculating distance between home and me :-) 

    There  is such function on HC2, so I was hoping that there is something similar on HC3.

     

    Still, if there is a way to send location of my mobile phone to HC3 then it can be done.

     

     

     

    Posted
    1 hour ago, jgab said:

     

     

     

    Hi @jgab,

     

    above solution does not work since hub.getValue(userID,"Location") returns nil.

    Scenes with trigger on geolocation also does not work. I have turned on location services for Yubii Home app and I never get this scene run on trigger and send me a picture from my camera. I tested scene manually and then I get camera picture so that works OK.

     

    It seems that Fibro with HC3 made step back with geofencing, even it was never working properly on HC2 too.

     

    If this webhook that presses button on quick app:

    Please login or register to see this code.

    can be modified to actually do call to the quick app with parameters (something like):

    Please login or register to see this code.

     

    If anyone know if that is possible and willing to share here would be really nice.

     

    Hi @m.roszak, maybe you can help with this one?

    Posted (edited)
    1 hour ago, Sankotronic said:

     

    Hi @jgab,

     

    above solution does not work since hub.getValue(userID,"Location") returns nil.

    Scenes with trigger on geolocation also does not work. I have turned on location services for Yubii Home app and I never get this scene run on trigger and send me a picture from my camera. I tested scene manually and then I get camera picture so that works OK.

     

    It seems that Fibro with HC3 made step back with geofencing, even it was never working properly on HC2 too.

     

    If this webhook that presses button on quick app:

    Please login or register to see this code.

    can be modified to actually do call to the quick app with parameters (something like):

    Please login or register to see this code.

     

    If anyone know if that is possible and willing to share here would be really nice.

     

    Hi @m.roszak, maybe you can help with this one?



    url: 'http://Username:Password@HC3IP/api/callAction?deviceID=214&name=location

    my tasker app sends a json payload like this:

    Please login or register to see this attachment.



    In the qa:
     

    Please login or register to see this code.


    lat2 and lon2 is created on startup from the hc3 loaction :D

    If I understand your question right then? 😅

    Edited by Brors94
  • Topic Author
  • Posted
    1 hour ago, Sankotronic said:

     

    Hi @jgab,

     

    above solution does not work since hub.getValue(userID,"Location") returns nil.

    Scenes with trigger on geolocation also does not work. I have turned on location services for Yubii Home app and I never get this scene run on trigger and send me a picture from my camera. I tested scene manually and then I get camera picture so that works OK.

     

    It seems that Fibro with HC3 made step back with geofencing, even it was never working properly on HC2 too.

     

    If this webhook that presses button on quick app:

    Please login or register to see this code.

    can be modified to actually do call to the quick app with parameters (something like):

    Please login or register to see this code.

     

    If anyone know if that is possible and willing to share here would be really nice.

     

    Hi @m.roszak, maybe you can help with this one?

     

    I think the api to get location is 

    Please login or register to see this code.

    however, it doesn't seem to be implemented/exposed. May be some "privacy" policy.

    The way I do it is that I monitor the location events as I will get the userID and location from that.
    If I get location data from an external service I convert it to events in HC3 format - find out what HC3 defined location the lat/long corresponds to.
    These means that I only deal with HC3 defined locations and if user enters/leave those.

     

    If I only use Fibaro location, the location of the user is typically unknown until I receive the first events after QA start - as there is no way to get the user's current position due to /panels/family not working.
    If I get location data from an external service this is not a problem as events are usually polled regularly...

    Posted
    18 minutes ago, Brors94 said:

    If I understand your question right then? 😅

     

    Hi @Brors94, yes that is something I asked for, but for iPhone. I will test possible calls with Postman and see if there is a way.

     

    9 minutes ago, jgab said:

    I think the api to get location is 

    Please login or register to see this code.

    however, it doesn't seem to be implemented/exposed. May be some "privacy" policy.

     

    Hi @jgab,

     

    yes, I know this panel, but as you also noticed it is not implemented or finished yet.

    I do hope that @m.roszak will give us some information regarding this panel soon.

     

    In the end, I do not really need user location and distance, but I feel that is nice to have, as it was implemented on HC2.

    For me Geofency app with leave and enter webhooks work just fine and reliable on HC2 and I also tested it on HC3.

     

    I was just hoping that Fibaro native geofencing will finally get working as expected on new gateways, specially as it is advertised as key feature.

     

    • Like 1
    Posted
    7 minutes ago, Sankotronic said:

     

    Hi @Brors94, yes that is something I asked for, but for iPhone. I will test possible calls with Postman and see if there is a way.

     

     

    Hi @jgab,

     

    yes, I know this panel, but as you also noticed it is not implemented or finished yet.

    I do hope that @m.roszak will give us some information regarding this panel soon.

     

    In the end, I do not really need user location and distance, but I feel that is nice to have, as it was implemented on HC2.

    For me Geofency app with leave and enter webhooks work just fine and reliable on HC2 and I also tested it on HC3.

     

    I was just hoping that Fibaro native geofencing will finally get working as expected on new gateways, specially as it is advertised as key feature.

     

    Yea, this advertisement made look twice 😅

    Please login or register to see this image.

    Posted (edited)
    1 hour ago, jgab said:

     

    I think the api to get location is 

    Please login or register to see this code.

    however, it doesn't seem to be implemented/exposed. May be some "privacy" policy.

    The way I do it is that I monitor the location events as I will get the userID and location from that.
    If I get location data from an external service I convert it to events in HC3 format - find out what HC3 defined location the lat/long corresponds to.
    These means that I only deal with HC3 defined locations and if user enters/leave those.

     

    If I only use Fibaro location, the location of the user is typically unknown until I receive the first events after QA start - as there is no way to get the user's current position due to /panels/family not working.
    If I get location data from an external service this is not a problem as events are usually polled regularly...


    So a setup of the eventlib like this:
     

      Event.id='_'                            -- Identity of our event handler 'id1'
      Event{type='location'}
      function Event:handler(event)             -- The handler called when event(s) of above types are received
     
        event_info = json.encode(event)
        self:debug("Event: ",json.encode(event))
        store_info()
      end

    Would trigger on all location events? 🤔
    the store_info() just take the event_info and store it in the internal storage of the QA. 
    So i can do a test button to print it later and also have it after a restart of the QA :D

     

    Edited by Brors94
    Posted (edited)

    I'm lost how to help you @Sankotronic.

    Maybe you need this.

     

    How to send current position on iphone without any external service.

     

    1. Make a script in a Shortcut app like this:

    Please login or register to see this attachment.

     

     

    API call needs of course proper device number (later about it)

     

    "Get contents of..." needs an authorization:

    Add a header, then add a key named Authorisation with value Basic, then space, then base64 encoded exactly in this form user:password

    Like this:

    Authorization Basic JpcmQ6SmF0b0Rvb3JXNjVfCg

     

    Attention: doing on the OSX console "print user:password | base64" will not work, probably because of padding.

    This works: 

    Please login or register to see this link.

     

    2. On the HC3 you create QA (it's number have to be included in api call)

    Please login or register to see this code.

     

    This works for sure.

    Please login or register to see this attachment.

     

    Also I have found how to loop it every n seconds.

     

    Edited by Łukasz997
    • Thanks 1
  • Topic Author
  • Posted

    If you get location data from an external source, I recommend that you post it as a geofenceEvent

    Please login or register to see this code.

    That way people that write scenes can also trigger on the event,

    ...and people that use refreshStates (like eventLib) can trigger on location soiurceTrigger in their QA...

    However, it requires (as described in earlier post) that one keep track of if the long/lat enters or exits a HC3 defined location to set the right geofenceAction.

    • Like 1
    Posted
    On 3/7/2026 at 4:14 PM, Sankotronic said:

     

    For Fibaro geofencing to work HC3 must receive location of the mobile phone if location services are enabled for Yubii app, true?

    It is just that Fibaro didn't provide users that information and function to check it in LUA code on new gateways.

     

    Don't know if that is due to security reasons, but maybe @m.roszak can share some information? 

    Geolocalisation works like that.
    In Geofencing we are registering the point and radius in the phone services and we get the event about entering/leaving the area - we are not getting actual location points.

    Posted

    Hi @m.roszak,

     

    so if I understood correctly, distance from home is calculated on mobile phone and only event is sent to gateway when phone leaving/enters specified radius?

    This should be sufficient, but besides explained trigger for this events in the scenes is there some native Fibaro code for receiving this events in quick apps?

     

    I mean, @jgab EventLib provides a means for this, but it would be nice to have Fibaro version of LUA code.

    Posted

    So, event on refreshState looks like that:

     

    Please login or register to see this code.



    Generating an event on the API can be done by:

    POST method with:
     

    Please login or register to see this code.



    Attatching also a QuicApp which generates those events :)

    Please login or register to see this attachment.

    • Thanks 1
    Posted

    More sophisticated QA for testing this in attachment ;)

    Please login or register to see this attachment.

    • Like 3
  • Topic Author
  • Posted

    Ok, started a new forum thread about integrating other location service to the HC3

     

    • Like 1
    • 2 weeks later...
  • Topic Author
  • Posted

    The previous post from @jakabaesj8 is spam - I have never talked about the service advertised...

    • Like 1
    • 1 month later...
    Posted

    Hello @jgab,

     

    Is this correct to activate geofencing events for e.g. 4 devices:

    Please login or register to see this code.

     

    I need some help with example since I could not find any in this thread and in provided documentation.

    Note that in your library v0.52 is this:

    Please login or register to see this code.

     

    and in documentation is this:

    Please login or register to see this code.

     

    so, which is correct? Is 'value' optional so that all events are received, or must define it with 'enter' or 'exit' or is possible {"enter","exit"}?

     

    Yes, I know I can test and play with it till I get what I need... ;-) 

  • Topic Author
  • Posted
    11 minutes ago, Sankotronic said:

    Hello @jgab,

     

    Is this correct to activate geofencing events for e.g. 4 devices:

    Please login or register to see this code.

     

    I need some help with example since I could not find any in this thread and in provided documentation.

    Note that in your library v0.52 is this:

    Please login or register to see this code.

     

    and in documentation is this:

    Please login or register to see this code.

     

    so, which is correct? Is 'value' optional so that all events are received, or must define it with 'enter' or 'exit' or is possible {"enter","exit"}?

     

    Yes, I know I can test and play with it till I get what I need... ;-) 

    The format is {type='location',id=<userId>,property=<locationId>,value=<enter/leave>,timestamp=<number>}
    To provide a list of ids is a patch for events of type 'device'. Don't work for type 'location'
    Either add an event handler per user or  add a transformer for it

    Please login or register to see this code.

     

    If no value is provided in the event pattern it will match both "leave" and "enter"

    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...