Count persons at home and show on icon badge

A fix has just been rolled out server side to coerce badge to int.

2 Likes

Awesome thank you.

Is it now possible to use a template to set the badge?

@jeppper I just tried it and it works!! Thanks @robbiet480

  - alias: 'Send Templated App Badge'
    initial_state: on
    trigger:
      - platform: state
        entity_id: input_number.testing_app_badge
    action:
      - service: notify.ios_jeremys_iphone
        data_template:
          message: "Testing"
          data:
            push:
              badge: '{{states.input_number.testing_app_badge.state|int}}'

Yes now it Works!! :slight_smile:
Now it would just be perfect if it would be possible to have the numbers on the badge showing without the need of a message.
former post “badge not working” in iOS category

You can now send a push with message set to delete_alert to not show a message.

2 Likes

You shouldn’t need that |int bit anymore.

1 Like

Nice.
The message is gone but I still get the notification sound, even though I hashtagged it.

action:
  service: notify.ios_notify_group
  data:
    message: delete_alert
    data:
      push:
        badge: 0
#            sound: "solemn.mp3"

You’re getting the default sound still?

yes, I guess it is the default sound.

You might be able to disable it by doing sound: "".

no change. I still get the sound.
I tried to update notification settings in the app and restarted the iPhone.

Finding the same problem with sound.

Any solution to this yet?

any news regarding this sound issue?

Hi. Did you had any change to look at this sound issue yet?

Sound is nothing by default in 2.0 now. So this should be working for you.

great… I will try it out. Thanks :slight_smile:

try this

{{ states | selectattr("entity_id","in", ["device_tracker.person_1", "device_tracker.person_2", "device_tracker.person_3", "device_tracker.person_4"] ) |selectattr("state","eq","home") | list | count | int }}

thanks :slight_smile: