{"id":22436982,"url":"https://github.com/entorb/readout_mt681_electricity_meter","last_synced_at":"2026-04-11T13:02:39.848Z","repository":{"id":228013941,"uuid":"772933665","full_name":"entorb/readout_MT681_electricity_meter","owner":"entorb","description":"Read out electricity meter Iskra MT681 (Stromzähler)","archived":false,"fork":false,"pushed_at":"2025-06-11T20:07:13.000Z","size":272,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T15:47:59.769Z","etag":null,"topics":["arduino","esp","esp32","grafana","hichi","iskra","mqtt","mt681","python","tasmota"],"latest_commit_sha":null,"homepage":"","language":"Python","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/entorb.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,"zenodo":null}},"created_at":"2024-03-16T09:27:17.000Z","updated_at":"2025-06-11T20:07:16.000Z","dependencies_parsed_at":"2024-03-17T00:17:39.517Z","dependency_job_id":"42fd532a-442c-4d43-8825-2384147673fa","html_url":"https://github.com/entorb/readout_MT681_electricity_meter","commit_stats":null,"previous_names":["entorb/readout_mt681_power","entorb/readout_mt681_power_meter","entorb/readout_mt681_electricity_meter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/entorb/readout_MT681_electricity_meter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entorb%2Freadout_MT681_electricity_meter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entorb%2Freadout_MT681_electricity_meter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entorb%2Freadout_MT681_electricity_meter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entorb%2Freadout_MT681_electricity_meter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/entorb","download_url":"https://codeload.github.com/entorb/readout_MT681_electricity_meter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/entorb%2Freadout_MT681_electricity_meter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264951610,"owners_count":23687974,"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":["arduino","esp","esp32","grafana","hichi","iskra","mqtt","mt681","python","tasmota"],"created_at":"2024-12-06T00:10:31.793Z","updated_at":"2025-12-30T22:09:53.199Z","avatar_url":"https://github.com/entorb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Read out electricity meter Iskra MT681 (Stromzähler)\n\n## Motivation\n\nAfter installing 2 photovoltaic modules on my balcony (check out the [project documentation](https://entorb.net/wickie/Balkonkraftwerk)), my electricity provider unfortunately replaced my old electricity meter (that rotated backwards when PV production exceeded my consumption).\n\nAs the new meter has an optic interface, I decided to try to read it out to have at least some benefit of the replacement...\n\nA [great documentation](https://ottelo.jimdofree.com/stromz%C3%A4hler-auslesen-tasmota/) (in German) on how to read out different electricity meters was my starting point.\n\n## Hardware\n\nMy electricity meter is an Iskra eHZ-MT681-D4A52-K0p\n\nFor the readout I bought an [all-inclusive product](https://www.wispr-shop.de/produkt/wifi-ir-schreib-lesekopf-diy-set/) for 40€ at eBay. It bundles\n\n* Hichi IR sensor\n* micro controller ESP01S (Wi-Fi and MicroUSB power connector)\n* pre-installed software Tasmota V13.3\n\nSo no Arduino programming and no soldering ;-)\n\n## Setup\n\nFollowing the manual of the sensor I performed these steps\n\n* connect laptop to sensor's Wi-Fi\n* enter my Wi-Fi credentials\n* switch back to my Wi-Fi\n* access sensor webinterface\n* setup the electricity meter via console -\u003e script (see below)\n* activating the script\n* -\u003e data appears on the main page of the UI\n* set Logging-\u003eTelePeriod to 15 for readout every 15s\n* (optionally) configure access to my MQTT server\n\n### Tasmota script for Iskra MT681-D4A52-K0p\n\n* copied from [Tasmota documentation](https://tasmota.github.io/docs/Smart-Meter-Interface/#iskra-ehz-mt681-d4a52-k0p)\n* skipping/commenting out the last line of the static Meter_id\n\n```text\n\u003eD\n\u003eB\n=\u003esensor53 r\n\u003eM 1\n+1,3,s,0,9600,MT681\n1,77070100010800ff@1000,Verbrauch,kWh,Total_in,4\n1,77070100100700ff@1,Leistung,W,Power_cur,0\n1,77070100020800ff@1000,Erzeugung,kWh,Total_out,4\n; 1,77070100000009ff@#,Service ID,,Meter_id,0|\n```\n\n### Set timezone\n\nsee [doc](https://tasmota.github.io/docs/Commands/#control)\nin webinterface open console to read and change the timezone\n`TimeZone` show current timezone\n`TimeZone 99` use timezone configured by TimeDst and TimeStd\n\n[tasmotatimezone.com](https://tasmotatimezone.com/) provides more info, in my case it suggests this command\n`Backlog Latitude 49.5928616; Longitude 11.0056; TimeDST 0,0,3,1,1,120; TimeSTD 0,0,10,1,1,60; TimeZone 99`\n\n## Data visualization\n\n### In device webinterface\n\n[Here](https://ottelo.jimdofree.com/stromz%C3%A4hler-auslesen-tasmota/) is described, how to upload a Tasmota firmware and script, that provides data visualization on the webinterface of the device. I did not try that.\n\n![Tasmota](images/tasmota.png \"Tasmota\")\n\n### In Grafana\n\nInstead, I use some existing pieces of software on a Raspberry Pi 3b \"server\".\n\n* activate MQTT protocol in the sensor webinterface to send the data\n* Python script to receive the data via MQTT\n* InfluxDB to store the data\n* Grafana to visualize the data\n\n![Grafana](images/grafana.png \"Grafana\")\n\nSee [example_code](example_code) for Python example and Grafana dashboard model.\n\n### In HomeAssistant\n\nAlternative setup could be to use HomeAssistant to receive the data via MQTT, with is also described in the [HowTo](https://ottelo.jimdofree.com/stromz%C3%A4hler-auslesen-tasmota/).\n\n## Tasmota commands via MQTT\n\nsee [Tasmota documentation](https://tasmota.github.io/docs/Commands/)\n\nSending an empty message body, results in the device responding with its current value.\n\n```sh\nmosquitto_pub -u mqtt_user -P mqtt_passwd -t \"cmnd/tasmota_MT681/webserver\" -m \"\"\n```\n\n## Power Saving\n\n### Disable webinterface\n\nAfter setting up the device and connecting to MQTT broker, I decided to turn off the webinterface, to hopefully reduce the power consumption. (here tasmota_MT681 is the name of my device)\n\n```sh\nmosquitto_pub -u mqtt_user -P mqtt_passwd -t \"cmnd/tasmota_MT681/webserver\" -m \"0\"\n```\n\n### Sending frequency\n\nReduce the devices sending frequency to every 300s\n\n```sh\nmosquitto_pub -u mqtt_user -P mqtt_passwd -t \"cmnd/tasmota_MT681/TelePeriod\" -m \"300\"\n```\n\nSince attaching the device to a power source, instead of a power bank (see below), I use 10s during the day and 30s in the night. Switching is triggered via crontab of my raspi.\n\n### Sleep and Dynamic Sleep\n\nsee [Tasmota Energy-Saving docu](https://tasmota.github.io/docs/Energy-Saving/) on Sleep vs. Dynamic Sleep\n(currently I use default Dynamic Sleep and 50ms)\n\nset longer sleep time of 200ms (default is 50)\n\n```sh\nmosquitto_pub -u mqtt_user -P mqtt_passwd -t \"cmnd/tasmota_MT681/Sleep\" -m \"200\"\n```\n\nSwitch from Dynamic Sleep (0) to normal Sleep (1)\n\n```sh\nmosquitto_pub -u mqtt_user -P mqtt_passwd -t \"cmnd/tasmota_MT681/SetOption60\" -m \"1\"\n```\n\n## Power Supply\n\nSince I had no power plug in the meter cabinet available, I used an USB power bank. Unfortunately, that one only lasted for a couple of days, despite my power saving efforts. So I installed a 5V power source [MEAN WELL HDR-15-5](https://www.meanwell-web.com/en-gb/ac-dc-ultra-slim-din-rail-power-supply-input-range-hdr--15--5) behind a new fuse in the meter cabinet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentorb%2Freadout_mt681_electricity_meter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fentorb%2Freadout_mt681_electricity_meter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fentorb%2Freadout_mt681_electricity_meter/lists"}