{"id":24757164,"url":"https://github.com/magcode/sem6000-mqtt","last_synced_at":"2025-07-01T12:32:57.230Z","repository":{"id":45158614,"uuid":"270233332","full_name":"magcode/sem6000-mqtt","owner":"magcode","description":"MQTT for VOLTCRAFT SEM6000","archived":false,"fork":false,"pushed_at":"2025-01-18T13:53:55.000Z","size":116,"stargazers_count":21,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T07:51:04.959Z","etag":null,"topics":["ble","iot","mqtt","voltcraft"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-07T07:50:07.000Z","updated_at":"2025-02-14T11:31:15.000Z","dependencies_parsed_at":"2024-12-30T08:18:44.789Z","dependency_job_id":"5d127ee6-e907-4449-a83c-c82cc29d4933","html_url":"https://github.com/magcode/sem6000-mqtt","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/magcode/sem6000-mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magcode%2Fsem6000-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magcode%2Fsem6000-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magcode%2Fsem6000-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magcode%2Fsem6000-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magcode","download_url":"https://codeload.github.com/magcode/sem6000-mqtt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magcode%2Fsem6000-mqtt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262963203,"owners_count":23391773,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ble","iot","mqtt","voltcraft"],"created_at":"2025-01-28T14:36:29.037Z","updated_at":"2025-07-01T12:32:57.156Z","avatar_url":"https://github.com/magcode.png","language":"Java","readme":"# MQTT for VOLTCRAFT SEM6000\n\nThis 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!\n\nBased on the great work of [Heckie](https://github.com/Heckie75/voltcraft-sem-6000) and [hypfvieh](https://github.com/hypfvieh/bluez-dbus).\n\nAt the moment only crucial features are implemented: switching the relay, getting power and today's consumption values.\n\n# Supported environments\nThe tool only runs on Linux and requires Java and [Bluez](http://www.bluez.org/).\nIt has been tested on the following environments:\n\n```\nRaspberry PI 3 B, Raspbian 10 Buster, OpenJDK 11.0.7, Bluez 5.50, built-in Bluetooth adapter usb:v1D6Bp0246d0532\nRaspberry PI 3 B, Raspbian 10 Buster, OpenJDK 11.0.7, Bluez 5.50, USB Bluetooth adapter 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle\nVirtual machine, Ubuntu 20.04, OpenJDK 11.0.7, Bluez 5.54, Intel Bluetooth adapter 8087:0a2b\n```\n# Please contribute\n\nFor problems: Report [issues](https://github.com/magcode/sem6000-mqtt/issues).\n\nFor the missing features: Create pull requests.\n\n# Configuration\nYou need a `sem6.properties` file where you can configure multiple SEM6000 devices.\n\n```\nrootTopic=home/mysemdevices             # the mqtt root topic\nmqttServer=tcp://192.168.0.1            # IP or hostname of your mqtt broker\nusername=mqttuser                       # username for mqtt broker (optional, leave empty if not needed)\npassword=mqttpassword                   # password for mqtt broker (optional, leave empty if not needed)\nmqttDiscovery=true                      # set to false if you don't want to use mqtt discovery\nhomeassistantRootTopic=homeassistant    # the root topic for homeassistant discovery messages\n\nsem1.mac=00:00:00:00:00:01              # the mac of your sem6000 device\nsem1.pin=0000                           # the PIN of your sem6000 device\nsem1.name=sem1                          # the name of your sem6000 device, use [a-z0-9]\nsem1.refresh=60                         # the schedule to send MQTT status information, seconds. Do not go below 30.\n\nsem2.mac=00:00:00:00:00:02\nsem2.pin=0000\nsem2.name=sem2\nsem2.refresh=60\n```\n\nHow to get the mac? Log on to your host and enter\n```\nbluetoothctl\ndevices\n```\n\n# Running\nIt can simply be run with\n\n`java -jar sem6000-mqtt-1.0.0-jar-with-dependencies.jar`\n\nDon't forget to put the `sem6.properties` right beside the jar file.\n\n## MQTT Discovery\nIf you set `mqttDiscovery=true` in the properties file, the tool will expose the SEM6000 devices to Home Assistant via MQTT discovery. The devices will be automatically discovered and added to Home Assistant.\n\n\n# Control sockets\nUse the following topic and payloads to control the relay:\n```\n\u003croottopic from properties file\u003e/\u003cname of sem6000 from properties file\u003e/relay/set (true|false)\n```\nUse the following topic and payloads to enable/disable the LED:\n\n```\n\u003croottopic from properties file\u003e/\u003cname of sem6000 from properties file\u003e/led/set (true|false)\n```\n\n# Get socket data\nThe tool will publish the following messages every 60 seconds (as configured in properties file):\n\n```\n\u003croottopic from properties file\u003e/\u003cname of sem6000 from properties file\u003e/voltage     (voltage)\n\u003croottopic from properties file\u003e/\u003cname of sem6000 from properties file\u003e/power       (current power in watts)\n\u003croottopic from properties file\u003e/\u003cname of sem6000 from properties file\u003e/relay       (relay, true or false)\n\u003croottopic from properties file\u003e/\u003cname of sem6000 from properties file\u003e/energytoday (consumed energy since midnight in watt hours)\n```\n\n# Stability and reconnects\nA 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.\n\n# Raspberry PI\n\nInstall the required packages:\n\n```\nsudo apt install default-jdk\n```\n\n## Systemd service\n\nYou can create a systemd service to run the tool as a service. Create a file `/etc/systemd/system/sem6000-mqtt.service` with the following content:\n\n```\n[Unit]\nDescription=sem6000-mqtt\nAfter=network.target\n\n[Service]\nExecStart=/path/to/java -jar /path/to/sem6000-mqtt-1.0.0-jar-with-dependencies.jar\nWorkingDirectory=/path/to\nStandardOutput=inherit\nStandardError=inherit\nRestart=always\nUser=pi\n\n[Install]\nWantedBy=multi-user.target\n```\n\nReplace `/path/to/java`, `/path/to/sem6000-mqtt-1.0.0-jar-with-dependencies.jar` and `/path/to` with the correct paths.\n\nYou will find the java path by running: `which java` and the path to the jar file by running: `pwd` in the directory where the jar file is located.\n\nThen run the following commands to reload the systemd configuration:\n\n```\nsudo systemctl daemon-reload\n```\n\nThen run the following commands to enable and start the service:\n\n```\nsudo systemctl enable sem6000-mqtt\nsudo systemctl start sem6000-mqtt\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagcode%2Fsem6000-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagcode%2Fsem6000-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagcode%2Fsem6000-mqtt/lists"}