Skip to content

Instantly share code, notes, and snippets.

View omagasohe's full-sized avatar

James Stallings omagasohe

View GitHub Profile
@omagasohe
omagasohe / gist:1eeb97adb063d7c9b894c62e749be21a
Last active April 30, 2026 03:43
Script to have a Shelly PM upload power usage directly to InfluxDB2
// 1. Use the EXACT string for the header to avoid concatenation issues
let AUTH_TOKEN = "Token <Influx API token2>";
let SERVER_ADDY = "<IP or FQDN of INFLUX2>"
let ORG_ID = "<the long Hexidecimal ID>
let BUCKET = "<the long Hexidecimal ID>
let INTERVAL = 5 //Time in Seconds
function pushToInflux() {
Shelly.call("PM1.GetStatus", { id: 0 }, function (result, error_code, error_message) {
if (error_code !== 0) return;