I need to separate the values from a group

I hate having to ask for help when I should be able to make it happen on my own. However, below is an output from my weather station API. This came out of a HTTP Request node. I x'ed out the MAC address. I would like to get to each of the lastData object items out in the open. Or at lease get to them individually. As an example, get to hourlyrainin to do a comparison. Or to send a temperature value to a MQTT broker. I just need to separate each item. A nudge would be appreciated. Thanks in advance.

7/31/2019, 7:55:16 PMnode: b1fc864e.b09188msg.payload : array[1]

array[1]

0: object

macAddress: "xx:xx:xx:xx:xx:xx"

lastData: object

dateutc: 1564617120000

tempinf: 73.4

humidityin: 53

baromrelin: 30.13

baromabsin: 28.42

tempf: 78.6

humidity: 77

winddir: 354

winddir_avg10m: 354

windspeedmph: 0

windspdmph_avg10m: 0

windgustmph: 0

maxdailygust: 3.4

hourlyrainin: 0

eventrainin: 0

dailyrainin: 0

weeklyrainin: 0

monthlyrainin: 7.48

yearlyrainin: 52.78

solarradiation: 20.8

uv: 0

feelsLike: 79.78

dewPoint: 70.77

lastRain: "2019-07-23T15:46:00.000Z"

tz: "America/New_York"

date: "2019-07-31T23:52:00.000Z"

Check this topic, very similar.

There’s also the page in the docs about working with messages that’s well worth a read

1 Like

@alvinstewart I have not yet tried bakman2's suggested flow on my thread (the one he linked) but it looks like it should work.

This is what I came up with for extracting a single data point and pub'ing to two MQTT topics (Celsius & Fahrenheit). Just change the apiKey and applicationKey in the http request node and setup the mqtt output nodes how you want them.

[{"id":"604a1b95.f3fb34","type":"inject","z":"77205ee4.09f8e","name":"60s","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":false,"onceDelay":0.1,"x":90,"y":160,"wires":[["56a63bcc.af6da4"]]},{"id":"56a63bcc.af6da4","type":"http request","z":"77205ee4.09f8e","name":"get data for Farm House","method":"GET","ret":"obj","paytoqs":false,"url":"https://api.ambientweather.net/v1/devices/00:0E:C6:20:10:43?apiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&applicationKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&endDate=&limit=1","tls":"","proxy":"","authType":"","x":190,"y":200,"wires":[["80e467fa.33a2f8"]]},{"id":"e42199a5.b72398","type":"debug","z":"77205ee4.09f8e","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":630,"y":200,"wires":[]},{"id":"79d1e797.326718","type":"mqtt out","z":"77205ee4.09f8e","name":"","topic":"weather/farm/house/tempinf","qos":"2","retain":"true","broker":"ad7b7ee9.73295","x":880,"y":160,"wires":[]},{"id":"80e467fa.33a2f8","type":"unit-converter","z":"77205ee4.09f8e","category":"temperature","inputUnit":"F","outputUnit":"C","inputField":"payload.0.tempinf","outputField":"payload.0.tempinc","inputFieldType":"msg","outputFieldType":"msg","name":"","x":340,"y":160,"wires":[["b89206e3.aa4768"]]},{"id":"49c76923.0260d8","type":"mqtt out","z":"77205ee4.09f8e","name":"","topic":"weather/farm/house/tempinc","qos":"2","retain":"true","broker":"ad7b7ee9.73295","x":880,"y":240,"wires":[]},{"id":"b89206e3.aa4768","type":"change","z":"77205ee4.09f8e","name":"set global var","rules":[{"t":"set","p":"payload.0.tempinc","pt":"msg","to":"$round(payload[0].tempinc, 1)","tot":"jsonata"},{"t":"set","p":"weather.farm.house.tempinc","pt":"global","to":"payload.0.tempinc","tot":"msg"},{"t":"set","p":"weather.farm.house.tempinf","pt":"global","to":"payload.0.tempinf","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":200,"wires":[["e42199a5.b72398","3fc88fb0.aa8e6","6fbe72f4.84732c"]]},{"id":"3fc88fb0.aa8e6","type":"change","z":"77205ee4.09f8e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.0.tempinf","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":160,"wires":[["79d1e797.326718"]]},{"id":"6fbe72f4.84732c","type":"change","z":"77205ee4.09f8e","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.0.tempinc","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":240,"wires":[["49c76923.0260d8"]]},{"id":"ad7b7ee9.73295","type":"mqtt-broker","z":"","name":"local mosquitto","broker":"192.168.12.253","port":"1883","clientid":"node-red-local","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]