Ariela - Home Assistant Android Client

Okay, here is all the lines I could find in the log (can’t remember what level I have it set to). I have removed everything I could see as unsafe to share :slight_smile:

2019-06-19 17:22:05 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.####] Received {'type': 'call_service', 'domain': 'notify', 'service': 'mobile_app_ABCD_phone', 'service_data': {'message': 'test'}, 'id': 29}
2019-06-19 17:22:05 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=notify, service=mobile_app_ABCD_phone, service_data=message=test>
2019-06-19 17:22:05 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.####] Sending {'id': 2, 'type': 'event', 'event': {'event_type': 'call_service', 'data': {'domain': 'notify', 'service': 'mobile_app_ABCD_phone', 'service_data': {'message': 'test'}}, 'origin': 'LOCAL', 'time_fired': datetime.datetime(2019, 6, 19, 21, 22, 5, 278489, tzinfo=<UTC>), 'context': {'id': '#############', 'parent_id': None, 'user_id': '###############'}}}
2019-06-19 17:22:05 DEBUG (MainThread) [homeassistant.components.http.view] Serving /api/webhook/################ to X.X.X.X (auth: True)
2019-06-19 17:22:06 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.####] 0, message='Attempt to decode JSON with unexpected mimetype: '
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/components/websocket_api/commands.py", line 121, in handle_call_service
    connection.context(msg))
  File "/usr/src/app/homeassistant/core.py", line 1150, in async_call
    self._execute_service(handler, service_call))
  File "/usr/src/app/homeassistant/core.py", line 1172, in _execute_service
    await handler.func(service_call)
  File "/usr/src/app/homeassistant/components/notify/__init__.py", line 112, in async_notify_message
    await notify_service.async_send_message(**kwargs)
  File "/usr/src/app/homeassistant/components/mobile_app/notify.py", line 119, in async_send_message
    result = await response.json()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 1027, in json
    headers=self.headers)
aiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: '
2019-06-19 17:22:06 DEBUG (MainThread) [homeassistant.components.websocket_api.http.connection.####] Sending {'id': 29, 'type': 'result', 'success': False, 'error': {'code': 'unknown_error', 'message': "0, message='Attempt to decode JSON with unexpected mimetype: '"}}

I honestly don’t see much more than what the traceback already showed.
Hopefully you or @Ionut can get something more out of it.
If not, I think I might have to debug the app and pull the log for @Ionut.

Thanks again!
DeadEnd

I did try to hack it and modify the notify.py in mobile app changing:

response.json()

to

response.json(content_type='application/json')

That didn’t help, lol.
I guess if the returned type isn’t correct, changing the receiving end won’t fix it.
But it was worth a try, and helped me learn more.

That’s not gonna work, yeah. Has to be changed from server side.

I was just able to get the updated version (not sure why it took a bit longer on PRO).
It appears my notifications are working now!!!

I’m not sure what changed - and at this point I don’t care :smile:
I hope maybe it was something in the small other fixes… but I’m happy.

Thanks again for you great work!
DeadEnd

1 Like

Hello,

i am really confused about the tracking option : when Device Tracker is on : Ha see i am home, but if i cut the wifi, thats dont change anything, still see “home” in HA, but i have the option “Home Wifi Networks” ON, and it doesnt work.

Does i need to disable device tracker or let it enable + Device tracker-Mobile APP for it work?

I put Tracking Mode “Wifi”, not GPS, but it doesnt change anything…

In the log i have this error for a while, but dont succeed to delete it :

Entity id already exists: device_tracker.galaxy_note8. Platform mobile_app does not generate unique IDs

Thanks again for your help @Ionut

Does the Ariela reconnects using 3G / 4G?

What is the use of the bell and microphone icon in the Ariela homescreen?
Notifications that I send to Ariela don’t appear in there, so apparently it is meant for something else. And clicking the mic icon opens Google Assistant listening screen, but I don’t yet understand what is the purpose of it.

The bell icon will open the notifications screen, same like what you have in Home Assistant. The mic icon will start voice recognition process, and what it detected it will send to HA via MQTT.

1 Like

Hello, yes with 4g

Send me the logs so i can investigate.

1 Like

Ok thank a lot

1 Like

My experience has been this:
If I leave my home network, and Ariela does NOT have access to HA (no external connection) it does not update. I believe this is because Ariela cannot reach HA to update status.

If I leave my home network and Ariela DOES have access to HA (external connection) HA correctly updates me as away.

So the only way mine works is to have external access to HA.
For me this is not a problem because I have my mobile setup with a VPN at all times to home network. When I leave my home WIFI the VPN keeps me connected to HA. Therefore Ariela can update the status. If you do not have a VPN or something like DuckDNS, etc. to be able to reach HA from outside your network, I do not believe Ariela will be able to update your status.

Ionut et al. If I am wrong on this please let me know.
This has been my experience.

DeadEnd

Works fine using the nabu casa url as well.

Of course this is how it works. Ariela has to communicate with HA somehow to tell it where you are…

Indeed, this is how it works. What you can do if you do not have external connection setup is enable the Ariela availability sensor(the one that tells the last time Ariela communicate with HA). With this sensor you can make an automation like: If Ariela didn’t communicate with HA for let say 10 minutes, set the device_tracker entity to away. :smiley:

I said it that way in case there was something like MQTT availability that would actually update to away if you were off network. Since I’m not 100% sure I temper my answer with a grain of doubt.

Thanks for confirming.

With that in mind, I expect someone who wanted to could actually do something like that with MQTT so that if they went off the home network, it would update to away… not that I would want to do that, but I’m sure it could be done as a work around for someone who didn’t have/want external access.

and just as I type this @Ionut gives the example.
I need to type faster :smile:

Then you would have to expose your MQTT instance.

I am still very new to all these systems, so again, I could be wrong.
Couldn’t you use a Last Will and Testament message for this?
So when your mobile is no longer connected, MQTT broker publishes the LWT message?

For reference, I was playing with Node-Red MQTT broker configuration node.
Here you can set a birth, close, and will message.
The will message is published when it unexpectedly disconnects.

I don’t think Ariela has this setup currently, this is more of brainstorming for understanding on my part I guess. But it would be possible correct?

In the case of MQTT maybe its possible, but keep in mind that device tracker do not work over mqtt :slight_smile:

You would get very inaccurate results. At that point, you just use something local like ping device tracking.

ahem.

It actually works quite well. :wink: