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

[APP] Owntracks client for Homey

124

Comments

  • mbalik79 said:
    Think I found the anwer on my question.  Now I have owntracks on http. If I install a mqtt-broker all the geofences are shared with all the people who are sending to the same broker.  
    Could someone confirm this?

    A quick update on your question. I have submitted version 2.1.0 for approval in the beta channel. With this version you can push all geofences to a device. This will only work on a MQTT broker.
  • SkorpionSkorpion Member
    edited November 2017
    Skorpion said:
    Thanks for the quick reply. Don't know how I easily can add new users on my RPi broker, so reverted to a previous version for now.

    Will it be possible to check on same user but different DeviceID in a future update?  

    Did you manage to add different users to the MQTT broker on your pi? Besides using a MQTT broker, you can also use https through the Atom Cloud.
    Yes, actually adding users was quite easy indeed.

    I don't know why, but at the moment it doesn't work yet with triggering leave/enter events.

    I'm running a bluetooth beacon on my RPi like I did with the previous Owntracks version as well. I created a new region on my iPhone with my new user. Everything looks good and when checking the Owntracks logs, every data is coming through. Only leaving/entering doesn't trigger my presence switch in Homey.

  • I didn't change anything, but when I left home, it worked, so problem solved. :)
  • I wanted to improve my Owntracks client by adding multiple users in a user file (I see that I am not the only one ;)), but somehow I cannot get it to work anymore. The problem is that the Fence is not being recognized by Homey somehow.
    I have the Home fence on the phone and the ball next to the region is red, meaning that I am at home.
    I can see the location in Homey under fences and also I have set all the regions at several 100 meters.
    Required accuracy is set to 250 meters (my phone accuracy is 50 meters).
    After a check with Google maps of the locations that Homey shows, I am 2 meters away from Home, which means I am there.

    Phone is connected with the Raspberry Pi and all the communication is there EXCEPT the fence.
    This is the log ('XXXXX' are replaced by me, and 'user' is also fake):
    received '{"batt":63,"lon":XXXXX,"acc":50,"vel":0,"vac":24,"lat":XXXXX,"t":"u","_cp":1,"conn":"w","tst":1509901075,"alt":628,"_type":"location","tid":"XXXXX"}' on 'owntracks/pi/user'

    I don't see the 'desc' like in this screenshot:
    https://forum.athom.com/uploads/editor/ck/5pisk7paq5d1.jpg

    Is there anything else that I can check?
  • TF99 said:
    I wanted to improve my Owntracks client by adding multiple users in a user file (I see that I am not the only one ;)), but somehow I cannot get it to work anymore. The problem is that the Fence is not being recognized by Homey somehow.
    I have the Home fence on the phone and the ball next to the region is red, meaning that I am at home.
    I can see the location in Homey under fences and also I have set all the regions at several 100 meters.
    Required accuracy is set to 250 meters (my phone accuracy is 50 meters).
    After a check with Google maps of the locations that Homey shows, I am 2 meters away from Home, which means I am there.

    Phone is connected with the Raspberry Pi and all the communication is there EXCEPT the fence.
    This is the log ('XXXXX' are replaced by me, and 'user' is also fake):
    received '{"batt":63,"lon":XXXXX,"acc":50,"vel":0,"vac":24,"lat":XXXXX,"t":"u","_cp":1,"conn":"w","tst":1509901075,"alt":628,"_type":"location","tid":"XXXXX"}' on 'owntracks/pi/user'

    I don't see the 'desc' like in this screenshot:
    https://forum.athom.com/uploads/editor/ck/5pisk7paq5d1.jpg

    Is there anything else that I can check?

    What you want to do will not work. If you want to make a difference in user, you will have to add accounts to your mqtt broker on your pi. 

    Right now you just have one user called pi and with different device names. 

    The topic naming convention in owntracks is owntracks/user/device

    Where user is the username used to login on the broker.

    The transaction events represents a state change (entering or leaving a geofence). So if you stay inside the radius of your fence, there will be no transition event. 
  • Hi Menno,

    Thanks, yes, I added users to the MQTT broker on my Raspberry Pi using a password file and the mosquitto_passwd command.
    I was able to register different users; they showed up in the Homey app.

    But, somehow it started working today with the default pi as user, I don't know why, I will leave it as it is. I get the impression that it works only when you leave/enter locations. Otherwise the location will not show up in the Homey App.

    What would then the best way to differentiate between users? When using the cards, I only see the user name and location as an option, there is no place to check for the device.
  • I have added a geofence on my first phone and it is synchronized in homey (Http broker). But the geofence isn't added to the second phone when it sends it's location to homey. Any ideas?
  • Count_B said:
    I have added a geofence on my first phone and it is synchronized in homey (Http broker). But the geofence isn't added to the second phone when it sends it's location to homey. Any ideas?


    It does not send to the other phone. Due to a fixed response format in Homey, it is not possible to implement that right now. The HTTP can just receive messages. 

    If you want full options, you will need a MQTT broker. 

    I am working on a MQTT broker for Homey and is currently available in the beta channel. Only problem would be that you need to be able to access your homey from the internet (port forwarding and a DDNS entry) 
  • Hi Menno,

    I didn't see an issue page on GitHub, so I will post it here. Everything is working fine for me, but I noticed a few Owntracks error messages in the notification tab, so I looked into the log. Maybe this can be fixed in an upcoming release.

    Log:

    20171114-15:00:49 OnMessage called

    20171114-15:00:49 received '{"conn":"m","tst":1510668049,"vac":10,"acc":65,"alt":0,"lon": XXX,"_type":"location","lat": XXX,"tid":"IK","batt":76}' on 'owntracks/I/I'

    20171114-15:00:49 We have received a location message

    20171114-15:00:49 Set battery percentage for I to 76%

    20171114-15:03:38 OnMessage called

    20171114-15:03:38 received '{"cog":66,"batt":45,"lon": XXX,"acc":5,"vel":102,"vac":6,"lat": XXX,"conn":"m","tst":1510668218,"alt":3,"_type":"location","tid":"JJ"}' on 'owntracks/J/J'

    20171114-15:03:38 We have received a location message

    20171114-15:03:38 Set battery percentage for J to 45%

    20171114-15:08:14 OnMessage called

    20171114-15:08:14 received '{"t":"c","tst":1510668494,"acc":5,"_type":"transition","event":"enter",”lon”:XXX,”lat”:XXX,"wtst":1509536315,"tid":"JJ","desc":"Thuis"}' on 'owntracks/J/J/event'

    20171114-15:08:14 Accuracy is within limits

    20171114-15:08:14 saveFenceData called

    20171114-15:08:14 Fence: Thuis changed

    20171114-15:08:14 Trigger enter card for Thuis

    20171114-15:08:14 Trigger generic card for Thuis

    20171114-15:08:14 saveUserData called

    20171114-15:08:14 OnMessage called

    20171114-15:08:14 received '{"cog":50,"batt":44,”lon”:XXX,"acc":5,"vel":28,"vac":6,”lat”:XXX,"t":"c","conn":"m","tst":1510668494,"alt":-16,"_type":"location","tid":"JJ"}' on 'owntracks/J/J'

    20171114-15:08:14 We have received a location message

    20171114-15:08:14 Set battery percentage for J to 44%

    20171114-15:08:14 Listener enterGeofence_AC called

    20171114-15:08:14 state.topic = owntracks/J/J/event topic = undefined

    20171114-15:08:14 received user J trigger user: I

    20171114-15:08:14 Listener enterGeofence_AC called

    20171114-15:08:14 state.topic = owntracks/J/J/event topic = undefined

    20171114-15:08:14 received user J trigger user: J

    20171114-15:08:14 Received Fence = Thuis trigger fence = Thuis

    20171114-15:08:14 triggerFence = equal

    20171114-15:08:14 Persisting fenceArray failed: Error: ENOSPC: no space left on device, write

    20171114-15:08:14 Persisting userArray failed: Error: ENOSPC: no space left on device, write

    20171114-15:08:39 OnMessage called

    20171114-15:08:39 received '{"cog":298,"batt":44,"lon": XXX,"acc":5,"vel":22,"vac":6,"lat": XXX,"conn":"m","tst":1510668519,"alt":-10,"_type":"location","tid":"JJ"}' on 'owntracks/J/J'

    20171114-15:08:39 We have received a location message

    20171114-15:08:39 Set battery percentage for J to 44%

    20171114-15:09:59 OnMessage called

    20171114-15:09:59 received '{"conn":"m","tst":1510668598,"vac":10,"acc":65,"alt":0,"lon": XXX,"_type":"location","lat": XXX,"tid":"IK","batt":100}' on 'owntracks/I/I'

    20171114-15:09:59 We have received a location message

    20171114-15:09:59 Set battery percentage for I to 100%

    20171114-15:14:58 OnMessage called

    20171114-15:14:58 received '{"tst":1510668897,"acc":65,"_type":"location","alt":-1,"lon": XXX,"vac":10,"lat": XXX,"batt":42,"conn":"w","tid":"JJ"}' on 'owntracks/J/J'

    20171114-15:14:58 We have received a location message

    20171114-15:14:58 Set battery percentage for J to 42%

    20171114-15:31:06 OnMessage called

    20171114-15:31:06 received '{"conn":"m","tst":1510669866,"vac":10,"acc":65,"alt":0,"lon":XXX,"_type":"location","lat": XXX,"tid":"IK","batt":100}' on 'owntracks/I/I'

    20171114-15:31:06 We have received a location message

    20171114-15:31:06 Set battery percentage for I to 100%

    20171114-15:32:36 OnMessage called

    20171114-15:32:36 received '{"tst":"1510644543","_type":"lwt"}' on 'owntracks/I/I'

    20171114-15:46:22 getUserArray called

    20171114-15:46:31 getLogLines called

     
  • My Homey became almost unusable after receiving 3000+ notifications from the Owntracks client after the connection with the Broker was lost for a while. Disabled notifications for the Owntracks Client immediately within the Homey notification settings. Also tried to clear all notifications over there but this button seems to do nothing (also after waiting for a while). Does anyone know how to fix this issue. Searched the forum for users the same problem; few active/closed topics but none with a  solution.
  • Spydrone said:
    My Homey became almost unusable after receiving 3000+ notifications from the Owntracks client after the connection with the Broker was lost for a while. Disabled notifications for the Owntracks Client immediately within the Homey notification settings. Also tried to clear all notifications over there but this button seems to do nothing (also after waiting for a while). Does anyone know how to fix this issue. Searched the forum for users the same problem; few active/closed topics but none with a  solution.

    What version are you using? That problem should have been resolved in 2.0.4
  • Spydrone said:
    My Homey became almost unusable after receiving 3000+ notifications from the Owntracks client after the connection with the Broker was lost for a while. Disabled notifications for the Owntracks Client immediately within the Homey notification settings. Also tried to clear all notifications over there but this button seems to do nothing (also after waiting for a while). Does anyone know how to fix this issue. Searched the forum for users the same problem; few active/closed topics but none with a  solution.

    What version are you using? That problem should have been resolved in 2.0.4
    v2.1.0 but this issue occurred more than a month ago. Have this problem for a while now. : (  
  • Is there any specific reason why to use booleans instead of the cards?
  • nopzolder said:
    Is there any specific reason why to use booleans instead of the cards?

    What do you mean exactly? 
  • Menno, any idea why I get "parcing fenceArray/userArray failed, unexpected JSON...." now and then, causing all users to be removed and braking my owntracks presence flows? The only resolution is adding new users again, setting up the phones and wait until it brakes... This is happening since last update
  • ingmar said:
    Menno, any idea why I get "parcing fenceArray/userArray failed, unexpected JSON...." now and then, causing all users to be removed and braking my owntracks presence flows? The only resolution is adding new users again, setting up the phones and wait until it brakes... This is happening since last update

    I don't have an idea why you have that problem. Seems that somehow that Json file gets corrupted. Why that happens, I dont know. I only had that twice but that was after heavily altering the contents whil developing. 

    Did you try deleting the user data button already? That will delete all the Json files from the file system..
  • Hi all,

    I'm trying to get it working and am 90% of the way but not sure what I missed on the geofencing part. I set-up everything with CloudMQTT, made separature users (one for Homey and one for each family member) and logged in on Owntracks. Locations are reported correctly to Homey :-)

    Then I set-up some geofences in Owntracks and published them, these were recognised and memorised automatically by Homey as well. However, somehow when I enter the fences (and Owntracks app shows I entered it with the specific time), this seems not to be picked up by Homey. My location is reported, but it does not trigger a Fence. Only when I press on the button after the user record in the Homey menu, (see screenshot below) and get the message "Fence data has been published", the Fence is correctly triggered in Homey as well. Nonetheless, I need to do this everytime, it never automatically triggers the fence in Homey.... What am I missing/doing wrong?? :open_mouth: 

    Thanks!!




  • No one?
  • edited December 2017
    Flight777 said:
    No one?

    Did you setup any flows? You need to setup at least one trigger, so homey does something. And triggering a fence can only be done moving in and out of the fence. Pressing the ^ button sends all the fences in homey to that user's phone. 

    You can try to experiment with the radius. The geofence enter / leave is triggered when you actually cross the "fence".

    And check in you geofence setup if you enabled share in the definition on your phone. 
  • Flight777Flight777 Member
    edited December 2017
    Hi Menno, thanks for the reply! Yes I´ve set triggers and yes I know when a fence should be triggered ;) The issue is that the fences I've set up on my phone are shared with Homey (I can see them on the settings page), however, when I go into such a fence, Homey does not recognise it and changes the fence the user is in. This while it does "know" all the geofences.

    Thus this does not change and thus any flow triggers won't work:



  • @Flight777
    Did you set a range in Homey ('minimale nauwkeurigheid'). And did you set a range in the Owntracks client? Both are needed.
    Also...post the Owntracks log here please so we can analyse it.
  • ingmar said:
    Menno, any idea why I get "parcing fenceArray/userArray failed, unexpected JSON...." now and then, causing all users to be removed and braking my owntracks presence flows? The only resolution is adding new users again, setting up the phones and wait until it brakes... This is happening since last update

    Ingmar, found the cause of the parsing failure. Now only the solution. Seems that when writing to a file, the current data is overwritten with the new data. But when the size of the new data is smaller then the data that is being replaced, there are leftovers from the previous data, hence the parsing error.

    Solution would be to truncate the Json file before writing the new data. 
  • @MennoVanGrinsven
    I have some problem with owntracks. Don't know if you have a sollution.
    My situation: 
    = Owntrack App on Homey
    = Mosquitto running on Synology Nas
    = Owntrack App on 2 android devices

    If I and my wife leave the house at the same time one of the flows (like in the screenshot, have one for me and one for her) is not started. I can see in the owntracks app (on the android device) that we both have left the Thuis geofence.
    If we are going seperate from the Thuis geofence  there are no problems...

    Don't know how to solve this problem...
  • B3rtB3rt Member
    edited January 2018
    I cannot seem to get this app working.

    I installed it on my synology NAS, in Homey and on my iPhone.

    the problem i get:
    - what is the user/pass i have to enter?
    I nowhere had to configure or add a user in synology install, also there is no configuration file as descriped in first topic.

    So what do i enter as user/pass ?  (in currently entered the user/pass of admin of my nas)
    The app states it is connected, i made a test flow when batt goes below 65% it would send me a message, this works.

    BUT....

    It does NOT do anything when i come or leave home.

    Is there somewhere a dutch manual for this app (for current version) how it works with a synology NAS?

  • @mbalik79 It would be nice to have some logging to see what happens. 
  • edited January 2018
    @B3rt Did you add a flow for a leave/enter event?
    Perhaps it's a better idea to install the MQTT broker app on Homey. 
  • @MennoVanGrinsven

    Have changed the triggercard as below, now it is working...

  • B3rtB3rt Member
    edited January 2018
    @B3rt Did you add a flow for a leave/enter event?
    Perhaps it's a better idea to install the MQTT broker app on Homey. 

    Yes i added a flow entering and leaving an area (thuis).

    No, i did not know there was a broker app but i just installed it :) so now working fully on Homey.

    But still i have no idea what user/pass i should enter in de settings of the client version..
    In the mqtt broker app i can add users, here i created 2 users, 1 for my iphone and 1 for my girlfiends iphone.

    But which user/pass i use to connect to the broker?

    Also what do i enter in the app on my iphone as 'Beacon Region'?
    What is the UUID, major and minor fields exactly do?
  • this app is also not so reliable...

    9 of 10 times it does not respond if you enter or leave a trigger area, ittf or homey location  services do respond but this app does nothing.

    Sometimes it indeed detects leaving or entering the area but most times it does not.

    Anyone an idea why it does not detect?
  • mistaoutlawmistaoutlaw Member
    edited January 2018
    First off, thanks for this app.
    I've spent about 4 hours today to get this up and running.
    but it seems that I'm stuck.
    hope you guys can help.

    i've set MQTT mosquitto on my synology nas.
    seems to work fine.
    i have installed owntracks on my android device and set a region HOME.
    this seems to work as well. I get push messages stating that I've entered a region.
    Furthermore, i've setup the client app on homey, which receives all messages from Owntracks.
    I can see those in the logs.

    However, it seems like:
    1. the fence location isnt coming through properly. In the user overview, it states fence = "undefined"
    User Fence Lon Lat Battery Device
    Pipo undefined 4.xxxxxxx 51.xxxxxx 12% oneplus5t
    2. the geofence event flow doesnt trigger any action (in this case to set a boolean value)

    what do you guys need me to show in order to help me further?
Sign In or Register to comment.