Code Monkey home page Code Monkey logo

shackstrom's Introduction

shackstrom - proprietary interface to mqtt

What it does?

It's only possible to read the energy consumption data manually over the webinterface.

The script read the current (total) energy consumption from the webinterface once every minute. The data is then parsed, transformed in Watthours and published it via mqtt.

how to install

just add the following part to your nix-config (and update the rev&hash )

{ pkgs, ... }:
let
  src = pkgs.fetchFromGitHub {
    repo = "shackstrom";
    owner = "samularity";
    rev = "adfbdc7d12000fbc9fd9367c8ef0a53b7d0a9fad";
    hash = "sha256-77vSX2+1XXaBVgLka+tSEK/XYZASEk9iq+uEuO1aOUQ=";
  };
  pkg = pkgs.writers.writePython3 "test_python3" {
    libraries = [ pkgs.python3Packages.requests pkgs.python3Packages.paho-mqtt  ];
  } (builtins.readFile "${src}/shackstrom.py");
in
{
    systemd.services = {
      u300-power = {
        enable = true;
        environment = { 
          DATA_URL = "http://10.42.20.255/csv.html";
          BROKER = "mqtt.shack";
        };
        serviceConfig = {
          Restart = "always";
          ExecStart = pkg;
          RestartSec = "15s";
        };
        wantedBy = [ "multi-user.target" ];
      };
    };
}

Device Info

User-Manual: https://www.sms-guard.org/downloads/IPswitch-S0-mini-Anleitung.pdf

GIF

shackstrom's People

Contributors

samularity avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.