Hi, I am sending values from 2 ESP8266 devices to the RealTime Firebase in this way:
data sent by each individual device:
Device 1:
String uid = “0OaciqwPf1NXnNvHB2RnVrXek5L2”; //(ESP1)
String path = “/UsersData/” + uid;
Firebase.setString(firebaseData,uid + “/Level”, Level);
Device 2 :
String uid = “0OaciqwPf1NXnNvHB2RnVrXek5L2”; //(ESP2)
String path = “/UsersData/” + uid;
Firebase.setString(firebaseData,uid + “/Level”, Level);
Rules di RealTime Database:
{
“rules”: {
“.read”: “true”,
“UsersData”: {
“$uid”: {
.write": “true”
// “.write”: “auth.uid !== null”
}}}}
The data is received perfectly on Firebase Realtime Database, as shown in the attached photo.
When the user logs in, I store a variable with the command “set stored variable uid to ‘user id’” (where user id is the Firebase user ID).
The problem arises on Thunkable: if I create a variable with “initialize cloud variable Level”, I don’t receive any data, since the value should be preceded by the user’s uid to be able to read it correctly.
I would like to know if it is possible to create a “multiple” variable, for example:
“initialize cloud variable stored variable uid / cloud variable Level”
Like this, when I use the function:
“when cloud variable stored variable uid / cloud variable Level initializes or changes”,
I would receive the constantly updated value in the app.
I also tried the method shown in the attached photo N°2, where each device correctly receives its value, but only when I open the app.
Can anyone kindly give me a suggestion on how to fix the problem?