Home Assistant Community

Count persons at home and show on icon badge

#21

You shouldn’t need that |int bit anymore.

1 Like
#22

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"
#23

You’re getting the default sound still?

#24

yes, I guess it is the default sound.

#25

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

#26

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

#27

Finding the same problem with sound.

#28

Any solution to this yet?

#29

any news regarding this sound issue?

#30

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

#31

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

#32

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

#33

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 }}

#34

thanks :slight_smile:

#35

Is the use of “delete_alert” not allowed any more? I just want an icon badge without any message, but after the latest updates I get a push “delete_alert”

#36

Pretty sure it’s delete_badge…

#37

I tried this but then I just get a push notification “delete_alert”

  • service: notify.notify_group
    data_template:
    message: “delete_badge”

I tried with emty quotation marks “” and then no message is sent but I get the following error:

ERROR (Thread-9) [homeassistant.components.ios.notify] No message parameter was found in the notification payload.

As mentioned earlier in this post I only want the number on the icon badge without any message.

#38

Sorry the message to send is “clear_badge” not delete_badge.

#39

You can even further simplify. I would also recommend to use entity ‘person’ with 1-to-n device trackers. This avoids double counting if you have several devices trackers per person.

  people_at_home:
    entity_id:
      - person.01
      - person.02
      - person.03
    friendly_name: "How many people are at home?"
    value_template: >-
      {{ states.person | selectattr('state', 'eq', 'home') | list | count | int }}
#40

thanks. I will try it out