Hi,
How can I write to the timeline from within a script?
I have the same question. Have you found a resolution?
I found this, which worked for me.
await Homey.flow.runFlowCardAction({
uri: âhomey:manager:notificationsâ,
id: âcreate_notificationâ,
args: {
text: âsome text â + someVariable + â some more textâ
},
});
This worked for me:
await Homey.flow.runFlowCardAction({
uri: âhomey:manager:notificationsâ,
id: âcreate_notificationâ,
args: {
text: âsome textâ },
});
dont use quotes (â ') but (" ")
To make it work for me (too debug), I neede it to change to:
await Homey.flow.runFlowCardAction({
uri: âhomey:flowcardaction:homey:manager:notifications:create_notificationâ,
id: âhomey:manager:notifications:create_notificationâ,
args: {text: 'Step 2a '},
});
For some reason, needed to change url to be with " and not with â - then works as a charm
// My timeline test
result = await Homey.flow.runFlowCardAction({
uri: âhomey:flowcardaction:homey:manager:notifications:create_notificationâ,
id: âhomey:manager:notifications:create_notificationâ,
args: {text: âHomeyScript write testâ},
});
console.log(result)
return
This is because (all) the posted code parts in this topic arenât formatted as code, like this: first and last line start with 3 backticks:
```
Your code here
```
Fancy quotes and fancy double quotes are invalid.
Code formatted as code should look like this:
await Homey.flow.runFlowCardAction(
{
uri: 'homey:flowcardaction:homey:manager:notifications:create_notification',
id: 'homey:manager:notifications:create_notification',
args: {text: 'Step 2a'},
}
);
(Note the âcopyâ icon at the top-right, for easy and error-free copying)