Writing to ThingSpeak channels with Tasmota IR Power Reader

FLO on 7 Nov 2023 (Edited on 7 Nov 2023)
Latest activity Reply by Niels on 28 Jun 2025

Hello,
i want to write the power data from my Tasmota IR Device to my channels, but it does not work.
I have created 3 channels and i use the correct write API in the script. I use the following script:
>D
>B
=>sensor53 r
>S
if upsecs%20==0
then
=>WebSend [api.thingspeak.com] /update.json? api_key=xxxxxxxxxxxxxxxx&field1=%sml[1]%&field2=%sml[2]%&field3=%sml[3]%
endif
>M 1
+1,3,s,0,9600,
1,77070100010800ff@1000,Total consumption,kWh,total_in,2
1,77070100020800ff@1000,Total feed-in,kWh,total_out,2
1,77070100100700ff@1,Power,W,power_curr,0
#
I get the messages in the console that the data was send but my channels stay empty.
What do i miss ?
Thanks for help
Christopher Stapels
Christopher Stapels on 7 Nov 2023
try hard coding a value in this line
WebSend [api.thingspeak.com] /update.json? api_key=xxxxxxxxxxxxxxxx&field1=%sml[1]%&field2=%sml[2]%&field3=%sml[3]%
like this
WebSend [api.thingspeak.com] /update.json? api_key=xxxxxxxxxxxxxxxx&field1=10
then after you have confirmed that, you can test to be sure the numbers from the power meter are being printed right.
Also test writing to your channel via the browser address window just to be sure you have the syntax correct. You cen get the format from the API keys tab of you channel, on the right hand side,
SL
SL on 11 May 2025
I do have the same issue ;(
Hardcoding values from the browser work in the following format:
https://api.thingspeak.com/update?api_key=xxxxxxxxxxxxxxxx&field1=4104.08&field2=401.95&field3=350.00
My tasmota device sends the following corresponding data:
22:39:33.360 SCR: performs "WebSend [api.thingspeak.com] /update.json? api_key=xxxxxxxxxxxxxxxx&field1=4104.08&field2=401.95&field3=350.00"
What do i miss in the my script?
Niels
Niels on 28 Jun 2025
Hi,
I run in the same error.
In my case ist was a blank ( ) after the update.json? in front of the api-key. I saw that in a capture and also in the tamota-console
00:33:39.242 SCR: performs "WebSend [api.thingspeak.com] /update.json? api_key=key&field1=7.05&field2=88.18"
==> WebSend [api.thingspeak.com] /update.json? api_key
I delete the blank in the script and now it works.
regards Niels