Giter Club home page Giter Club logo

sem6000-mqtt's Introduction

MQTT for VOLTCRAFT SEM6000

This tool allows to control VOLTCRAFT SEM6000 BLE (bluetooth low energy) power measurement sockets via MQTT and therefore easy integration in the home automation of your choice!

Based on the great work of Heckie and hypfvieh.

At the moment only crucial features are implemented: switching the relay, getting power and today's consumption values.

Supported environments

The tool only runs on Linux and requires Java and Bluez. It has been tested on the following environments:

Raspberry PI 3 B, Raspbian 10 Buster, OpenJDK 11.0.7, Bluez 5.50, built-in Bluetooth adapter usb:v1D6Bp0246d0532
Raspberry PI 3 B, Raspbian 10 Buster, OpenJDK 11.0.7, Bluez 5.50, USB Bluetooth adapter 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle
Virtual machine, Ubuntu 20.04, OpenJDK 11.0.7, Bluez 5.54, Intel Bluetooth adapter 8087:0a2b

Please contribute

For problems: Report issues.

For the missing features: Create pull requests.

Configuration

You need a sem6.properties file where you can configure multiple SEM6000 devices.

rootTopic=home/mysemdevices       # the mqtt root topic
mqttServer=tcp://192.168.0.1      # IP or hostname of your mqtt broker

sem1.mac=00:00:00:00:00:01        # the mac of your sem6000 device
sem1.pin=0000                     # the PIN of your sem6000 device
sem1.name=sem1                    # the name of your sem6000 device, use [a-z0-9]
sem1.refresh=60                   # the schedule to send MQTT status information, seconds. Do not go below 30.

sem2.mac=00:00:00:00:00:02
sem2.pin=0000
sem2.name=sem2
sem2.refresh=60

How to get the mac? Log on to your host and enter

bluetoothctl
devices

Running

It can simply be run with

java -jar sem6000-mqtt-1.0.0-jar-with-dependencies.jar

Don't forget to put the sem6.properties right beside the jar file.

Control sockets

Use the following topic and payloads to control the relay:

<roottopic from properties file>/<name of sem6000 from properties file>/relay/set (true|false)

Use the following topic and payloads to enable/disable the LED:

<roottopic from properties file>/<name of sem6000 from properties file>/led/set (true|false)

Get socket data

The tool will publish the following messages every 60 seconds (as configured in properties file):

<roottopic from properties file>/<name of sem6000 from properties file>/voltage     (voltage)
<roottopic from properties file>/<name of sem6000 from properties file>/power       (current power in watts)
<roottopic from properties file>/<name of sem6000 from properties file>/relay       (relay, true or false)
<roottopic from properties file>/<name of sem6000 from properties file>/energytoday (consumed energy since midnight in watt hours)

Stability and reconnects

A BLE connection is not stable sometimes. The tool will attempt to reconnect to the socket after five minutes in case the connection gets lost. It will stop reconnecting after reaching 100 consecutive unsuccessful reconnects.

sem6000-mqtt's People

Contributors

magcode avatar dependabot[bot] 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.