NEWS
Werte des Stromzählers nach Thingspeak schicken
-
Hallo zusammen,
auf einem Raspi läuft IObroker 5.3.8, der angeschlossene Leser für den Stromzähler wird auch erkannt, die richtigen Werte werden korrekt ausgegeben. Nun möchte ich gerne die beiden Werte "Zählerstand Summe" und "Momentanwert Gesamtwirkleistung" nach Thingspeak schicken.
Dazu folgendes Javascript:function ExportToThingspeak(ChannelApiKey,Field,FieldValue,TimeOutSek) { var ChannelUrl = "https://api.thingspeak.com/update?api_key="+ChannelApiKey+"&"+Field+"="+FieldValue; setTimeout(DoThingSpeakRequest, TimeOutSek*100, ChannelUrl); } function DoThingSpeakRequest(ChannelUrl) { request( { url: ChannelUrl, json: true }, function (error, response, body) { log('DoThingSpeakRequest - ChannelUrl: ' + ChannelUrl); } ); } on({id: "'smartmeter.0.1-0:1_8_0__255.value'/*1-0:1 8 0 255 value*/", change: "any"}, function (obj) { var value = obj.state.val; var oldValue = obj.oldState.val; ExportToThingspeak("MeinWriteKeyAPI","field1",value.toString(),2); }); on({id: "'smartmeter.0.1-0:16_7_0__255.value'/*1-0:16 7 0 255 value*/", change: "any"}, function (obj) { var value = obj.state.val; var oldValue = obj.oldState.val; ExportToThingspeak("MeinWriteKeyAPI","field2",value.toString(),2); });Bei Thingspeak kommt aber leider nichts an. Was mache ich falsch?
Vielen Dank für Hilfe!
Tobias
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login