Comunicación HTTP con Node Red, escribir bucket

Buenas tardes, en primer lugar, agradecer a esta comunidad y Thinger IO, todo lo que aporta y todo lo que me ha hecho aprender

Me encuentro haciendo un pequeño proyecto de un sistema de regadio y recogida de datos (Temperatura, humedad, humedad suelo, luminosisdad…) con un ESP32.

Actualmente lo tengo conectado por wifi, y subo los datos a un bucket de ThingerIO, donde los represento en un dashboard.

Ahora también he empezado a utilizar Node-Red y Mosquitto MQTT, por varias razones

  • Node-Red,
    • Me permite enviar mensajes de aviso por Telegram (cuando intento enviarlos desde el ESP32 y me conecto al Thinger, ocurre un error y se reinicia. Sin Thinger IO si que me funciona Telegram) .
    • Liberar de carga el código del ESP32, ya que pretendo, calcular medias, valores máximos y mínimos sacados de un bucket, para luego subirlos ya tratados. Esto podría hacerlo directamente en Arduino, pero prefiero tenerlo externalizado.
  • Mosquitto MQTT
    • Ahora mismo, me permite avisar a Node Red, que el dispositivo está activo. Es decir, cuando acabo de tomar los datos y subirlos a Thinger, envío un mensaje MQTT a Node Red, para que dé un aviso por Telegram (EJ.: El riego ha finalizado), no sé si habrá alguna forma más sencilla de hacerlo, sin pasar por Mosquitto y que sea en tiempo real.
    • Tengo intención de aliviar el código de Arduino, y utilizar Mosquitto para pasar todos los datos de sensores a Node Red y desde ahí subirlo a Thinger.

He conseguido leer de Thinger Io los valores de un bucket, con un nodo “http request” configurado así:

Luego con un nodo “change” configurado así, obtengo el valor deseado

  • Msg.payload
  • Expression: payload[0].val.MyVariable

Ahora bien, aquí empiezan mis problemas, ya que me gustaría, además de leer valores, poder tratarlos (sacar medias, mínimos, máximos, etc) y volver a subirlos a Thinger.

He intentado hacerlo mediante el método POST, pero solo he conseguido que me salga un mensaje de error “no está autorizado a escribir en este bucket”

¿Cómo puedo escribir datos en un bucket desde Node Red? He descargado el módulo Thinger de Node Red, pero no se utilizar sus nodos

¿Alguien podría indicarme como hacerlo?

No he querido extenderme demasiado, por eso en otros post, iré publicando otros problemas que también tengo con este programa

Muchas gracias a todos

Good afternoon, first of all, to thank this community and Thinger IO, all support
I am doing a little project of a system of irrigation and data collection (temperature, humidity, soil moisture, luminosity …) with an ESP32.
I currently have it connected via wifi, and upload the data to a ThingerIO bucket, where I represent data in a dashboard.
Now I have also started using Node-Red and Mosquitto MQTT (installed on an Android phone), for several reasons
•Node-Red,
It allows me to send warning messages by Telegram (when I try to send them from ESP32 and I connect to the Thinger, an error occurs and ESP32 restarts. Without Thinger IO, Telegram works for me ).
To make lighter ESP32 code, I intend, calculate average, maximum and minimum values ​​taken from a bucket, then upload them already treated. This could do it directly on Arduino, but I prefer to have it outsourced.
• Mosquitto MQTT
Right now, it allows me to notify Node Red, when the device is active. That is, when I have just taken the data and upload it to Thinger, I send an MQTT message to Node Red, to give a warning by Telegram (EJ .: The irrigation has finished), I do not know if there will be any easier way to do it, without going through Mosquitto and make it in real time.
I intend to make lighter the Arduino code, and use Mosquitto to pass all sensor data to Node Red and from there upload it to Thinger.

I have managed to read the values from a Thinger bucket ​​, with an “http request” node configured like this:
• in GET mode,
• with url: https://api.thinger.io/v1/users/MyUser/buckets/MyBucket/data?items=1&sort=desc
• Authentication: Bearer
• Token: MyToken
• Return: Json
Then with a “change” node configured like this, I get the desired value
• Msg.payload
• Expression: payload [0] .val.MyVariable

Now, here my problems begin, I would like, in addition to reading values, to be able to treat them (take average, minimums, maximums, etc) and upload them again to Thinger.
I tried to do it using the POST method, but I have only managed to get an error message “you are not authorized to write in this bucket”
How can I write data in a bucket from Node Network? I downloaded the Thinger module from Node Red, but its dont know how to use it.

Could someone tell me how to do it?

I have not wanted to extend too much, so in other posts, I will be publishing other problems that I also have with this program

Thank you very much to all support

He probado muchas cosas, entre ellas la siguiente con Node Red:

[{“id”:“113cb0c3.39517f”,“type”:“inject”,“z”:“5b0a2acd.4f25a4”,“name”:"",“topic”:"",“payload”:"[{“device”:“MyDevice”,“val”:{“Bomba”:1}}]",“payloadType”:“json”,“repeat”:"",“crontab”:"",“once”:false,“onceDelay”:0.1,“x”:90,“y”:440,“wires”:[[“8dcaf768.1d4118”]]},{“id”:“8dcaf768.1d4118”,“type”:“http request”,“z”:“5b0a2acd.4f25a4”,“name”:"",“method”:“POST”,“ret”:“obj”,“paytoqs”:false,“url”:“https://api.thinger.io/v1/users/MyUser/buckets/MyBucket/data",“tls”:"",“proxy”:"",“authType”:“bearer”,“x”:250,“y”:440,“wires”:[[“c1665b73.e6b7a8”]]},{“id”:“c1665b73.e6b7a8”,“type”:“debug”,“z”:“5b0a2acd.4f25a4”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:false,“complete”:“true”,“targetType”:“full”,“x”:410,“y”:440,"wires”:[]}]

Pero siempre que lo intento, recibo este mensaje : “cannot write to the requested bucket, check that is available and enabled”

Seguramente será porque cometo algún error en la forma