Giter VIP home page Giter VIP logo

mqtt-watermeter's Introduction

mqtt-watermeter

Combining Mysensors Water Meter Pulse Sensor[link] with GoodWeLogger[link] to create a watermeter that sends its data over MQTT.

For example to use with Hass.io [link]

Requirements

  • ESP8266 (Wemos/LOLIN D1 mini)
  • TCRT5000 IR module
  • Basic soldering and wiring skills
  • (For Wemos d1 mini) CH340G driver [link]

Arduino IDE

  • Add boards Preferences -> Additional Board Manager URLs Add http://arduino.esp8266.com/stable/package_esp8266com_index.json Than install wemos boards (esp8266 by ESP8266 Community) tools -> board -> boards manager
  • Install lib pubsubclient[link]

Connection scheme

ESP8266 TCRT5000
3.3v VCC
GND GND
RX D0

Installation

Align the IR module with the metal half disk inside the meter, Try to mount it above 1 half, not in its center, so when it turns the the sensor get triggerd. Adjust the trimpot so it just triggered when the disk is underneath.

elster_v200

Settings

Copy Settings.example.h to Settings.h and fill in the correct data.

Setting default Description
WIFI_HOSTNAME WaterMeterPuls device name on network
WIFI_SSID - Wifi name to connect to
WIFI_PASSWORD - Wifi password
MQTT_HOST_NAME - MQTT broker address
MQTT_PORT 1833 MQTT broker port
MQTT_USER_NAME - MQTT user name
MQTT_PASS - MQTT password
MQTT_QUICK_UPDATE_INTERVAL 1000 (?) Send interval (ms)
MQTT_REGULAR_UPDATE_INT 10000 (?) Send interval (ms)
MQTT_TOPIC watermeter MQTT topic prefix
DATA_PIN 3 Pin of IR module D0
PULSE_FACTOR 1000 Number of blinks per m3 of your meter (One rotation/liter)
MAX_FLOW 40 Max flow (l/min) value to report. This filters outliers
SEND_FREQUENCY 3000 Time (ms) between posts
DEBUGE_MODE true debug mode

MQTT

Subscribe to watermeter/<topic> in your MQTT client. prefix can be changes in the settings.

Topic Description Unit
vol total m3 since reboot m3
puls total pulses since reboot int
flow water flow in l/min l/min

Example:

watermeter/vol:  0.005
watermeter/puls: 76
watermeter/flow: 37.0425

mqtt-watermeter's People

Contributors

bram2202 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mqtt-watermeter's Issues

Will Testament

Hi Bram, great script. Currently I'm trying to add a Will Testament to your existing code and some other small updates. But somehow after a x seconds my Will testament is set to "no" again,

Any thougs on this?

I changed in MQTTPublisher.ccp line 41:

clientConnected = client.connect(clientId.c_str(), MQTT_USER_NAME, MQTT_PASSWORD, MQTT_TOPIC "/online", 0, true, "no" );

and on line 57:

client.publish(MQTT_TOPIC "/online", "yes", true);

Thanks in advance

Boot loop with nodemcu v3

Nice work but for some reason I am getting a boot loop on my nodemcu v3 any idea what I can do differently to get this to work :) ?

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.