# Sending notification will not work in Homeyscript

**URL:** <https://community.homey.app/t/sending-notification-will-not-work-in-homeyscript/79235>\
**Category:** Developers\
**Created:** [April 13, 2023, 6:02pm UTC](https://community.homey.app/t/sending-notification-will-not-work-in-homeyscript/79235 "2023-04-13T18:02:11Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Colin\_Osborne](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/colin_osborne/32/79809_2.png) [@Colin\_Osborne](https://community.homey.app/u/Colin_Osborne)\
**Post date:** [July 15, 2023, 2:42pm UTC](https://community.homey.app/t/sending-notification-will-not-work-in-homeyscript/79235/8 "2023-07-15T14:42:18Z")

</div>

On HomeyPro early 2023 version 10.0.0-rc.122, I found it necessary to give both “athomID” and “id” parameters for a successful push\_text.

Example code:

```auto
// Tested using versions:
// - Homey Pro (Early 2023), version 10.0.0-rc.122
// - Homey Web App version 1.9.58

// Status as of 15-July-2023: working
// send message to specified user, or if none specified, then first user in getUsers list

var user_name = (typeof args[0] === 'string')
  ? args[0]
  : '';

var user_athom_id = null;
var user_id = null;

if (user_name.length) {
  log('Looking-up user:', user_name);
} else {
  log('No user name specified, so will take first user from getUsers list');
}

log('Get user details');
users = await Homey.users.getUsers();
var found_user = false;
for (const user of Object.values(users)) {
  log(user.name, '; id=', user.id, '; athomId=', user.athomId);
  if ( (!user_name.length || (user.name == user_name)) && ! found_user) {
    if (!user_name.length) {
      user_name = user.name;
      log('Using first user from getUsers list:', user_name)
    }
    user_athom_id = user.athomId;
    user_id = user.id;
    found_user = true;
  }
}

var notification_text = `'Saying hello to ${user_name}'`

if (!user_id) {
  log('Failed to find user: ', user_name);
} else { // user found
    log('Sending push message to:', user_name, '; id=', user_id, '; athomId=', user_athom_id);
    await Homey.flow.runFlowCardAction(
      {
        uri: 'homey:manager:mobile',
        id: 'homey:manager:mobile:push_text',
        args: {
          user: {
            athomId: user_athom_id,
            id: user_id
          },
          text: notification_text
        },
      }
    )
    .then(() => log('runFlowCardAction OK'))
    .catch(error => log(`runFlowCardAction Error:`, error));
}

```

---

_[View the full topic](https://community.homey.app/t/sending-notification-will-not-work-in-homeyscript/79235)._
