pixelit-project / node-red-contrib-pixelit

Node-RED nodes to control the Pixel It easily and comfortably.
https://github.com/o0shojo0o/PixelIt/discussions
MIT License
5 stars 4 forks source link

Text: state value? #48

Open tstill88 opened 8 months ago

tstill88 commented 8 months ago

Is it possible to have the value of a state displayed in the message?

I tried putting this in the text box.

Current Plex Viewers: {{payload}}

or Current Plex Viewers: {{msg.payload}}

I asked to see if ChatGPT could help and ended up with this flow which also didnt work.

[ { "id": "7eae38c2c363dcfe", "type": "server-state-changed", "z": "e6d349d60ead1d22", "name": "", "server": "717b0703.8c9fa8", "version": 3, "exposeToHomeAssistant": false, "haConfig": [ { "property": "name", "value": "" }, { "property": "icon", "value": "" } ], "entityidfilter": "sensor.plex", "entityidfiltertype": "exact", "outputinitially": false, "state_type": "num", "haltifstate": "", "halt_if_type": "", "halt_if_compare": "", "outputs": 1, "output_only_on_state_change": true, "for": 0, "forType": "num", "forUnits": "minutes", "ignorePrevStateNull": false, "ignorePrevStateUnknown": false, "ignorePrevStateUnavailable": false, "ignoreCurrentStateUnknown": false, "ignoreCurrentStateUnavailable": false, "outputProperties": [ { "property": "payload", "propertyType": "msg", "value": "", "valueType": "entityState" } ], "x": 710, "y": 20, "wires": [ [ "1b3a6cc7327984ea", "3d823e0ec2dad915" ] ] }, { "id": "1b3a6cc7327984ea", "type": "function", "z": "e6d349d60ead1d22", "name": "Format Message", "func": "msg.payload = \"Current Plex Viewers: \" + msg.payload;\nreturn msg;", "outputs": 1, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 1010, "y": 20, "wires": [ [ "7db6f98168446292" ] ] }, { "id": "7db6f98168446292", "type": "Text", "z": "e6d349d60ead1d22", "name": "Text", "intextString": "Current Plex Viewers: {{msg.payload}}", "inbigFont": "true", "inscrollText": "true", "inscrollTextDelay": "1", "incenterText": "true", "inposX": "8", "inposY": "1", "incolorR": "0", "incolorG": "255", "incolorB": "0", "x": 1630, "y": 20, "wires": [ [ "5cec2660c744c907" ] ] }, { "id": "3d823e0ec2dad915", "type": "Screen Init", "z": "e6d349d60ead1d22", "name": "Screen Init", "inscreenName": "person_detected", "induration": "20", "x": 1250, "y": 20, "wires": [ [ "e18735f3ed6c01d1" ] ] }, { "id": "e18735f3ed6c01d1", "type": "Switch Animation", "z": "e6d349d60ead1d22", "name": "Switch Animation", "aktiv": "true", "animation": "fade", "x": 1430, "y": 20, "wires": [ [ "1b3a6cc7327984ea" ] ] }, { "id": "717b0703.8c9fa8", "type": "server", "name": "Home Assistant", "version": 2, "addon": true, "rejectUnauthorizedCerts": true, "ha_boolean": "y|yes|true|on|home|open", "connectionDelay": true, "cacheJson": true, "heartbeat": false, "heartbeatInterval": 30 } ]

Any help appreciated!

github-actions[bot] commented 1 hour ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days