Notify Mobile Companion App Devices

Ok, So I imported the blueprint and it now show that it has got no inputs (“Diese Blaupause hat keine Eingaben.” in my German HA) and thus doesn’t work. It also looks corrupt (see screenshot) and lots of YAML code appears.

How can I fix this?
I really like your Blueprint but it just doesn’t work…

Best regards
Aaron

take a look in the scripts . There you can find it :wink:

1 Like

Ah, now I understand…
I have to call the service for the script and can then set the parameters in the service call

Thanks for your help, @fisch55

1 Like

Mmm… Interesting :thinking: Can you validate the following:

  1. After importing the file, the file is stored in config/blueprints/script/Grumblezz/notify_devices.yaml
  2. Go to Settings > Automations & Scenes > Blueprints is the file there?
  3. When clicking on the 3 dots and then Show scripts using this blueprint does this show a script?
  1. yep, file is present
  2. yes
  3. nope

When clicking "Create script’ from the blueprint, the screen shows your info but on the bottom it says ‘This blueprint has no inputs’. Is this correct?
I don’t see any of the GUI config options you are mentioning in this forum post.
Does the blueprint contains bug that causes to load only the first bit of the blueprint?

So what happens if you click on the Create Script (in that drop down with the three dots) and then press Save Script?
This should create the script with a random script name, like script.1689154272736.
Does that work? Because maybe your input is not allowed by Home Assistant.

Found it…
I didn’t have a !include script.yaml in my configuration.yaml file.
The scripts I tried to make did get saved to the file, but weren’t shown in HA.
After including scripts.yaml I got 20+ Notify Mobile scripts in HA :face_with_hand_over_mouth:

Thanks for the patience!!!

1 Like

Just released: Release 2023.07 · Grumblezz/Home-Assistant-Notify-Mobile-Companion-App-Devices (github.com)

This version adds new options for Android Auto :robot::red_car: (Android Devices only):

  1. Added the car_ui: true when the device is Android and when the android_auto binary sensor is on, so you can interact with the notifications whilst driving. Introduction | Home Assistant Companion Docs
  2. Added a new option: Android Only - Notify using TTS whilst using Andriod Auto? (Optional) This “upgrades” the notification message to a TTS message, when the binary_sensor.###_android_auto is on. This can be useful whilst driving with Android Auto that the notification that you are sending is announced via TTS.
  3. The blueprint now contains a input Android Only - Enter a custom Text to Speech text used to announce the actions, when your device is connected to the Android Auto. .

This 3rd option is only relevant if all of the following are true:

  • Your using a Android phone
  • You enabled the new option Android Only - Notify using TTS whilst using Android Auto? (Optional)
  • Your Android phone is in the Android Auto mode (when the binary_sensor.###_android_auto is on)
  • When you have actions defined, that could require action from the user

This new feature allows you to hear the Text to Speech message, receive the notification and the possible interact with actions that you could take. The input field is useful to customize the TTS message in the desired language. The format to use is as follows:
message+announcement+actions
Only the announcement part is needed as the input to introduce the actions.
Examples:

  • Select 1 of the following actions on your phone
  • Selecteer 1 van de volgende acties op je telefoon

Use case example

service: script.notify_devices
data:
  notify_message: The alarm is turned off
  data_tag: alarm
  data_channel: Alarm
  data_group: Alarm
  data_sticky: true
  data_importance: high
  data_timeout: 300
  notify_title: Alarm • Off
  data_notification_icon: mdi:shield-lock-open-outline
  notify_home_or_away: Both
  data_clickaction_url: /dashboard-alarm/alarm
  data_notification_color:
    - 0
    - 173
    - 0
  data_persistent: true
  notify_in_car_using_tts: true
  data_actions: >-
    {{iif(is_state('binary_sensor.alarm_night_mode','off'),[{'action':'RESUME_NIGHT_ALARM','title':'Enable the night alarm'},],'')}}

This would result in the following TTS message:
The alarm is turned off. Select 1 of the following actions on your phone: Enable the night alarm

1 Like

Unfortunately, your script does not work with one of my device trackers, although the regular notification in HA does work:

Logger: homeassistant.components.script.notify_mobile_app_devices
Source: helpers/script.py:420
Integration: Skript (documentation, issues)
First occurred: 10:45:04 (12 occurrences)
Last logged: 11:46:44

Notify Mobile App Devices: Repeat at step 2: Error executing script. Service not found for call_service at pos 3: Unable to find service notify.mobile_app_pixel_5_4
Notify Mobile App Devices: Error executing script. Service not found for repeat at pos 2: Unable to find service notify.mobile_app_pixel_5_4

What is wrong with this tracker? This tracker exists and yields to the gps position of the device. Any help is appreciated :+1:

It looks like that for some reason your device is not recognize as notify.mobile_app_pixel_5_4 so what should be the correct service name?

How do I get it?

Several options:

  1. In the developer mode → Service
  2. Create a dummy script/automation and use the Call Service

And the check what the correct name is. Like notify.mobile_app_...

The correct service is
service: notify.mobile_app_pixel_5

How do I change it in your script?

So the script does a find and replace of the device_tracker, into the notify service. This is done since there is no feature to discover the services of devices (that I’m aware of). So as an example:
device_tracker.androidnotify.mobile_app_android
device_tracker.iphone_123notify.mobile_app_iphone_123
Ect…

So my suggestion is to rename your device_tracker entity so it aligns with the notify service, until Home Assistant comes with a better way to get the services of a device.

To be honest, I do not know how to rename it as I have four device trackers for the device, such as

device_tracker.pixel_5
device_tracker.pixel_5_2
device_tracker.pixel_5_3
device_tracker.pixel_5_4

So what is the correct tracker and which one I should rename to what?

When I try to start the program after installation it comes with ‘Response error: 500’ i.e. right after ‘Save Script’ the first time, there are some who have a solution. I am using ‘Watchman report’ which shows the error 'script.notify_devices [missing] and ‘lock.caf [missing] notify_devices.yaml’

What I would suggest (and others feel free to add your thoughts on this) to do is to remove the integration, then search for any other integrations which create these device_tracker. Once done then install it again/register your device, so it hopefully create the correct tracker with the correct notification service:

  1. Remove your Device from Home Assistant in your mobile app Open your Home Assistant instance and open the settings of your companion app.. SettingsCompanion App → Select your Home Assistant instance (like Home ) → Scroll to the bottom and select Delete

  2. Open your Home Assistant instance and open the Mobile App integration Open your Home Assistant instance and show an integration.

  3. If your device is still listed then use the three vertical dots and use Delete,

  4. Search in the Open your Home Assistant instance and show your entities. list for the device_tracker.pixel_5(s) and see if can remove those from the corresponding integration (maybe a network integration?)

Once those are removed then validate the notify service:

  1. Navigate to the Developer ModeServices Open your Home Assistant instance and show your service developer tools. and search for the notify.mobile_app_###
    Now these services should not exist anymore.

  2. Reboot and validate it again (step 3, 4 and 5). Are the device_tracker.pixel_5(s) and notify.mobile_app_### now really gone? If not then check step 4

  3. Register your device again in the app Open your Home Assistant instance and open the settings of your companion app.

  4. Enable the other integrations again, so the other device_tracker(s) are created again.

I hope that it helps… Good luck! :crazy_face: :sob: :robot:

script.notify_devices is purly an example, and Watchman picks up those examples, without validating. So I would not focus to much on that.

dummylabs/thewatchman: Home Assistant custom integration to keep track of missing entities and services in your config files (github.com)
The integration has very simple internals, it knows nothing about complex relationships and dependencies among yaml configuration files as well as nothing about the semantics of entities and automations. It parses yaml files line by line and tries to guess references either to an entity or to a service, based on the regular expression heuristics. The above means the integration can give both false positives (something which looks like a duck, swims like a duck, and quacks like a duck, but is not) and false negatives (when some entity in a configuration file was not detected by the integration). To ignore false positives ignored_items parameter can be used (see Configuration section below), improvements for false negatives are a goal for future releases.

Now, continuing… Is the file downloaded?
image
Please ignore the number 2 :nerd_face:

Is it shown in the blueprints section? Open your Home Assistant instance and show your blueprints.

What you’re asking for is correct on my end, but notify_devices.png doesn’t exist. I’m using Home Assistant 2023.8.2. The only thing I can see when I enter ‘Studio Code Server’ is “[{
“resource”: “/config/blueprints/script/Grumblezz/notify_devices.yaml”,
“owner”: “generated_diagnostic_collection_name#0”,
“severity”: 8,
“message”: “Incorrect type. Expected “object”.”,
“source”: “yaml-schema: http://schemas.home-assistant.io/blueprint-script”,
“startLineNumber”: 1132,
“startColumn”: 17,
“endLineNumber”: 1132,
“endColumn”: 34
}]”

And the same for line 1170.

The three files will there whenever you would download the release from Github, otherwise if you used just the import option button in HA then only the notify_devices.yaml is downloaded.
Just the notify_devices.yaml is sufficient, because that is the actual blueprint.

Could you validate that the file content is identical to what is on Github?
Because the warning unfortunately does not mean me anything this far.

Secondly could you answer this?