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.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Official
Comments
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.
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 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.
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.
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)
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
What version are you using? That problem should have been resolved in 2.0.4
What do you mean exactly?
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..
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??
Thanks!!
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.
Thus this does not change and thus any flow triggers won't work:
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, 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.
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...
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?
Perhaps it's a better idea to install the MQTT broker app on Homey.
Have changed the triggercard as below, now it is working...
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?
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?
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?