Push message to only users who are home?

Is it possible to make homey send a push message to only the users who are home, or the other way around? Without having to make flow for every user?

With standard flows I’m not aware of any other way of doing it.

With advanced flows on Pro it’s quite easy to just make a single flow that combines a ‘sub flow’ per user. You can create a single flow like this that’s triggered by a “flow started with text tag” and use the text tag as the message for each push message card. Then wherever else you need to do this from other flows you can use the “start flow with text tag” card to send your message to your “push to whoever is home “ flow

You can create a HomeyScript and use the following code to send a notification to all users that are away:

push-away.js

const users = await Homey.users.getUsers();
Object.values(users)
  .filter(({present}) => !present)
  .forEach(user => {
    Homey.flow.runFlowCardAction({
        uri: 'homey:manager:mobile',
        id: 'push_text',
        args: {
          user,
		      text: args[0] || 'Hello World'
        },
      });
  });

To send one to all users who are present, remove the ! in front of !present

afbeelding

I just found this 3yo topic.

I c/p the the script into push-away.js

I made a flow that run the push-away, but nothing happend. No push notification. to eather present of absent users.

I use Homey Pro Early 2019, v.13.5.1

Homeyscript v3.6.3

What do i wrong?

For the push notification cards, there’s more options to select from nowadays:

thank you for the quick reply.

I do not have the option to select Everone/Everyone at home/Everyone away.

Is that an option for newer Homey Pro? I have Early 2019.

I think this was released only for the 2023 and newer models. It’s mentioned in the change log of those models:

I don’t have it either. I also have a Pro 2019

Ah, I didn’t expect this to be unavailable for the 2016-2019 models.

A while ago, I did it in the same way as Jonathan described above. However, this requires advanced flows.

So, a flow containing a few cards with the ‘rules’ for sending messages to specific users, which is then called by another flow using a text tag with the message text.