Hi all,
I am so far on a free account.
I have setup 1 channel. I am sending 3 values from a bitShake SmartMeterReader every 20 seconds to this channel.
When trying to send additional data from my solar inverter every 5min! and calculate some data coming from my bitShake (e.g. once per hour) and send it back to the channel I receive the following error:
Requests are too frequent. For further information, see Limitations in the documentation.
Now I understand that my messages (write orperations) to my channel are limited to 3 Mio / year or 8200/day. With my current setup I am at little more than 4K messages per day and since I just recently started my account I have still 2.840.531 messages left.
How come I get that error even if I switch even if my message limit is far from reached?
Thanks in advance for your time! Much appreciated!
btw. The link "Limitations" where it is supposed to be explained is not working (for me)
9 Comments
Time DescendingHi, thank you for your response.
The first code basically imitates the 2.8.0 (Einspeisung) of my solar power. I receive the value every 30 seconds. If it is negative I calculate the watt seconds (basically assume the value was constant fopr the last 30 seconds). After that I transform it into kWh and write it back to the channel once per hour via TimeControl.
% Definieren Sie den gewünschten Zeitraum
startDate = datetime('today'); % Startdatum
endDate = datetime('now'); % Aktuelles Datum
% Daten vom Stromverbrauch im gewünschten Zeitraum abrufen
consumptionTotal = thingSpeakRead(stromzaehlerChannelID, 'ReadKey', readAPIKey, 'Fields', 2, 'DateRange', [startDate, endDate]);
%disp(size(consumptionTotal));
% Rufen Sie die Funktion zur Berechnung des Energieverbrauchs auf
energyConsumption = calculateEnergyConsumption(consumptionTotal);
% Zeigen Sie das Ergebnis an
disp(energyConsumption);
thingSpeakWrite(writeChannelID,energyConsumption,'WriteKey',writeAPIKey, 'Fields', 6);
function energyConsumption = calculateEnergyConsumption(data)
timeInterval = 30; % Zeitintervall in Sekunden
% Initialisierung der Summe
totalEnergy = 0;
% Durchlaufen der Datenpunkte
for i = 1:length(data)
%disp(['data:',data(i)]);
if data(i) < 0 % Überprüfung auf Negativität
energy = data(i) * timeInterval; % Berechnung der Energie in Wattsekunden
totalEnergy = totalEnergy + energy; % Summierung der Energie
%disp(totalEnergy);
else %disp(int2str(data(i)));
end
end
energyConsumption = totalEnergy / 7200000; % Umrechnung in Kilowattstunden
end
The second code is simply receiving data from my Solax Inverter. Also via TimeControl every 10 minutes
api_url = 'https://www.solaxcloud.com/proxyApp/proxy/api/getRealtimeInfo.do?tokenId=XXXXXXXXXXXXXX&sn=XXXXXXXXXX';
api_call = webread(api_url)
writeChID = 1234567;
writeAPIKey = 'XXXXXXXXXXX';
res = struct(api_call.result)
acpower = res.acpower
yieldtoday = res.yieldtoday
getData = thingSpeakWrite(writeChID, [acpower,yieldtoday],'Fields',[4,5],'writeKey',writeAPIKey);
*sorry for the DE comments
Can you show a sample of the code where you are writing to ThingSpeak? You would not get the 429 error (requests too frequent) from overuse of messages, so I would guess that you may be sending messages faster than you think somehow.
Sign in to participate

