Giter Site home page Giter Site logo

wokim / tasmota-energy-meter-metrics Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 97 KB

A Node.js server that exposes the status and metrics of Tasmota Energy Meters via a REST API and Prometheus metrics endpoint.

License: MIT License

JavaScript 5.07% TypeScript 89.69% Dockerfile 5.24%

tasmota-energy-meter-metrics's Introduction

Tasmota Energy Meter Metrics

This project is an API server that provides data from energy meters. It offers measured values from dehumidifier and heating/cooling/water heating energy meters in both JSON and Prometheus metric formats.

API Endpoints

GET /info

This endpoint returns the measured values from the dehumidifier and heating/cooling/water heating energy meters in JSON format.

{
  "dehumidifierEnergyMeter": {
    "voltage": {
      "value": 224,
      "unit": "V"
    },
    "current": {
      "value": 0.233,
      "unit": "A"
    },
    ...
  },
  "heatingCoolingWaterHeatingEnergyMeter": {
    "voltage": {
      "value": 230,
      "unit": "V"
    },
    "current": {
      "value": 1.5,
      "unit": "A"
    },
    ...
  }
}

GET /metrics

This endpoint returns the measured values from the energy meters in Prometheus metric format.

# HELP energy_meter_voltage_volts_dehumidifierEnergyMeter Energy meter voltage in Volts
# TYPE energy_meter_voltage_volts_dehumidifierEnergyMeter gauge
tasmota_energy_meter_voltage_volts_dehumidifierEnergyMeter{meter_id="dehumidifierEnergyMeter"} 224

# HELP energy_meter_current_amperes_dehumidifierEnergyMeter Energy meter current in Amperes
# TYPE energy_meter_current_amperes_dehumidifierEnergyMeter gauge
tasmota_energy_meter_current_amperes_dehumidifierEnergyMeter{meter_id="dehumidifierEnergyMeter"} 0.233

...

# HELP energy_meter_voltage_volts_heatingCoolingWaterHeatingEnergyMeter Energy meter voltage in Volts
# TYPE energy_meter_voltage_volts_heatingCoolingWaterHeatingEnergyMeter gauge
tasmota_energy_meter_voltage_volts_heatingCoolingWaterHeatingEnergyMeter{meter_id="heatingCoolingWaterHeatingEnergyMeter"} 230

# HELP energy_meter_current_amperes_heatingCoolingWaterHeatingEnergyMeter Energy meter current in Amperes
# TYPE energy_meter_current_amperes_heatingCoolingWaterHeatingEnergyMeter gauge
tasmota_energy_meter_current_amperes_heatingCoolingWaterHeatingEnergyMeter{meter_id="heatingCoolingWaterHeatingEnergyMeter"} 1.5

...

Configuration

Before running the API server, you need to set the following environment variables in the .env file:

PORT=3000
DEHUMIDIFIER_ENERGY_METER_ENDPOINT=http://dehumidifier-energy-meter/data
HEATING_COOLING_WATER_HEATING_ENERGY_METER_ENDPOINT=http://heating-cooling-water-heating-energy-meter/data
  • PORT: Specifies the port number on which the API server will run.
  • DEHUMIDIFIER_ENERGY_METER_ENDPOINT: Specifies the endpoint URL to fetch data from the dehumidifier energy meter.
  • HEATING_COOLING_WATER_HEATING_ENERGY_METER_ENDPOINT: Specifies the endpoint URL to fetch data from the heating/cooling/water heating energy meter.

Running the Server

  1. Install the dependencies by running the following command in the project's root directory:

    npm install
  2. To start the API server, run the following command:

    npm start

    Once the server is started, you can access the API at the specified port.

License

MIT

tasmota-energy-meter-metrics's People

Contributors

wokim 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.