- Use if state to optionally define criteria to send messages through the second output.
- I find I have to restart Nodered
I have additional question.
I am trying to send notification
So I use ācall serviceā node.
If i do this from HA automation it looks like
- alias: 'test notify'
trigger:
platform: state
entity_id: input_boolean.short_away
to: 'off'
action:
- service: persistent_notification.create
data:
title: 'Test'
message: Test test:)
But in ācall serviceā node it is mandatory āEntity Idā field. What I need to enter in this field?
Thanks.
Entity Id is not mandatory. Below youāll find just the call service:
[
{
"id": "33ba201f.ee5f18",
"type": "api-call-service",
"z": "7a7f721a.5a661c",
"name": "Test",
"server": "2734ab02.42e8ec",
"service_domain": "persistent_notification",
"service": "create",
"data": "{\"title\":\"Test\",\"message\":\"Test message\",\"notification_id\":\"11111\"}",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"x": 360,
"y": 500,
"wires": [
[]
]
},
{
"id": "caa29451.27147",
"type": "inject",
"z": "7a7f721a.5a661c",
"name": "",
"topic": "",
"payload": "true",
"payloadType": "bool",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 150,
"y": 520,
"wires": [
[
"33ba201f.ee5f18"
]
]
}
]
Thanks for example. I see now that my problem was in JSON syntax of data.
Iām trying to pass a msg with entity id in msg.topic to Wait Until node, but it seems it doesnāt work with variables in Entity Id properties in this node.
Im typing: {{msg.topic}} and have tried other formats msg.data etcā¦Am I doing it wrong?
The wait-until node currently doesnāt accept any inputs other than msg.reset
and you canāt use templates in any of the input fields.
Ok, I understand. Is it possible to implement support for that? I want to create a flow where lights turns of after some minutes. And it would be alot cleaner if I could use same wait-until for all state-trigger nodes
Yes, itās possible but I need to rewrite the node to allow for topic dependent timers.
Currently, you can accomplish what youāre looking to do with a standard trigger node.
The current-state node now allows the entity_id in the config to be overwritten by msg.payload.entity_id
. This wasnāt possible before if there was a value in the entity_id field of the config. There are no nodes by default that output a msg.payload.entity_id
other than older versions of the call-service node, users affected by this change should be limited. This change brings the current-state node more in line with the other nodes of this package by allowing config values to be set from msg.payload
.
Hi,
Thanks for the work on this!
Iām running both Home Assistant and NodeRed in Docker on Raspberry PI. Currently have v.0.20.5 of rpi-v8 image.
When it is starting - it is not loading the pallet with the following error:
nodered_1 | Welcome to Node-RED
nodered_1 | ===================
nodered_1 |
nodered_1 | 20 May 00:29:05 - [info] Node-RED version: v0.20.5
nodered_1 | 20 May 00:29:05 - [info] Node.js version: v8.1.3
nodered_1 | 20 May 00:29:05 - [info] Linux 4.14.79-v7+ arm LE
nodered_1 | 20 May 00:29:06 - [info] Loading palette nodes
nodered_1 | 20 May 00:29:10 - [warn] ------------------------------------------------------
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/server] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/server-events] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/server-state-changed] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/trigger-state] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/poll-state] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/api-call-service] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/ha-fire-event] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/api-current-state] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/ha-get-entities] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/api-get-history] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/api-render-template] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/ha-wait-until] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] [node-red-contrib-home-assistant-websocket/ha-api] SyntaxError: Unexpected token ā¦
nodered_1 | 20 May 00:29:10 - [warn] ------------------------------------------------------
nodered_1 | 20 May 00:29:10 - [info] Settings file : /data/settings.js
Any ideas?
Thanks.
Try updating node.js. This package requires v8.12+ and looking at your logs youāre running v8.1.3
Looking for testers for the latest release candidate
Notable Changes:
If State will now send the message to the first output if true and to the second if not. This is for the events-state, poll-state, and current-state nodes. The old behavior, sending the message to the second output if true, will continue to be in place until you edit one of the existing nodes via the UI and at that time the outputs will automatically be switched.
I would recommend backing up your flows, just in case, before trying this release.
How to install
npm (from within your node-red directory)
$ npm install node-red-contrib-home-assistant-websocket@next
npm from github
$ npm install https://github.com/zachowj/node-red-contrib-home-assistant-websocket#rc
hass.io users add this to your config
"npm_packages": [
"git+https://github.com/zachowj/node-red-contrib-home-assistant-websocket#rc"
],
If you try this release please post a little feedback even if everything works for you. So I know if it is ready for release to all users.
Thanks.
@Kermit Iām giving it a shot right now as I have to rebuild my system. Iāll post some thoughts shortly.
@Kermit ,
First, thanks so much for doing all this and sharing. My family has grown accustomed to all the automations Iāve built in node red.
Iād like to help test, but have a clarifying question. Iām currently on the 0.11 release from the latest hassio add-on. When you edit one old-mode node, is just that individual node updated to the new behavior or are all the old nodes updated? I have dozens of current state nodes.
Thanks!
It is only the node you edit that will be updated to the new behaviour. All other nodes that you donāt edit will continue to function as they did in v0.11.0. There is no need to go through each node and update it, other than to test.
@Kermit,
How would you like feedback on the rc release?
outputLabels: function(index) { if (this.haltifstate) { if (index === 0) return "'If State' is true"; if (index === 1) return "'If State' is false"; } },
Thanks!
Benjamin
Thanks for the feedback.
How does this look as an indicator? Different color text if the deployed version is older than current version of node.
Individuals nodes on the workspace will now have a version number associated with them. This will allow changes to be made to the structure of nodes without affecting all nodes of that type until you edit them. Legacy nodes will have a yellow font until the node has been upgraded to the current version.
If State will now send the message to the first output if true and to the second if not. This is for the events-state, poll-state, and current-state nodes. The old behavior, sending the message to the second output if true, will continue to be in place until you edit one of the existing nodes via the UI and at that time the outputs will automatically be switched. The output tooltips are version-aware and will display the correct text depending on the current version of the node. Hopefully, this change will make if state
more intuitive for new as well as existing users.