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

1567911

Comments

  • Deef_KDeef_K Member
    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? 
    No. Saved locations are also not beeing added. 
  • Deef_K said:
    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? 
    No. Saved locations are also not beeing added. 

    Then  messages are not received by the homey app. Please check the log. Try to generate some messages on the owntracks app on your phone and the check the log on the homey app and see if messages are received. 

  • LJSVVLJSVV Member
    Can't get the Fence option to work....

    My Regions keep showing as a waypoint:


    Tried, changing the radius to 0, then wait a while and change the radius to 250:

    Still returning a Waypoint not a fence..... What am I doing wrong....
  • Deef_KDeef_K Member
    edited July 2017
    I see this message in the log: 20170630-20:40:27 received '{"tst":"1498735107","_type":"lwt"}' on 'owntracks/Dave/Dave'

    edit: i also see this

    20170701-08:41:06 rejectUnauthorized: true
    20170701-08:41:06 Subscribed to owntracks/#
    20170701-08:41:06 MQTT client connected
    20170701-08:41:06 Connected Topics: owntracks/#
  • @Deef_K I think you need to have a look at the authorizations in the MQTT broker. The users should be granted read/write to owntracks/#
  • Deef_KDeef_K Member
    edited July 2017
    @MennoVanGrinsven How do i achieve that?
    Can you also check if the log is correct?

    edit: today i noticed that the significant changes mode does not send the location to the broker
  • LJSVVLJSVV Member
    Deef_K said:
    @MennoVanGrinsven How do i achieve that?
    Can you also check if the log is correct?

    edit: today i noticed that the significant changes mode does not send the location to the broker


    Indeed, manually pushing location updates does work and the log shows that it receives a location message.

    When I leave a region I do get a notification on my Iphone but no location is being shared to Homey... Is this a bug in the Owntracks iPhone app??

    Does changing to move mode work for you @Deef_K ?


  • Deef_KDeef_K Member
    edited July 2017
    @LJSVV No not at all. Eventually i gave up and started crying. Today i noticed a update of the client. Did that help for you?
  • edited July 2017
    Deef_K said:
    @LJSVV No not at all. Eventually i gave up and started crying. Today i noticed a update of the client. Did that help for you?

    Did you check if you have 'share' enabled in your regions? 

    If you did not, the geofence is not reported and as such never trigger on enter/leave events. 


    @LJSVV the same for you? 
  • LJSVVLJSVV Member
    edited July 2017
    Yes, I have shared the regions, I do get a notification on my iPhone that i entered or left a Region, but the transition is not transferred to the server, I tried making a cloudmqqt free server, the exact same issue occurs.

    So I think it is owntracks iOS related. Already issued on GitHub...

    EDIT: after deleting all fences and after re-adding it seems to work right now..
  • Deef_KDeef_K Member
    @MennoVanGrinsven yes. Also did that. 
    @LJSVV also tried that but no luck. 
  • LJSVVLJSVV Member
    edited July 2017
    1 day later and it doesn't work anymore..... Seems to be iOS app related I think.

    No transition messages (events) received by the server...

    For the moment I will fallback to the IFTT multiuser solutions for presence detection....
  • Similar issues here..
    i.e. battery (from Android) is reported, however not from iOS.
    Leaving/arriving in home fence not working on android and not on iOS.
    Leaving/entering work fence works 1 in 5 times for iOS, never on Android.
    I might try to reinstall everything next week and give it another go.

    @LJSVV which IFTTT multi user solution are you referring to?
  • edited July 2017
    Jerryvdv said:
    Similar issues here..
    i.e. battery (from Android) is reported, however not from iOS.
    Leaving/arriving in home fence not working on android and not on iOS.
    Leaving/entering work fence works 1 in 5 times for iOS, never on Android.
    I might try to reinstall everything next week and give it another go.

    @LJSVV which IFTTT multi user solution are you referring to?

    How did you set everything up? It's working great here. I don't have an iOS phone, so can't test anything on that, but enter / leave events are working great. Could be GPS related. Please provide me with settings of the android app and the homey app. Also how did you setup the MQTT server and triggers. 

    Also there are sadly differences between the iOS and Android versions of the owntracks app. Some things work on iOS and some only on Android. 


  • LJSVVLJSVV Member
    edited July 2017
    Jerryvdv said:
    Similar issues here..
    i.e. battery (from Android) is reported, however not from iOS.
    Leaving/arriving in home fence not working on android and not on iOS.
    Leaving/entering work fence works 1 in 5 times for iOS, never on Android.
    I might try to reinstall everything next week and give it another go.

    @LJSVV which IFTTT multi user solution are you referring to?

    How did you set everything up? It's working great here. I don't have an iOS phone, so can't test anything on that, but enter / leave events are working great. Could be GPS related. Please provide me with settings of the android app and the homey app. Also how did you setup the MQTT server and triggers. 

    Also there are sadly differences between the iOS and Android versions of the owntracks app. Some things work on iOS and some only on Android. 


    Tried hosting an own MQTT server with Mosquitto and also a cloudmqtt account.

    it is 100% iOS owntracks app related. I have seen more issues on GitHub.


    Jerryvdv said:
    Similar issues here..
    i.e. battery (from Android) is reported, however not from iOS.
    Leaving/arriving in home fence not working on android and not on iOS.
    Leaving/entering work fence works 1 in 5 times for iOS, never on Android.
    I might try to reinstall everything next week and give it another go.

    @LJSVV which IFTTT multi user solution are you referring to?

    I am using IFTTT for presence detection. My wife's iPhone has an own IFTTT account. When adding the Homey Channel to the IFTTT account on the second phone, Just login using the account used in the Homey IFTTT app. This works perfect. I am using the different away or at home flows mentioned in the first post of this topic, but than with an IFTTT event trigger.


  • Deef_KDeef_K Member
    Also tried with cloudmqtt. Also not working. I guess its IOS related.
  • @MennoVanGrinsVen
    Thanks for the quick reply. Unfortunately, I already deleted the settings on homey and the apps.
    I was using cloudmqtt (might cause some of the problems; however, I did see data in the logs of Homey).
    Regions are shared and connections could be made.

    Perhaps it had something to do with my flows (those I still have, I added 3 as an example):




    @LJSVV thanks, I'll use that as a backup in the meantime (did not know you could couple the same Athom account to multiple IFTTT's).
  • I got the same issue with fences. Homey is receiving messages with waypoint information but the list with fences stays empty.
    I'm using the iOS app so maybe that could be the problem?
  • edited July 2017
    I got the same issue with fences. Homey is receiving messages with waypoint information but the list with fences stays empty.
    I'm using the iOS app so maybe that could be the problem?

    I don't have a iPhone, so I can't look into that. On my android phones the transition events are working. 

    I read that there were problems on iPhone with enter/leave events, but can't find if they are resolved or not. 

    This weekend I am going to upload a new version that has http support. Perhaps there is a problem in the combo iphone/MQTT. 

    You are sure the settings are correct? You made the geofence public and set a radius? 
  • edited July 2017
    I got the same issue with fences. Homey is receiving messages with waypoint information but the list with fences stays empty.
    I'm using the iOS app so maybe that could be the problem?

    I don't have a iPhone, so I can't look into that. On my android phones the transition events are working. 

    I read that there were problems on iPhone with enter/leave events, but can't find if they are resolved or not. 

    This weekend I am going to upload a new version that has http support. Perhaps there is a problem in the combo iphone/MQTT. 

    You are sure the settings are correct? You made the geofence public and set a radius? 
    I'm almost sure that the settings are correct. The geofence is public and I set a radius: 


    These are the Owntrack Client settings in Homey:


    If there's anything that I can do to help to investigate this issue, please let me know. You can always send me a DM on the Athom Slack chat. My username is @rido.

    Thanks ;-)
  • I got the same issue with fences. Homey is receiving messages with waypoint information but the list with fences stays empty.
    I'm using the iOS app so maybe that could be the problem?

    I don't have a iPhone, so I can't look into that. On my android phones the transition events are working. 

    I read that there were problems on iPhone with enter/leave events, but can't find if they are resolved or not. 

    This weekend I am going to upload a new version that has http support. Perhaps there is a problem in the combo iphone/MQTT. 

    You are sure the settings are correct? You made the geofence public and set a radius? 
    I'm almost sure that the settings are correct. The geofence is public and I set a radius: 


    These are the Owntrack Client settings in Homey:


    If there's anything that I can do to help to investigate this issue, please let me know. You can always send me a DM on the Athom Slack chat. My username is @rido.

    I think the ip address in the homey app is not good, this should be the ip address you get from your Internet provider. So your public ip. Kan findes i din modem. Or at http://whatismyipaddress.com/
  • I think the ip address in the homey app is not good, this should be the ip address you get from your Internet provider. So your public ip. Kan findes i din modem. Or at http://whatismyipaddress.com/
    I've got a local Mosquitto server running on my NAS so Homey can connect through the local IP to the server, so that shouldn't be the problem.
  • Ok with version 1.5 of the owntracks coming up, the following:
    Up to now using topics was the main way of identifying users. This is no longer the case. The owntracks app listens to all topcis that begin with owntracks. For MQTT users, the username is retreived automatically from the topic the phone app posts on. So it is important that you use correct usernames.

    Also with version 1.5.0 it is also possible to use HTTP. HTTP can be used on its own (without a MQTT broker). The use of a MQTT broker is still possible and has some advantages over the use of HTTP. 

    When using HTTP,  you have to add users that are allowed to send events to the owntracks app. To do this, go to the owntracks settings page and go to the second button (Change users). Add the user name that you want to give access by entering the name in the empty field below the already known users. Press the "+" button to add the user.


    After you have added the user, the user will show up in the user list and it will have a token generated that is used in the phone app to allow receiving of the events:


    You can remove a user by pressing the "-" button. The "#" button can be used to generate a new token when you think the id has been comprimised.

    In the app on your phone, you should select HTTP as connection:





    Then select HOST:



    The URL you have to enter here is as follows:

    https://<cloudid>.homey.athom.com/api/app/nl.scanno.owntracks/events/?token=<tokenid from user>

    where <cloudid> is the Athom Cloud ID of your homey that you can find in Settings/System.
    The tokenid is the id that is generated when you added the user.

    Using the Athom Cloud is the easiest way of getting started with owntracks. If you are more skilled you can also directly connect to your Homey by port forwarding. Keep in mind that homey itself does not support TLS/SSL. If you want to have a secured session, you need to use a proxy.
  • Also  in the user settings you can add or remove geofences:


    When the owntracks app receives an event with a geofence is does not know, its automatically added. The main purpose of this is that in the trigger cards you do not need to enter the topic names anymore (When using HTTP you cant even use them because HTTP does not use topics). The new trigger cards (they are already present in the current version of the owntracks client) allow you to just enter user and geofence:







  • ingmaringmar Member
    @ingmar see above
    Hi, I am still using the method as I started this topic with because... if it ain't broken,dont try to fix it ;-)
    However I see you are adding very nice stuff so I will look into it in the near future, keep up the good work!
  • edited July 2017
    For MQTT users:
    With the new version 1.5.2 you have to enable MQTT. I have added a new setting (first checkbox) that is disabled by default. Now that HTTP is introduced, the need to use MQTT is  not mandatory and for most users it is easier to just put in an URL then to create a MQTT broker. 

    Using MQTT has advantages above using HTTP. 
  • @MennoVanGrinsven
    With the new version 1.5.2 you need to enable MQTT. 

    I presume that is a typo "you do NOT need to enable MQTT"?
  • Eternity said:
    @MennoVanGrinsven
    With the new version 1.5.2 you need to enable MQTT. 

    I presume that is a typo "you do NOT need to enable MQTT"?

    Nope. What MQTT is disabled due to a new setting. Current MQTT users need to check that checkbox to be able to use MQTT. 




  • EternityEternity Member
    edited July 2017
    You are right, I misread the MQTT user intro. 
Sign In or Register to comment.