Reading out String

How do I find out which string i can use if i want to read out only one?


For example i want to see the temp:12 on a Dashboard how do I find oit the position?

@Marv

As previously stated in other posts, the info you are providing is not helpful for us to provide an answer that is of benefit to you.

Instead of a photo, please paste the payload here - we really cant help you without data to test/have a good look at

```
Paste Here
```

The Programm: First Timestamp function - then the http request function (with the right link inside)-Then the Switch function with msg.payload and the the gauge function-

Now I want to read out the Right string with the gauge but i dont know how to find out which String number which Text is.

I'll try again...

:point_up:

Here is how to copy the payload (the one you need help with please)

Nov-01-2023 18-37-53

Then paste

```
JSON Here
```

{"observations":[{"stationID":"IIBBEN109","obsTimeUtc":"2023-11-01T18:51:52Z","obsTimeLocal":"2023-11-01 19:51:52","neighborhood":"Schafberg","softwareType":"EasyWeatherV1.6.6","country":"DE","solarRadiation":0.0,"lon":7.731,"realtimeFrequency":null,"epoch":1698864712,"lat":52.298,"uv":0.0,"winddir":164,"humidity":80,"qcStatus":1,"metric":{"temp":12,"heatIndex":12,"dewpt":9,"windChill":12,"windSpeed":16,"windGust":23,"pressure":997.33,"precipRate":0.00,"precipTotal":5.69,"elev":152}}]}
sorry i didnt get it hope this ist right

Other than not formatting it

```
JSON HERE
```

what you could do is use a change Node (importable example below - based on the payload provided)

Connect this change Node to the dashboard element that needs it (Note: I do not use dashboard)

[{"id":"f8fca14a10134ec0","type":"inject","z":"2d7bf6e3.84c97a","name":"Push Me (example payload)","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"observations\":[{\"stationID\":\"IIBBEN109\",\"obsTimeUtc\":\"2023-11-01T18:51:52Z\",\"obsTimeLocal\":\"2023-11-01 19:51:52\",\"neighborhood\":\"Schafberg\",\"softwareType\":\"EasyWeatherV1.6.6\",\"country\":\"DE\",\"solarRadiation\":0,\"lon\":7.731,\"realtimeFrequency\":null,\"epoch\":1698864712,\"lat\":52.298,\"uv\":0,\"winddir\":164,\"humidity\":80,\"qcStatus\":1,\"metric\":{\"temp\":12,\"heatIndex\":12,\"dewpt\":9,\"windChill\":12,\"windSpeed\":16,\"windGust\":23,\"pressure\":997.33,\"precipRate\":0,\"precipTotal\":5.69,\"elev\":152}}]}","payloadType":"json","x":360,"y":790,"wires":[["c8dafe881312fd2a"]]},{"id":"f9846083c478b5bd","type":"debug","z":"2d7bf6e3.84c97a","name":"debug 377","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":765,"y":790,"wires":[]},{"id":"c8dafe881312fd2a","type":"change","z":"2d7bf6e3.84c97a","name":"","rules":[{"t":"set","p":"originalPayload","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"payload","pt":"msg","to":"payload.observations[0].metric.temp","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":560,"y":790,"wires":[["f9846083c478b5bd"]]}]

If you set the http request node to return a parsed JSON object, you can then use
{{msg.payload.observations[0].metric.temp}} in the gauge node.

You can retrieve the path using the copy path icon next to the copy value icon @marcus-j-davies showed you in the post 4 .

1 Like

Sorry i didnt get it could you maybe describe it a little bit more newcomer comform
Where do i have to do what with the change node ?

  1. Set the HTTP request node to output a JSON Object
  2. Connect this request node directly to the gauge node
  3. The value for the gauge node be set to.
    {{msg.payload.observations[0].metric.temp}}

If I have that correct - I do not use dashbard myself.

@E1cid
Do you have to include msg in dashboard for the value param?


How do set it here to JSON

I couldnt find it under Method

Yes as it is using angular js, not mustache.

@Marv, select it using ruckabe which translates to return i believe.

1 Like

Got it but not working

Not a helpful response,. Please supply info we can use to help diagnose the issue,export your flow
How to import/export a flow

Then paste here using tripple backticks

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote ```)

``` 
   code goes here 
```

You can edit and correct your post by clicking the pencil :pencil2: icon.

See this post for more details - How to share code or flow json

[
    {
        "id": "5253669e883d6c5a",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a4a6074d2bd0accb",
        "type": "http request",
        "z": "5253669e883d6c5a",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "https://api.weather.com/v2/pws/observations/current?apiKey=e1f10a1e78da46f5b10a1e78da96f525&stationId=IIBBEN109&format=json&units=m",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 370,
        "y": 180,
        "wires": [
            [
                "339406134881e7b1"
            ]
        ]
    },
    {
        "id": "93884a3a8a1c0439",
        "type": "inject",
        "z": "5253669e883d6c5a",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 140,
        "y": 180,
        "wires": [
            [
                "a4a6074d2bd0accb"
            ]
        ]
    },
    {
        "id": "339406134881e7b1",
        "type": "debug",
        "z": "5253669e883d6c5a",
        "name": "debug 13",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 760,
        "y": 60,
        "wires": []
    },
    {
        "id": "330925c86ffba129",
        "type": "ui_gauge",
        "z": "5253669e883d6c5a",
        "name": "g",
        "group": "dea2954bc49e0e31",
        "order": 4,
        "width": 9,
        "height": 8,
        "gtype": "gage",
        "title": "gauge",
        "label": "units",
        "format": "{{msg.payload.observations[4].metric.temp}}",
        "min": 0,
        "max": "100",
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "x": 890,
        "y": 220,
        "wires": []
    },
    {
        "id": "6158a3c3238f11f6",
        "type": "ui_text",
        "z": "5253669e883d6c5a",
        "group": "dea2954bc49e0e31",
        "order": 17,
        "width": 9,
        "height": 1,
        "name": "",
        "label": "text",
        "format": "{{msg.payload.observations[0].metric.temp}}",
        "layout": "row-spread",
        "x": 770,
        "y": 340,
        "wires": []
    },
    {
        "id": "322635f232ecbecf",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 3,
        "width": 5,
        "height": 1
    },
    {
        "id": "179cef057cfcbef3",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 5,
        "width": 5,
        "height": 1
    },
    {
        "id": "2e0d0e8c8cf743b7",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 6,
        "width": 5,
        "height": 1
    },
    {
        "id": "fd16f822a5b43d96",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 7,
        "width": 5,
        "height": 1
    },
    {
        "id": "4e7507f2b827b95d",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 10,
        "width": 5,
        "height": 1
    },
    {
        "id": "295d696be317395b",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 13,
        "width": 5,
        "height": 1
    },
    {
        "id": "6a9087e8b974a414",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 14,
        "width": 5,
        "height": 1
    },
    {
        "id": "35a4310a57379302",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 15,
        "width": 5,
        "height": 1
    },
    {
        "id": "409372384dd05f31",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 16,
        "width": 5,
        "height": 1
    },
    {
        "id": "070fe18264404be6",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 20,
        "width": 12,
        "height": 1
    },
    {
        "id": "dea2954bc49e0e31",
        "type": "ui_group",
        "name": "Standard",
        "tab": "1f620ce88b85048d",
        "order": 2,
        "disp": true,
        "width": 30,
        "collapse": false
    },
    {
        "id": "1f620ce88b85048d",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

wait i will try again i think this is not right

  [
    {
        "id": "5253669e883d6c5a",
        "type": "tab",
        "label": "Flow 2",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "a4a6074d2bd0accb",
        "type": "http request",
        "z": "5253669e883d6c5a",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "https://api.weather.com/v2/pws/observations/current?apiKey=e1f10a1e78da46f5b10a1e78da96f525&stationId=IIBBEN109&format=json&units=m",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 370,
        "y": 180,
        "wires": [
            [
                "339406134881e7b1"
            ]
        ]
    },
    {
        "id": "93884a3a8a1c0439",
        "type": "inject",
        "z": "5253669e883d6c5a",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 140,
        "y": 180,
        "wires": [
            [
                "a4a6074d2bd0accb"
            ]
        ]
    },
    {
        "id": "339406134881e7b1",
        "type": "debug",
        "z": "5253669e883d6c5a",
        "name": "debug 13",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 760,
        "y": 60,
        "wires": []
    },
    {
        "id": "330925c86ffba129",
        "type": "ui_gauge",
        "z": "5253669e883d6c5a",
        "name": "g",
        "group": "dea2954bc49e0e31",
        "order": 4,
        "width": 9,
        "height": 8,
        "gtype": "gage",
        "title": "gauge",
        "label": "units",
        "format": "{{msg.payload.observations[4].metric.temp}}",
        "min": 0,
        "max": "100",
        "colors": [
            "#00b500",
            "#e6e600",
            "#ca3838"
        ],
        "seg1": "",
        "seg2": "",
        "x": 890,
        "y": 220,
        "wires": []
    },
    {
        "id": "6158a3c3238f11f6",
        "type": "ui_text",
        "z": "5253669e883d6c5a",
        "group": "dea2954bc49e0e31",
        "order": 17,
        "width": 9,
        "height": 1,
        "name": "",
        "label": "text",
        "format": "{{msg.payload.observations[0].metric.temp}}",
        "layout": "row-spread",
        "x": 770,
        "y": 340,
        "wires": []
    },
    {
        "id": "322635f232ecbecf",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 3,
        "width": 5,
        "height": 1
    },
    {
        "id": "179cef057cfcbef3",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 5,
        "width": 5,
        "height": 1
    },
    {
        "id": "2e0d0e8c8cf743b7",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 6,
        "width": 5,
        "height": 1
    },
    {
        "id": "fd16f822a5b43d96",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 7,
        "width": 5,
        "height": 1
    },
    {
        "id": "4e7507f2b827b95d",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 10,
        "width": 5,
        "height": 1
    },
    {
        "id": "295d696be317395b",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 13,
        "width": 5,
        "height": 1
    },
    {
        "id": "6a9087e8b974a414",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 14,
        "width": 5,
        "height": 1
    },
    {
        "id": "35a4310a57379302",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 15,
        "width": 5,
        "height": 1
    },
    {
        "id": "409372384dd05f31",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 16,
        "width": 5,
        "height": 1
    },
    {
        "id": "070fe18264404be6",
        "type": "ui_spacer",
        "z": "5253669e883d6c5a",
        "name": "spacer",
        "group": "dea2954bc49e0e31",
        "order": 20,
        "width": 12,
        "height": 1
    },
    {
        "id": "dea2954bc49e0e31",
        "type": "ui_group",
        "name": "Standard",
        "tab": "1f620ce88b85048d",
        "order": 2,
        "disp": true,
        "width": 30,
        "collapse": false
    },
    {
        "id": "1f620ce88b85048d",
        "type": "ui_tab",
        "name": "Home",
        "icon": "dashboard",
        "disabled": false,
        "hidden": false
    }
]

Try

[{"id":"a4a6074d2bd0accb","type":"http request","z":"5253669e883d6c5a","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.weather.com/v2/pws/observations/current?apiKey=e1f10a1e78da46f5b10a1e78da96f525&stationId=IIBBEN109&format=json&units=m","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"credentials":{"user":"","password":""},"x":370,"y":180,"wires":[["339406134881e7b1","330925c86ffba129"]]},{"id":"339406134881e7b1","type":"debug","z":"5253669e883d6c5a","name":"debug 13","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":760,"y":60,"wires":[]},{"id":"330925c86ffba129","type":"ui_gauge","z":"5253669e883d6c5a","name":"g","group":"dea2954bc49e0e31","order":4,"width":9,"height":8,"gtype":"gage","title":"gauge","label":"units","format":"{{msg.payload.observations[0].metric.temp}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":690,"y":180,"wires":[]},{"id":"dea2954bc49e0e31","type":"ui_group","name":"Standard","tab":"1f620ce88b85048d","order":2,"disp":true,"width":30,"collapse":false},{"id":"1f620ce88b85048d","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Copy the above json, then import the flow to see the changes. Similar as export, just import paste code and click import.
You had not set a return a parsed json object or connected the gauge node to the http node.

is that right ? i have copied in ```