Ariela - Home Assistant Android Client

@Petrica how did you do that? I think I am missing where to insert the parameters…
HA can connect to my MQTT broker (that is internal) the MQTT broker connects to an external broker and set the message forwarding (two ways) in my case. When I am outside my network I can send the messages from the external network. I don’t see how you made it.

That’s the plan. Still, i do not know / imagine how to show the MQTT options without being connected to HA. It will be more like a separate app. Guys what do you think, how we should handle this case?

Hehe, and this is not all, and this is a teaser of what will be next: → Android TV support → Ariela installed → ability to turn off / turn off the device, ability to send a notification to it like someone on the door and display on TV, → ability to show directly on your TV that someone is on the door (and many many other possibilities)

If anyone like the app that much and want to support the development Patreon can be used also: Ariela | creating the best user experience for Home Assistant on Android | Patreon

Like i said before, Ariela uses HA in order to send messages to MQTT broker. Ariela do not have a direct connection to it.

That’s the plan. But i a bit worries on how the Ariela should handle things if the HA server is not accessible but the MQTT server is: same like in the example → MQTT is exposed externally, HA isn’t. What should Ariela do in this case? What should show in the UI? This is what i cannot imagine for now. Maybe someone have an idea? :smiley:

I will answer: he didn’t manage to do it. Like i said before, HA connection is required to make MQTT calls, so if Ariela is not connected to HA then no updates will be send to MQTT.

Sorry if my reply was misleading (I didn’t want to imply that Ariela directly connects to MQTT broker).

The triple NAT part was in regard of how Ariela connects to HA instance thus regardless of how many layers are in between, if HA is accessible from outside the lan, then Ariela can connect to HA and HA can publish MQTT messages.

Device tracker does not work for me. Only connect when at home. If I turn off WiFi it still tells me I am at home. Never changes.

Tried this. No change.

Data obtained from Node-Red

{
	"topic": "device_tracker.motog6",
	"payload": "home",
	"data": {
		"entity_id": "device_tracker.motog6",
		"state": "home",
		"attributes": {
			"source_type": "gps",
			"latitude": xxxxxx,
			"longitude": xxxxxx,
			"gps_accuracy": 100,
			"battery": 79,
			"friendly_name": "motog6"
		},
		"last_changed": "2019-01-10T18:57:05.396428+00:00",
		"last_updated": "2019-01-10T18:57:05.396428+00:00",
		"context": {
			"id": "f8bd0f1d9b30496090613ee899ba7b9c",
			"user_id": null
		},
		"timeSinceChanged": "3 minutes ago",
		"timeSinceChangedMs": 178316
	},
	"_msgid": "87d6239f.323b3"
}

@ baz123
I had the same problem, try this:

Please enable the debug mode and send me the logs so i can investigate. Thank you.
Also what you can try is : disable device tracker in Ariela and stop your HA server. After that open known_devices.yaml and delete your device, save the modifications, start the server. Open Ariela and enable device tracker and check if works.

Yes that was the instructions I quoted.

[edit] Do you have access only when on home WiFi?

[Edit 2] Do you have any entry for this device in your configuration files?

So after you turn of the WiFi then your 3G/4G connection steps in correct? In this case in order to reestablish the connection to HA the external access must be configured(else the new status cannot be send if the Ariela not connected to HA). Can you confirm you have the external access configured? Also can you enable debug mode and replicate the issue and send me the logs so i can investigate? Thank you.

No I don’t. If that is a requirement then this should be stated (it is not an unreasonable requirement).

Perhaps the solution is to create an MQTT device tracker that can be setup in HA. I think that if the MQTT messages stop reporting it is home, it will mark you as away.

It doesn’t though report when it was last updated correctly even when on home WiFi.

Well the way it works Ariela is:

  1. configure it on your local network and Ariela will work only on your local network. This means if you turn off wifi or you connect to another Wifi which is not on your home your HA connection will be closed and Ariela will be unable to communicate with the server (no updates will be send to server or received from the server and in your case Ariela cannot tell HA that you are not home anymore).
  2. Configured external(this means your server must be accessible externally):
    This means that when you will be on other networks then your home one or use 3G/4G, Ariela will going to connect to HA using the informations provided when configured externally.

Example: HA server is running on http://192.168.1.100:8123 and Ariela was configured to that IP and Wi-Fi name = “MyWiFiNetwork”
Externally configured on: http://myhouse.myserver.com:8123

In the case of 1) Ariela will be able to connect to HA only if the current Wi-Fi that the phone is connected is “MyWifiNetwork”

If Ariela is not connected to MyWifiNetwork, then if configured externally, http://myhouse.myserver.com:8123 will be used to communicate with the server.

Please let me know if you have other questions.

hmm, thats a very strange approach.
so you connect to HA,
use ha to send messages to mqtt
then HA discover that message and changes the sensor values.

for what is the mqtt setup in the app then?

shouldnt it be:

ariela sends messages to the mqtt server
HA picks up the mqtt message and translates that to sensor values

??

if mqtt is used for the device tracker then ariela shouldnt worry if HA is down or unreachable. it should just send the state to the MQTT server. (same for all other sensors)

so you give people a choice: send states over API or over MQTT
if possible you could give them options like:

  • send to MQTT when API unreachable
  • send to API when API available
  • send to MQTT when not in home network
  • etc

or you autoconfigure it like:

if ‘mqtt option selected’ and ‘mqtt available’ then ‘send to mqtt’
elif ‘API available’ then ‘send to API’
else ‘dont send’

If i choose lovelace ui from the settings i get NO card visible on my device.
Maybe i am wrong in something?

Its kinda working like that. :slight_smile:

There is not MQTT setup in the app anymore. It was at first when Ariela actually worked like this (Ariela → MQTT server → HA). But now Ariela will use the HA forward MQTT messages to the broker so no need for a setup.

MQTT is not used for device tracking at the moment

That’s the plan in a way or another but things are a little more difficult:

  1. You will have to configure MQTT for both internal & external access (most people don’t do it)
  2. Let’s say MQTT is connected externally, HA is not, then what user should see when it opens Ariela? And i think viceversa is applying too.
  3. MQTT will be another connection will will drain battery faster :slight_smile:

Can you enabled debug mode and send me the logs so i can investigate? Thanks.

How to send you log? Where it is stored?

  1. no you could give them the option for both, but you only use it if it is available
  2. the users sees a message like: “HA isnt available at the moment, but if you have external mqtt setup ariela will still send sensor values” (i must say that its actually a bit annoying that when HA isnt connected i only get a message to try to connect, but that i cant change any settings in ariela, the app should work with or without connection to HA)
  3. no mqtt wont drain any battery power more then API. you dont need to listen to mqtt, so it doesnt make a difference if you use ‘send to api’ or ‘send to mqtt’

You will find in on your phone in a file called: ariela_logfile.log

Got it. Anyway i will put everything on paper and i hope something cool will came up. Thank you very much for the suggestions.

you can always pick my brain if you like. :wink:
there is another big advantage if you send to mqtt directly:
the info will be available on any other platform that wants to use it (for instance appdaemon, but also all other HA like programs) even if HA isnt reachable.

i could create a python app that listens to ariela and that decides how to notify me when HA is having a problem.
if i am home, then it tells me there is a problem over alexa, if i am not home it sends me an email

I hope this can be implemented. Maybe this way we can get rid of the permanently annoying notification this way as well?

It will surely be implemented. As far of notification not a chance. In order to keep services started a notification must be shown. Still if you do not like the notification you can still enable the permanent notification in ariela, but from phone settings → apps → ariela → notifications you disable from there. In this way, Ariela will be able to keep the connection with HA and run in background and notification will not be shown. Please let me know if works.

Can you tell me where to send the logfile?