This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

Setup Homey with MQTT for location detection

15681011

Comments

  • @MennoVanGrinsven
    No problem, i can make a cli install also tonight at home.

    Tnx
  • edited April 2017
    viktor said:
    @MennoVanGrinsven
    No problem, i can make a cli install also tonight at home.

    Tnx

    Can you check if you have sharing enabled in your fence definitions? 
    If that is not enabled, the name of the fence will not be included. In the message. 

    From your log:
    '{"_type":"transition","tid":"or","acc":82.5,"event":"enter","lat":47.xxx,"lon":8.xxx,"tst":xxx,"wtst":1491827105,"t":"c"}'

    I am missing the "desc" field. That includes the name of the fence and is needed to match the trigger card. 
  • Indeed, the BHZ Region was not shared. Now is triggering. Tnx.
  • PimBliekPimBliek Member
    edited April 2017
    I have everything set up but the events do not trigger the flow....

    This packet is sent with Owntracks to the broker:

    {"_type":"transition","tid":"pb","acc":50.22695,"desc":"home","event":"leave","lat":XXX,"lon":YYY,"tst":1491844872,"wtst":1491596181,"t":"c"}

    I have double-double checked the channelname (/owntracks/<user>/<name>/event

    Nothing happens...

    What am I missing here?


    EDIT:

    Found it! I had set accuracy in settings in the Homey to 50... that's too low. Setting it back to 250 solved it.


  • PimBliek said:
    I have everything set up but the events do not trigger the flow....

    This packet is sent with Owntracks to the broker:

    {"_type":"transition","tid":"pb","acc":50.22695,"desc":"home","event":"leave","lat":XXX,"lon":YYY,"tst":1491844872,"wtst":1491596181,"t":"c"}

    I have double-double checked the channelname (/owntracks/<user>/<name>/event

    Nothing happens...

    What am I missing here?


    I assume that <user> and <name> are replaced by the actual values? 

    The / before owntracks should be removed. Or use a topic like owntracks/+/+/event

    Then it will trigger for all users and devices. 

  • MennoVanGrinsven said:
    I assume that <user> and <name> are replaced by the actual values? 

    The / before owntracks should be removed. Or use a topic like owntracks/+/+/event

    Then it will trigger for all users and devices. 

    Yes and yes you are right, without the trailing /.

  • Currently there is a new version in the beta channel. The owntracks app has been redesigned internally and the following functional changes have been added:
    - owntracks/#  topic is added by default. 
    - Voice capability added (NL / EN). You can ask "Wat is de locatie van xxx"  or "Waar is xxx"  and homey will tell you the geoFence that person is in.


  • Anyone tested beacons already on Android? 
    Yes just tested. It works but after configuring your first beacon you need to reboot your phone before it starts working, see:
    https://community.home-assistant.io/t/android-owntracks-and-ibeacons-ibeacons-not-seen-by-owntracks/9756/4

    Also my iBeacon (ByteReal) has 3 transmit power settings. Unfortunately even if I set the tx to the low setting it is still too high for close proximity detection (I want to open the front door when I'm max 3 meters away). It sees the beacon in the whole 90m2 apartment.
    That's why I just switched to an android phone so I can test if NFC will do what I want (iPhone doesn't have NFC available).
  • TallguyTallguy Member

    Is Owntracks also useable in a 'current location' flow? I mean...just like the Presence detection had the ability to use cards like "if some is at home..."

    Since Owntracks works so much better than any presence detection I've tried, I'd like to use this in situations where flows will only run when I'm nog at home.

  • edited June 2017
    WARNING 
    Do not update to the latest mosquitto broker if you depend on the correct working of the owntracks app. Mosquitto has patched a security issue and as a result the mosquitto broker thinks the owntracks app on your phone is a malicious client. 

    The owntracks app on your phone uses your username and devicename as client ID to connect to the broker as username/devicename. The security patch detects client id's with a #, + or / in it as malicious. 

    The people at owntracks are aware of the problem and they will publish an update in a few days. 

    The homey app does not have this problem as the client ID has a different format. 

    As a workaround you can edit the clientId manually in the new option configuration management in the latest version of the owntracks app on your phone. 
  • edited June 2017
    Tallguy said:

    Is Owntracks also useable in a 'current location' flow? I mean...just like the Presence detection had the ability to use cards like "if some is at home..."

    Since Owntracks works so much better than any presence detection I've tried, I'd like to use this in situations where flows will only run when I'm nog at home.



    At the moment the owntracks app does not have a condition card. But I am looking at that. 
    But you always use a counter and check if that counter is 0 or not. 
  • Tallguy said:

    Is Owntracks also useable in a 'current location' flow? I mean...just like the Presence detection had the ability to use cards like "if some is at home..."

    Since Owntracks works so much better than any presence detection I've tried, I'd like to use this in situations where flows will only run when I'm nog at home.



    You mean something like this:


  • Yannick said:
    I found the problem and my beacon detection is now working properly.
    The reason was that I had the wrong UUID. My device apparently has 2 UUID's. 1 for configuration and for the iBeacon function.

    PimBliek said:
    It works! Thanks! :)

    20170407-18:57:07 state.topic = x topic = owntracks/pb/pim state.fence = x geofence = home
    Cool that it works. 

    Anyone tested beacons already on Android? 
    Yes, I have a rpi 3 as a beacon and use owntracks on Android. I never have any false "away/home" notifications anymore. Since a already used an rpi as my media player, it was fairly easy to make it act as a beacon as well.

    Greetz, Danny
  • I'm very happy with Hometrack, but I have one little annoyance.

    I have set Homey on a range of 50mtr and my Owntrack app in my Iphone on 40mtr. When I leave my house, I have to 'loop back' following the road.  So after a few minutes I sort-of drive by my house again.
    At that moment, my Homey sees me 'returning home'....and 50mtrs further down the road, Homey sees me leaving again.

    So..I was thinking it might be because of the distance, but...checking this I noticed that in a straight line, I'm driving by my house at 128mtrs.

    So...this should be well outside the set ranges in both my Homey (50mtr) and my Owntrack app (40mtrs).

    How to solve this? Is this where the new option 'check for double events' is for?
  • @Tallguy
    The problem you have has to do with the accuracy of your GPS. The "check for double events" will not solve that problem. That option solves the problem that when the gps accuracy is too low and gets out of range (the value specified in the homey app), the leave event (or enter event) is  not triggered. When the gps accuracy is again within range it can generate an enter/leave event again. This scenario is solved with that. 

    In your case the best thing is to play a but with the geofence range and the accuracy. 

    But need to think of a suction for that problem. But that's not easy. If you use a timer for ignoring events will also cause problems. 

    But I am open for good suggestions. 
  • @MennoVanGrinsvenWhere do you suggest that I try some other settings. In the Homey or on the Iphone? Which of the two is most likely to solve my issue? My gut feeling tells me the Homey. But....is there a minimum value with which Owntracks will still work or is 40mtr the lowest it will accept?
  • In the Owntracks app you can select ignore specific acc.. You can set this to 200 to increase your acc.. It is possible that you will enter the area a bit later because your geo location isn't in that range when you enter the area :)
  • Deef_KDeef_K Member
    edited June 2017
    When setting up a flow my geofences do not show instead it shows a "all geofences wildcard". Also i cant save the flow because Thuis is not beeing recongnized. Any idea how to solve this?
  • Deef_K said:
    When setting up a flow my geofences do not show instead it shows a "all geofences wildcard". Also i cant save the flow because Thuis is not beeing recongnized. Any idea how to solve this?


    Go to settings and add the users and geofences. 
    (or use the cards where you can enter a topic). 
    The homey app will add geofences and users when it receives them from the owntracks phone Apps. Also the data is persistent (all gathered data will be stored when the app closes when updating or restarting homey) 
  • Deef_KDeef_K Member
    Ive made an user called Dave. It's the same as the ID of owntracks but its not receiving the status of my mobile.
  • edited June 2017
    Deef_K said:
    Ive made an user called Dave. It's the same as the ID of owntracks but its not receiving the status of my mobile.

    If you go to settings of the homey app, are there coordinates and battery level behind your username? 

    Or check the log to see if you receive messages from the phone app. 

    Remember that geofence enter/leave messages are sent when actually entering / leaving the geofence. 

    Also please tell me what you have done already. Did you create a trigger and if so what card did you use? 
  • Deef_KDeef_K Member
    edited June 2017
    Ive done everything from page 1. The userID is the admin login from my synology nas.








    Added 2 users as said but nothing happens. I use the same name as the deviceid


    and this is my flow.



    i added the extra lines in the mosquitto.conf
    I receive a messages from owntracks that i left the area but i dont receive a push message from homey. I would like to use it with 2 users.
  • edited June 2017
    Deef_K said:
    Ive done everything from page 1. The userID is the admin login from my synology nas.








    Added 2 users as said but nothing happens. I use the same name as the deviceid


    and this is my flow.



    i added the extra lines in the mosquitto.conf
    I receive a messages from owntracks that i left the area but i dont receive a push message from homey. I would like to use it with 2 users.

    The userid is admin. 
    So if you change Dave into admin in the trigger card, you will get the notification. 
    You should create seperate users on your MQTT server. So create a user Dave and Ingrid on your MQTT server and it should work. Right now you have configured a user admin with two devices named Dave and Ingrid. 

    If that is not an option, use the trigger cards where you can enter the topic. Use topic owntracks/admin/Dave/+ 

    But with this option, asking homey for the location of a user will not work correctly. 

    The best (and correct) solution would be to add different MQTT users. 
  • @ingmar

    Are you still using owntracks? Would you consider updating the guide with the latest changes? 
  • ingmaringmar Member
    @ingmar

    Are you still using owntracks? Would you consider updating the guide with the latest changes? 
    Hi, I am sorry I didn't follow this thread for a while. I am still using the owntracks. What do you want me to update, or should I read the last couple of pages with comments ;-)
  • Deef_KDeef_K Member
    @MennoVanGrinsven ive added the users but the admin is simply beeing added by the system.
  • edited June 2017
    Deef_K said:
    J@MennoVanGrinsven ive added the users but the admin is simply beeing added by the system.

    Did you create the users on the MQTT broker and are you logging in with the phone apps with those accounts? 
    According to the Screenshot, you are logging in on the MQTT broker as admin. 

    That is why the homey app is adding the admin user. 
  • Deef_KDeef_K Member
    I did create the users in the broker and loggin in with these accounts. Battery status etc. is not beeing updated. 
  • Deef_K said:
    I did create the users in the broker and loggin in with these accounts. Battery status etc. is not beeing updated. 

    If you remove all the user data from the homey app and let the owntracks phone app send a location message, does a user get created in the homey app? 
  • edited June 2017
    ingmar said:
    @ingmar

    Are you still using owntracks? Would you consider updating the guide with the latest changes? 
    Hi, I am sorry I didn't follow this thread for a while. I am still using the owntracks. What do you want me to update, or should I read the last couple of pages with comments ;-)


    Most important is the user part and authorisations and the MQTT server. 

    Besides that, a condition card has been added, speech has been added and a phone battery trigger card has been added. 
Sign In or Register to comment.