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
2 Likes