Home Assistant for iOS 2.0 Beta Testing

Thank you, figured it was something like that but didn’t know how to implement it

Anyone with an iPhone XS having location issues (randomly leaves and returns to home zone several times a day even with accuracy crazy outside window)? My phone has acted this way since 1.5 beta when options for motion were added in…

robbiet480
gcobb321 here (the developer of the iCloud3 device tracker). I’ve been running v2.0 beta (along with 1.5) and the devicename vs uuid issues have obviously effected zone enter/exit notifications. As you know, iCloud3 is tightly integrated with the ios App so I’m very interested in (and effected by) everything you do. Actually, without the devicename being used in the enter/exit triggers (for example, device_tracker.gary_iphone), there is no way I can tell when a you exit a zone. BTW-I’m actually running v2.0 and v1.5 with the same devicename without any issues.

Any chance of you installing iCloud3 on your phone and keeping me up to date on any changes I need to make to it to keep it current with what you are doing. iCloud3 is here. You can contact me at [email protected] when you need to.

And, keep up the good work…

Gary Cobb

The great device_tracker ID debate is coming to a close. 0.91.4 will change the behavior of the device tracker name to use the Device ID field once more, as well as change the sensors entity IDs to be of the format sensor.mobile_app_device_id_sensor_name. This change will be in 0.91.4 which should be released in the next 12 hours. Once it is released, build 41 of the iOS app will be released. Here’s the GitHub PR for anyone interested.

7 Likes

Nope my XS is fine with zone entry and exits. Does the issue happen when you are physical in or near the zone or are you a long way away at the time?

Hi @robbiet480
I’m afraid this doesn’t appear to be resolved.
It has worked in the past and I’ve not changed my config except for the addition of mobile_app: !include iOS.yaml
I’m on 0.91.3 and 0.40b, I can arm the alarm, the disarm action doesn’t appear to do anything.
Here are both automations:

- alias: Alarm - Arm Alarm from iOS Notification
  initial_state: true
  trigger:
    # iOS 1.5 App Support
    - platform: event
      event_type: ios.notification_action_fired
      event_data:
        actionName: ARM_ALARM
    # iOS 2.0 App Support
    - platform: event
      event_type: ios.action_fired
      event_data:
        actionName: ARM_ALARM
  action:
    - service: alarm_control_panel.alarm_arm_away
      entity_id: alarm_control_panel.alarm
      data:
        code: !secret alarm_code

- alias: Alarm - DisArm Alarm from iOS Notification
  initial_state: true
  trigger:
    # iOS 1.5 App Support
    - platform: event
      event_type: ios.notification_action_fired
      event_data:
        actionName: DISARM_ALARM
    # iOS 2.0 App Support
    - platform: event
      event_type: ios.action_fired
      event_data:
        actionName: DISARM_ALARM
  action:
    - service: alarm_control_panel.alarm_disarm
      entity_id: alarm_control_panel.alarm
      data:
        code: !secret alarm_code

Here are HA logs when mobile_app is set to debug:

2019-04-12 10:01:44 DEBUG (MainThread) [homeassistant.components.mobile_app.helpers] Successfully decrypted mobile_app payload
2019-04-12 10:01:44 DEBUG (MainThread) [homeassistant.components.mobile_app.webhook] Received webhook payload for type fire_event: {'event_type': 'ios.action_fired', 'event_data': {'actionName': 'ARM_ALARM', 'actionID': '1DB38935-7AAB-45C0-802D-YYYY95DC9CE2', 'sourceDeviceName': "Lolo's iPhone", 'triggerSource': 'watch', 'sourceDeviceID': 'lolos_iphone_beta', 'sourceDevicePermanentID': '8582D724-xxxx-43A1-97DC-5F0F79F44CF0'}}
2019-04-12 10:01:47 DEBUG (MainThread) [homeassistant.components.mobile_app.helpers] Successfully decrypted mobile_app payload
2019-04-12 10:01:47 DEBUG (MainThread) [homeassistant.components.mobile_app.webhook] Received webhook payload for type fire_event: {'event_data': {'actionID': '7A3251F1-FBEC-40CD-8011-ZZZZDCD808C3', 'triggerSource': 'watch', 'sourceDevicePermanentID': '8582D724-xxxx-43A1-97DC-5F0F79F44CF0', 'sourceDeviceName': "Lolo's iPhone", 'sourceDeviceID': 'lolos_iphone_beta', 'actionName': 'DISARM_ALARM '}, 'event_type': 'ios.action_fired'}

Only thing I can see is the order of the JSON values which I would have thought would not have any impact?

[EDIT]
the actionName for teh DISARM_ALARM has a trailing space, probably from a previous time when I created it, as the current action doesn’t have the trailing space
Editing actions is an issue i’ve had since the first release of the beta. I can add actions, remove actions, and can edit them in the app, but can only add actions to the app. It seems editing or deleting them does not get reflected in the watch app. I need to delete both apps and restart from scratch…

Usually in middle of zone… I’ve changed my home zone radius from 75m to 200m and it still hits outside at least once a day. I’m also confused because when it does occur it looks as if the accuracy is horrible (think the default accuracy acceptance range for a point is 200m in the app) it still publishes as valid. The acc. of the screenshot above is listed at ~6000m but I still get an exit/entry?

Hi. My NGINX configuration is for something like 6 subdomains.
I run all my system on an Unraid server with a custom docker from Linuxserver.io maybe it’s a bug in there custom container or at my config or networking rules.

I been try so many things to fix this error. And this one is the only that fix it. I generally its 90% as the NGINX config on Home-Assistant website.
My config setup listed here: https://github.com/VirtualL/HomeAssistant-Config

I you want to get deep into it, PM Me and I will send you all my Nginx config files including SSL /PROXY CONFIG
Thank you for all the great work!

That GPS accuracy sounds pretty terrible. I’m currently at work sat in a metal box surrounded by tall buildings and I am getting 65 m. To me it sounds like a hardware issue, how do Google Maps etc. perform?

@pplucky I get this issue too. I even tried an entirely clean version of HASSIO.

When I was was writing the iCloud3 device tracker, I kept running into the GPS wandering problem that was causing zone exits which started automations in the middle of the night. The problem, from what I could tell, was caused by Background Fetch notifications that contained old location data or data with poor GPS accuracy that was then processed by several components in HA that just assumed that all of the data is accurate.

A very detailed description of how HA processes these notifications is here.

The solution to eliminating this problem is to not trigger automations based on device state changes but to trigger them on zone changes that are not tied directly to HA. iCloud3 discards notifications that are old or have poor GPS accuracy and puts the device back into the zone. It also creates ‘zone’ and ‘last_zone’ template sensors That are only updated by iCloud3 and are not effected by incorrect device state changes,

ICloud3 is tightly integrated with the ios app, minimizes battery usage, uses the Waze Route Calculator service to determine drive times to home, creates Dynamic Stationary Zones, eliminates the need for other location components (Owntracks, Nmap, etc) and provides a lot of other features.

Check out iCloud3 here.

Is this what I should be putting in !secrets in place of the device ID?

If not, where should I be using it?

Desperately trying to get push notifications running again.

I have mobile_app: in my config.

You should only need to load mobile_app:. Then in you should see a service in the form of notify.mobile_app_DEVICE_NAME_SET_IN_iOS. It can take couple of restarts to get it to show. I found that losing the component followed by a HA restart, then connecting with the iOS app and pushing location followed by a final restart of HA works nicely.

This will cease to be true after build 41, when the service will switch to notify.mobile_app_DEVICE_ID_SET_IN_APP

1 Like

I have this notify.mobile_app_ash_x and after several restarts the app is still showing that the component is not loaded.

The appstore (1.5) version is working fine though. I understand they can exist side by side.

Well, one more restart did it. Component now loaded.

Do I have to replace all of my old ios notification service calls with the new one then?

Brilliant. Yes you do, bit of short-term pain for long term gain, as is beta life. One thing to note is that sounds are not played by default anymore and you need to include them in the payload. For example I use this in one of my automations:

      - service: notify.mobile_app_toms_iphone
        data:
          title: "Washing Machine"
          message: "The washing machine has now finished"
          data: 
            push: 
              sound: default

Thank you. That fixed it.

Are there sound options? What is the default?

Default is what I think of as the normal notification sounds, same as previous app defaulted to and messages uses by default. There are more, there is a list here:

So I have all my notifications set up on the new beta and set up the sounds and all works great…for a short period of time. Notifications, for a reason I can’t figure out stop working randomly. I’ll get an error in the log that says “Requested Entity not found components/mobile_app/notify.py”. When I go into the dev panel it still shows my mobile app in the notify list but won’t display any test notifications until I go into settings and “push configuration settings from server”. Why does the config settings keep changing randomly requiring it to be imported again? Anyone else experiencing this? I’ve uninstalled and reinstalled, rebooted and nothing seems to fix it. Any suggestions? Thanks