number node: Mode: set value #322
Replies: 3 comments
-
You'll need an additional number node set to "listen for changes" mode to ensure changes from Home Assistant are output to Node-RED. |
Beta Was this translation helpful? Give feedback.
-
Many thanks for your answer!! |
Beta Was this translation helpful? Give feedback.
-
You only need one entity configuration node. Then, set up two number nodes—one to listen for changes from Home Assistant and another to allow value changes from Node-RED. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the great contribution!
I set a flow with a home assistant entities number node with properties Mode "set value" and the output properties are by default "msg.payload" and "msg.previousValue". A inject node is connected at the input and a debug node at output. Attached the code:
[ { "id": "a8fa1ef79ecff2b9", "type": "tab", "label": "Flow 1", "disabled": false, "info": "", "env": [] }, { "id": "362186dbf1a19edd", "type": "debug", "z": "a8fa1ef79ecff2b9", "name": "debug 10", "active": true, "tosidebar": true, "console": true, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 1070, "y": 280, "wires": [] }, { "id": "999dd8b9716c8fc3", "type": "ha-number", "z": "a8fa1ef79ecff2b9", "name": "Temps Reviso Camares", "version": 1, "debugenabled": false, "inputs": 1, "outputs": 1, "entityConfig": "ce01d90155228f27", "exposeAsEntityConfig": "", "mode": "set", "value": "payload", "valueType": "msg", "outputProperties": [ { "property": "payload", "propertyType": "msg", "value": "", "valueType": "value" }, { "property": "previousValue", "propertyType": "msg", "value": "", "valueType": "previousValue" } ], "x": 740, "y": 280, "wires": [ [ "362186dbf1a19edd" ] ] }, { "id": "236d667158c9ad63", "type": "inject", "z": "a8fa1ef79ecff2b9", "name": "", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "25", "payloadType": "num", "x": 310, "y": 280, "wires": [ [ "999dd8b9716c8fc3" ] ] }, { "id": "ce01d90155228f27", "type": "ha-entity-config", "server": "a3512df6e9ee4aff", "deviceConfig": "33411c67d1509552", "name": "Temps Reviso Camares", "version": "6", "entityType": "number", "haConfig": [ { "property": "name", "value": "Temps Reviso Camares" }, { "property": "icon", "value": "" }, { "property": "entity_picture", "value": "" }, { "property": "entity_category", "value": "" }, { "property": "device_class", "value": "" }, { "property": "unit_of_measurement", "value": "" }, { "property": "min_value", "value": "" }, { "property": "max_value", "value": "" }, { "property": "step_value", "value": "" }, { "property": "mode", "value": "auto" } ], "resend": false, "debugEnabled": false }, { "id": "a3512df6e9ee4aff", "type": "server", "name": "Home Assistant", "version": 5, "addon": false, "rejectUnauthorizedCerts": false, "ha_boolean": "y|yes|true|on|home|open", "connectionDelay": true, "cacheJson": true, "heartbeat": true, "heartbeatInterval": "30", "areaSelector": "friendlyName", "deviceSelector": "friendlyName", "entitySelector": "friendlyName", "statusSeparator": ": ", "statusYear": "hidden", "statusMonth": "short", "statusDay": "numeric", "statusHourCycle": "default", "statusTimeFormat": "h:m", "enableGlobalContextStore": true }, { "id": "33411c67d1509552", "type": "ha-device-config", "name": "Camares", "hwVersion": "", "manufacturer": "Node-RED", "model": "", "swVersion": "" } ]
When is set a number value through the inject node at the debug output appear the "msg.payload" and "msg.previousValue".
On other hand, when is set a number though the Home assistant app interface there are no output on Node-red number node. Despite this, when later is injected a number through the inject node, at the output is reached the "msg.previousValue" changed though the home assistant interface. This behavior is normal? It means that is not possible detect when a change come form the home assistant app interface?
With the voice control is necessary the possibility to set the values from both sites (Node-red input flow and Home assistant app interface) and reach a output each time that the number change.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions