Dear developers
I hope somebody can point me to the right direction.
I have started me first homeyscript adventures but I struggle with notification.
I have written a homey script which will be started at 17 o’clock. It’s looking for all plant and those having not enough water will be published at the console. That’s working fine.
Now I add a demo code for getting a notification on mobile, too.
But this part is not working. (athomID I have replaced by XXXX)
Do I miss something ? Can I not send a notification out of a script ?
Thanks for your help
Pflanzenabfrage.js
// Get all devices
const devices = await Homey.devices.getDevices();
for (const device of Object.values(devices)) {
// If this device isn’t available, skip it.
if (!device.capabilitiesObj[‘measure_generic.water’]) continue;
// If this device is a sensor (class)
if (device.class === ‘sensor’) {
if (device.capabilitiesObj[‘measure_generic.water’].value === ‘Low’) {
log(\n ${device.name} braucht Wasser
)
}
}
await Homey.flow.runFlowCardAction({
uri: ‘homey:manager:mobile’,
id: ‘push_text’,
args: {
user: {
athomId: “xxxxxx”
},
text: ‘Test push notification’
},
});
}
Script Error
Not Found: FlowCardCondition with ID push_confirm: Not Found: FlowCardCondition with ID push_confirm
at /app/node_modules/athom-api/dist/index.js:1:1247257
at processTicksAndRejections (node:internal/process/task_queues:96:5)