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.
Comments
20170814-10:17:56 Received Fence = home trigger fenve = *
The way those owntracks phone apps work is that they publish location and transition messages on a topic. They are also subscribed to a topic. As soon as a phone publishes a message, all devices that are subscribed also receive that message. And as result display the location on a map.
When you can't see any friends, that means the phone did not receive any messages. Causes can be:
1. No messages were published
2. The phone doesn't have the correct authorization on the topic (no read rights)
Did you use different users to login to the MQTT broker? So for each device a seperate user? If not, then please do so.
I just started experimenting with MQTT and Owntracks since my Smart Presence stopped working properly after updating my phone to Android 7.1.2. I run into the issue that the Homey apps crashes once I leave my home geolocation with the following stacktrace.
I have added the home geoloaction in the Owntracks smartphone app and manually added this location with the same name in the settings page of the Homey Owntracks app. Is that how it is supposed to be setup up, and if so, any idea why the app crashes?
Here is some of the Homey app loging.
For the app crash there is already a new version pending approval.
I see that you are using the topic based triggercards. Please use the trigger cards based on username / fence name. The topic based trigger cards will be removed in th Sdk2 version of the app.
Secondly use your name as username to login to mosquitto. You are using mosquitto as username now.
When creating a region / Geofence in the owntracks phone app, enable share. If share is not enabled, the name of the fence is not included in the location messages. If you enabled share, the created fence is automatically added to owntracks and you get a notification in homey. Don't forget to provide a radius in the phone app. Otherwise it's not a Geofence.
In the trigger cards you can use the autocomplete fields to select user and known fences.
Since you are using MQTT, usernames are automatically added. When using HTTP you have to add a new user manually (for security reasons ofc.)
I only have one test flow but I'll start using the username/fence cards when I'm satisfied with how it works and while replacing my Smart Presence flows. I'll await the new version that fixes the app crash before continuing to test it.
I use mosquitto as username as this is the system user under which Mosquitto has been installed on my Synology NAS. What other user could I use for this, it seems to work now? And something else, does the Homey Owntracks app support websockets, I could not get this to work after configuring Mosquitto with websockets.
I have enabled sharing of my geolocations and that does indeed add them automatically to the Homey app, thanx.
Let's hope Athom approves the app soon, it looks promising so thanx for the app.
You don't have to use MQTT anymore. You can use plain https through the athom cloud.
Or use your own web server as proxy (for https).
I'll have a look at the HTTPS option (a suggestion, add the tutorial from a page back to the app readme or openingspost, I had not found it at first). It indeed seems easy but I like to be independent of 3rd party cloud services so I'll probably stick with my own MQTT server.
Only problem is that the username that you login with is used by the owntracks app as user and as such also in the homey app. So multiple users will prove to be difficult. As I don't know the Synology implementation of MQTT, I can't say how to change that. Ideal would be to create a user for homey, and for each person that is in the house.
And create authorization to the topics
I would suggest to make a flow that will trigger on every event, something like:
and let it run for a while and see if you get those messages.
You really need to go out the house to get it to work. Make sure you leave the Share option in geofence on your phone enabled, otherwise those events cant be processed by the homey app.
If you want to test, you can always install something like MQTTLens in chrome and send test messages to see if the flow triggers .
But I'll leave it be an see what happens when I go to work tomorrow. Thanx for all the help.
@MennoVanGrinsven , just let me know what you want to be changed to the 1st post and I'll look into it. Or make an update instruction and I will link to it from the 1st post.
Sounds familiar ;-)
I get the status:
idle The operation couldn’t be completed. Connection refused {
"_kCFStreamErrorCodeKey" = 61;
"_kCFStreamErrorDomainKey" = 1;
Resolved!
Tags i use
<username>_home (Boolean)
home_somebody (Boolean)
home_update (Number)
OT Enter Home
This is fired everytime a user comes home and it creates the Boolean Tags with <username>_home and sets the value
OT Leave Home
When a user leaves a Geofence it sets the boolean tag to false and fires update all flow to check if house is empty
OT Update All
Checks all users if they are home if all is out it sets someone_home to false this is the only flow you have to update to check if house is empty
This is way easier to manage than the tutorial in this document - thread - since it only relies on a minimum of flows and they are not "user" specific
Of course the Send Push is not needed its only for testing - so you can remote that
I managed to set-up a private MQTT broker running on a RPI3 with dedicated users (homey and family members) and user/pass authentication for each of them. Presence detection is working well.
Would like to enable TLS authentication/encryption and have tried to follow various articles found in the internet but have not been successfull so far.
Does anyone have a set by step instruction for enabling TLS based security?
If you would consider using the MQTT Broker for Homey combined with owntracks:
https://forum.athom.com/discussion/4169/how-to-selfsigned-certificates-with-mqtt-broker-for-homey
Otherwise checkout things like letsencrypt to automatically get SSL certificates. Then configure the broker to use the key and certificate. But perhaps i am kicking in open doors.
I must do something wrong, but I can't seem to get Homey to know where I am.
I've set up MQTT on my Synology, installed Owntracks on Homey and my iPhone.
The app on my phone says I am connected, the Homey client sees my user (Patrick) and my fence (Thuis).
But on the tab "Huidige gegevens" I see User: Patrick, Fence: 'empty'
What am I doing wrong? Any settings I need to share for more info?
Thanks in advance!
Patrick
Owntracks works based on events. You either enter or leave a fence. If you create a fence and not enterer or left it yet, the status will be unknown until a leave or enter message is received for that fence.
Hoping this keeps working like it does, thanks a lot for this work!
Currently it is possible to have a trigger when a battery is low, but this is not an option in the 'and' column.
I would really like that, since I would like to use the following flow:
When #user enters 'Home' AND #percentage is under 25% THEN send push notification.
Also, I would like to have more options in the AND column regarding who is home. Now the only options are: someone present in geofence and someone nog present in geofence.
So I guess I am down to generate my self-signed certificates. Any step-by-step guidelines are appreciated. I have tried to generate those using a script from the owntracks repo
https://github.com/owntracks/tools/blob/master/TLS/generate-CA.sh
but cant get it to work...
Other Q
My owntracks app seems to publish old fences even after I delete them and create others. Any idea how to get rid of this?
Right now my girlfriend and I always know where the other is...
Depends on what you are using as a MQTT broker.
If you are not using the MQTT broker app for Homey (that one does not have ACL implemented), you could deny your girlfriend and yourself read access on the topic.
Your phones are subscribed to the owntracks topic and what a MQTT broker implements is a Publish/Subscribe mechanism. So your phones sends a message, and that messages is send to all devices that are subscribed to the topic.