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

1246711

Comments

  • intstal MQTTLENS app on your windows pc.

    hostname tcp:// <internal ip adress> poort 9001
    connect to it

    under subscribe type owntracks/#

    then in phone app owntrack in the map window click in the right corner on the arrow up with the line above en look what happen in MQTTLENS
  • edited February 2017
    mbalik79 said:

    Now I get this... App on the android phone says connected, but still no report received (i think)



    Try adding a dummy flow with a trigger card with the topic owntracks/# 
    And see what happens. 

    Using that topic in a dummy flow, will make the homey app subscribe to all Owntracks messages that are posted. In the log you will be able to see what topic the app on your phone is posting to. 
  • yup it is working...thanks guys

  • posthokposthok Member
    edited February 2017
    There is a mosquitto package on http://www.jadahl.com/synology6/?arch=cedarview.
    With this package you don't have to edit the config file. It runs from start.
    note: do not upgrade this package. It stops and will not run again after update.
    First select your synology model.
  • mbalik79mbalik79 Member
    edited February 2017
    Mosquitto is working, see the topics in the MQTTLENS app, but homey did not do anything with the flows I create.


  • YannickYannick Member
    edited February 2017
    mbalik79 said:
    Mosquitto is working, see the topics in the MQTTLENS app, but homey did not do anything with the flows I create.

    those entries are just battery/location status updates. They are not Region enter/leave events. You can recognize those by the owntracks/Mar/marc/event topic. So move your ass a bit more ;)
  • I did  :) went away this afternoon. But when I entered the thuis zone I did not get a notification
  • does the home zone show up as a red circle in you owntracks phone app? Maybe check more then last 5 messages? 
    And check that you flow card ends with /event and the region is case sensitive.
  • the zone is blue (android app). Now I see in the mqtt client a topic /waypoint , is that the point I left?

  • nope waypoint is not what you're looking for.

    You need to make the range bigger in both the owntracks phone (default = 0 meters) and homey app.
  • yes that was it.. great..get messages. Thanks for you're patience!
  • edited February 2017
    If the range is 0, then the region is a waypoint. If you set the radius > 0 it becomes a geofence (a circle x meters around the coordinates). 

    Setting the accuracy in the homey app is to compensate location inaccuracy that you always have when using GPS, especially indoors. All it does is ignore enter /leave events when the inaccuracy exceeds the value entered in the homey app. 
    So if you have a lot of enter/leaves because of GPS drift, try increasing the value in the homey app. 
  • Oh and I published a new version :-) 
  • I too am having issues....but am close to a solution, I think

    I see log entries with location:



    In Homey is see geofence "Thuis":



    I have set the radius in Homey to 250:


    And in the Android App I have set in to 250 radius also.

    I still don't get a working flow:




    It reads "owntracks/Ernst/OP3/event"  and I use the geofende "Thuis" with a capital "T".

    What is missing?
  • edited February 2017
    @eternity I do not see any transition events. You need to trigger entering / leaving your geofence. 

    Try setting the radius in your owntracks phone app to 0. Wait a few seconds and then set it again to say 50 or 100
  • Oh and I published a new version :-) 

    Thanks Menno for updating the app, I really want to get my hands on it with the beacons, wildcards etc. I will get back to you asap for more stuff, but I am currently snowed under at my job... Keep up the good work!
  • @MennoVanGrinsven

    More stuff is working :-)
    My phone just reported "leaving Thuis" and "entering Thuis" when I change the radius. Great!

    So, Phone / Synology setup is working. Now Homey needs to be added 
  • Eternity said:
    @MennoVanGrinsven

    More stuff is working :-)
    My phone just reported "leaving Thuis" and "entering Thuis" when I change the radius. Great!

    So, Phone / Synology setup is working. Now Homey needs to be added 



    Well I do not have much free time either. Besides this project, I have 4 others that I have to attend to in my free time (besides a full time busy job) 
  • Eternity said:
    @MennoVanGrinsven

    More stuff is working :-)
    My phone just reported "leaving Thuis" and "entering Thuis" when I change the radius. Great!

    So, Phone / Synology setup is working. Now Homey needs to be added 



    Try adding a dummy flow with owntracks/# as topic. 

    The log on the homey app will show all messages it can receive. 
  • @MennoVanGrinsven

    Menno, don't get me wrong, I am very thankful for your effort and support!

    What I meant to say is, that tweaking and discovering is a hobby of mine. And Homey, with all the Apps and expanding functionality, is certainly something to discover! 

    Thanks again Sir. Your effort is massively appreciated! 
  • @Eternity
    Hehe ok. Have fun discovering. 
  • seems i got it all working.

    mosquitte on the nas.
    owntracks on homey and mine phone and wifes phone.

    put in both phones geofences thuis and werk
    in homey  - wife werk
                      - wife thuis
                      - me thuis

    put in flows for me home wife home me away wife away
    and wife at work me at work.
     that al seems to work because i see event trigger in homey and mqttlens.

    Now my question.

    i want to make a flow with someone asking homey where's WHO? and then homey say WHO? is TYPE.
  • I try to run it on a synology nas 
    But i have it not working 
    
    And in my log I get these messages
    
    does anyone know what I'm doing wrong


  • @CliffBroeren
    Wait for the next update. There is a bug, or use the enter/leave trigger card. 
  • i have now two flows

     

    but that would for my case (i work everywhere in the country) that i must make hundreds of flows

    so anybody got another idea
  • webwalser said:
    i have now two flows

     

    but that would for my case (i work everywhere in the country) that i must make hundreds of flows

    so anybody got another idea

    I guess you shouldn't use the condition card (middle) but just let homey say where person x is. @MennoVanGrinsven can you confirm?
  • edited March 2017
    ingmar said:
    webwalser said:
    i have now two flows

     

    but that would for my case (i work everywhere in the country) that i must make hundreds of flows

    so anybody got another idea

    I guess you shouldn't use the condition card (middle) but just let homey say where person x is. @MennoVanGrinsven can you confirm?

    Hmm right now you have to set a variable if you want to have state. So if you use a enter/leave card for wife and set a var say wife_home=leave or enter and use that. 

    But this use case shows that a tag with the geofence name would a nice, so you can set wife_location=geofencename

    Right now I am doing a major Refactoring of the app. All main code was in one source file (500 lines) and I am cutting it up in different modules so extending functionality will became easier. 

    Things planned are:
    - getting rid of the need to enter topics. Username and geofence are then the only arguments needed for a trigger card. These fields will show a list of known users and known geofences
    - adding the topic owntracks/# as default. This is needed to get collect usernames and geofence names. 

    After that I am thinking of adding some speech support. First a card where you can supply user and homey will speak out location (name of geofence). Later perhaps Adress based on lon/lat. 

  • Is't it possible to put owntracks trigger in middle AND row?

    Then you could have

    Ask:Where is wife -› wife is TYPE -›
    Say: wife is TYPE

    The speech support would be Nice.
    And later on the adres on lon/lat
    Could be great.

    So wife ask where's husband homey dat "he's driving home for christmas"

    Keep up the good work MennoVanGrinsven
  • I have to admit after 5 hours of struggle, I have managed to link everything and now its working fine! :smile: :smiley:

    I have used my Synology NAS as a broker with the latest DSM version and the stable homey version. Both android and apple are working.

    Many kudo's to the TS and the app makers.

    @webwalser When you save the TYPE when you trigger a messages in a beter logic variable you can use it to ask where people are.
  • @Denn1992

    Hmm I gave up.... Ik managed to set up my Syno and phones. I got updates once, where I could see where my phone and my sons phone was. Than it stopped working. No more region updates in the log file. 

    Any chance you can explain how you managed to get your setup to work.... 


Sign In or Register to comment.