Device selector not permitted to be blank since 2023.11

Since 2023.11 additional validation is placed on the device selector.

It no longer works with a default of false (probably rightly so) but the advice is that a default of '' should work.

In my testing with this blueprint it seems this is not the case and it requires a valid device to be selected. image

The relevant selector is at line 71 and note I have tried single and double apostrophe’s with no change.

    notify_device:
      name: Mobile Device
      description: Select a device that runs the official Home Assistant app to receive notifications. If you wish to notify a group of devices or and Android/Fire TV use the field below to override this selection. This can be left blank in that case
      default: ""
      selector:
        device:
          integration: mobile_app

add a notify_device: !input notify_device variable.

Then in your condition for the notify_device…

                      - conditions: "{{ not group_target and notify_device }}"

Unfortunately not seeing any change in behaviour there. Also not sure what the link is to be honest so maybe I’m missing something?

Try a default of None instead then without the extra variables and checks that you added before.

image

It only seems to like having a valid device selected.

Yes, there has been discussions w/ this. It seems there is no fix at this moment. I’m not sure when a fix will happen but people are aware of this problem. This is only an issue because you’re using the notify service which can’t be templated.

I think your only recourse at this time is to try out using the following template w/ the notification service if they use a device.

  group: !input notify_group
  notify_device: !input notify_device
  group_target: >
    {% if group %}
      {{ group | lower | replace('notify.', '') | replace(' ','_') }}
    {% elif notify_device %}
      mobile_app_{{ (device_attr(notify_device, 'name_by_user') or device_attr(notify_device, 'name')) | slugify }}
    {% endif %}

Any news on the corrected blueprint? Lost notifications from the cameras…

if you just swtich from the notify service to the device notification, it’ll work. Or just remove the device action notification all together from the blueprint.

otherwise, he has to implement the templates I posted above while removing the device action notification all together.

I haven’t had time to understand what the template is doing yet.

But @Mikescotland all you have to do is select a device. The group still overrides individual devices as it always did so literally nothing changes with the output if the automation.

It just takes the device_id and creates the notify.mobile_app_... service from it. Nothing special. Just means you can completely remove the device based notification action.