VaRest help with writing variables to

Your ConstructJSONRequest must be set to POST. Then try it again

Ok set to post but the temperature icon stands as green and not updates to red, andthe value do not get updated on channel :frowning: .

I have to read the details of ThingSpeak. You can describe what you want to do in detail in the meantime. Your write data / feed will only show what you write, so if you just sent field3, the others will be empty.

Ok here is the detail . I am using sensor data done with a sensor DHT 11 for arduino , Isend the data to thingspeak and then there I setup 4 fields 2 for temp and hum and 2 for storing data I want to grab from unreal to light up a couple of leds according to whats happening … I know it woul dbe easier probably to do two different sensors one for leds and one for sensor but the way I wanted to try first is having all in one .
1 read the DHT11 sensor data from the sensor connected to nodemcu8266 send them to thingspeak and write into the first two fields,

2 those fields are got from an extenral program processend and two new signals should be send to put on or off two leds red and blue according to level of temperature too high …

3 the thingspeak should send the written data , 0 or 1 to nodemcu82666 and put on or off the leds accordingly.

So on the unreal part I have to collect the data , represent them as variables showing up in my widged as already does, color code the icons , as it worked if I make only that , and then write back the data according to color coding .

the whole point is to represent back and forth communication on a single nodemcu , I could easierly light up the leds directly coding it in arduino sensor but then there wouln’t be a communication from Unreal back . My point is also to understand if is possible to get both communications on same nodemcu8266 sensor setup or I need instead to split it all into two sensors one for read and one for write, so one with sensors and one with leds ?




UpdateFeed could be wrong, read this: Support - ThingSpeak

The idea would be, that you check if there is data in the feed, get the data, set the text and image and then update the feed with your alarm settings (0 or 1). Then your arduino gets the last feed, checks if there is data in field1 or field2, if there is no data get field3 and field 4 to do things. After that sent data back a new feed. Then field1 and field2 are filled and the blueprint will get data again (because StringField1 != null) and thus creating a data cycle.

1 Like

Cool thanks for helping me out, I will test this and let you know what happens :slight_smile:

In meanwhile I oversimplified in hope to avoid the error I got before on the branch section and seems I removed, Dunno even why but this is how I simplified only the color part , but … It doesn’t updates the color , And I am not getting why :confused:

Do you call the AllarmeIcona?

yes here :slight_smile:

it gets actually executed etc, also the print value writes hello when is , but the colors don’t update on the >= 20 condition.

The problem here could be that you use a Sequence node. The node is great when you want to split a long function BUT the Sequence node does not really execute these things in sequence but fires them at once. So when AllarmeIcona gets executed it could be possible that there is no data present at that moment. So you should place the Call of your AllarmeIcona after you use your GET because this function depends on your GET. To test if there is data print your temperature in your AllarmeIcona function. If there is no print / no text outputted then your variable is empty at the time this function gets called (or it is 0,0).

Thanks this makes sense, I so detached the activation of set parameter of temperature from top and set after like so :

now it updates but … the initialization seems to fail and starts straight with a green even if the temp is 29 degrees and the condition is set to be red above 25 degrees…

how can I do to initialize it at start?

Btw do you have discord ? May be we can communicate faster there?

After the SetText call your AllarmeIcona.
Discord: L1z4rD#7752