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

1 Like

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

2 Likes