Newbie needs help: reading html page, extract value en use to trigger action

Hello everyone,

I am a bit new to scripting/programming and everytime i try to learn i stumble to something that seems entirely new and nowhere an answer can be found. As I think that can not be true I ask you for help.

I have Toon (hacked) and using a url i can retrieve the info I am looking for.

I have setup a timestamp node to trigger a HTTP request node. Next i put it trough the json node to convert it to a javascript object. That was what I understood from the documentation.

Now de debug node output looks like this:

object
result: "ok"
currentTemp: "2021"
currentSetpoint: "1550"
currentInternalBoilerSetpoint: "6"
programState: "2"
activeState: "3"
nextProgram: "1"
nextState: "2"
nextTime: "1649880000"
nextSetpoint: "1900"
randomConfigId: "1804289383"
errorFound: "255"
connection: "0"
burnerInfo: "0"
otCommError: "0"
currentModulationLevel: "

I am interesting in only the burnerinfo value, so i can use it to trigger an action. So how i go from here?

I have Node-red running as add-on in Homeassistant, so i want to trigger an action when burnerinfo has for period of time a value of 2.

Hope someone can help...

Thanks!

and nowhere an answer can be found

Are you sure you went through the documentation ?

To grasp the workflow in node-red, i would highly recommend to watch all the videos in this playlist. They are short and explain the most used/useful concepts.

Can you actually do a screenshot of the debug window for the object when you make a request and see the response.

As it is an object - you should be able to hover over it in the debug window and there will be an option to copy the full path

Put that into a debug node and then see if it displays the correct data in the debug window

Craig

here is the screenshot from the debug window of both debug nodes:

The second debug is from the change node where i set it to the copied path from the first debug object output.
As you can see it outputs "payload.burnerInfo" but not the value it contains...

You need to set the change node to
set msg.payload
to msg payload.burnerInfo.

you have it set to
set msg.payload
to A/Z (String) payload.burnerInfo.

so select msg in the dropdown list

ooh thanks, I completely overlooked that!

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.