How to update Varest json file Url?

Hi I am using VArest plugin to call a read api and represent some data ingame

https://api.thingspeak.com/channels/1753049/fields/2.json?api_key=LGN6UJLTTYJ382L8&results=1

I managed to make it write into the variable text using this code :slight_smile:

But how I do to make it updated every now and then to update the values?

also how can I do to display the possible view of the graphic stats like this?

https://thingspeak.com/channels/1753049/charts/1?bgcolor=%23ffffff&color=%23d62020&dynamic=true&results=60&type=line&update=15

The easiest is to use a looping timer set, for example, to 5 seconds and use it to call your REST API. See here: Using Timers | Unreal Engine Documentation
That will update the temperature once every 5 seconds.

I tried adding a timer every 60 seconds to update it by using a set time on function , but it doesn’t work , I put it after initialization and tried to put also on consctruct but nothing changes the values.

Can you show how you set up the timer to call the REST API?

yes like so :slight_smile:

You should set a Timer by Event and have it call a custom event (e.g. TimerCall), then use that custom event to call the REST API (Call URL) and finally the Callback is the event Risposta Temp&Umid you already have.

Isn’t what I have done above?

Nope. You are calling a custom event like it would be a function, but it is not. That’s why it doesn’t work. Use Set Timer by Event and link it to a custom event which calls your Call URL.

erh can you visually show me how to ?

I don’t have the VA Rest plugin installed so I faked the Call URL function but the code would be the same as you already have in that part.

1 Like

Like this?

Yes, that should work. Place some Print String after each Event node to check whether they are being called correctly.

1 Like