node-red-contrib-home-assistant-websocket
node-red-contrib-home-assistant-websocket copied to clipboard
after update ha to 2022.7.x no more actionable notification
Describe the bug
I was pointed to a breaking change from here https://community.home-assistant.io/t/actionable-notifications-in-node-red/324865/11
Now I am wondering what I need to change where and if anyone has also encountered this breaking change. Any help greatly appreciated since these nodes have been working more than ok since I inserted them over a year or so ago. But now sinnce 10 day no more actionable notifications are coming in anymore...
Thanks for any help 😀
To Reproduce
It might have to do with having the nodes imported longer time afo. But I cannot find any more good i fo on how to proceed. Thus I think for me this has became a bug.
Expected behavior
Like for over a year is should action me via the app.
Screenshots
None
Example Flow
None available
This package's version (not the Home Assistant add-on version)
latest
Is Node-RED running in Docker?
Home Assistant add-on
Node-RED version
12.0.2
Node.js version
latest
Additional context
None
Quick fix seems to be changing title to command in the create service call function node, and also moving the command into the data block.
const actions = [];
[1,2,3].forEach(i => {
const name = `action${i}`
const id = flow.get(`${name}Id`);
const title = env.get(`${name}Title`);
const uri = env.get(`${name}Uri`);
const action = !!uri.length ? 'URI' : title ? flow.get(`${name}Id`) : undefined;
actions.push({
action,
title,
uri
});
});
msg._originalPayload = msg.payload;
flow.set('latestMessage', msg);
const services = env.get('service');
if(!services) {
node.status({
text: 'no services defined',
shape: 'ring',
fill: 'red'
});
return;
}
services.trim().split(/,\s*/).forEach(service => {
if(!service) return;
msg.payload = {
service,
data: {
message: env.get('message'),
data: {
tag: flow.get('notificationTag'),
actions,
color: env.get("color"),
group: env.get("group"),
sticky: env.get("sticky"),
timeout: env.get("timeout"),
icon: env.get("icon"),
command: env.get('title')
}
}
};
node.send(msg);
});
node.done();
From the documentation, the command property is only in beta. @me once the app is out of beta, I'll add a new property for command.
Help, what do I need to change where (as non coder)?
This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.