{"id":38199835,"url":"https://github.com/boomer41/sml-to-http-proxy","last_synced_at":"2026-01-17T00:27:49.070Z","repository":{"id":173119760,"uuid":"650249067","full_name":"boomer41/SML-to-HTTP-Proxy","owner":"boomer41","description":"A proxy to read the binary SML (Smart Meter Language) stream of smart meters over TCP/IP, and making it available under a JSON REST API","archived":false,"fork":false,"pushed_at":"2024-10-31T18:22:15.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-31T19:23:28.524Z","etag":null,"topics":["openhab","proxy","smart-home","smart-message-language","smartmeter","sml"],"latest_commit_sha":null,"homepage":"","language":"Go","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/boomer41.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2023-06-06T17:00:35.000Z","updated_at":"2024-10-31T18:21:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"68e6246b-58bf-4195-90f9-a17ed081f2e6","html_url":"https://github.com/boomer41/SML-to-HTTP-Proxy","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"b91894ef7e7d6169838c71073388cac3d55bd88f"},"previous_names":["boomer41/sml-to-http-proxy"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/boomer41/SML-to-HTTP-Proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boomer41%2FSML-to-HTTP-Proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boomer41%2FSML-to-HTTP-Proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boomer41%2FSML-to-HTTP-Proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boomer41%2FSML-to-HTTP-Proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boomer41","download_url":"https://codeload.github.com/boomer41/SML-to-HTTP-Proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boomer41%2FSML-to-HTTP-Proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28490097,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T23:55:29.509Z","status":"ssl_error","status_checked_at":"2026-01-16T23:55:29.108Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["openhab","proxy","smart-home","smart-message-language","smartmeter","sml"],"created_at":"2026-01-17T00:27:45.720Z","updated_at":"2026-01-17T00:27:49.022Z","avatar_url":"https://github.com/boomer41.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SML to HTTP proxy\n\nThis application is designed to read a binary SML stream via TCP/IP and export all values via a simple HTTP REST API using JSON.\nIt is intended to be used with home automation systems to read the values of smart meters.\nIn the most basic configuration, a serial to TCP/IP converter in conjunction with a D0 read head can be used.\n\n## Building\n\nTo build this application first install Go 1.19 or later.\nThen run the actual build:\n\n```shell\ngo build\n```\n\n## Usage\n\nFirst create a configuration file named `config.yml`.\nReplace the IP address serial to TCP/IP converter in the meters section.\nNote: You can add multiple meters, not just one.\n\nTo disable the HTTP request log, set `web/disable_request_log` to `true`.\nSimilarly, you can disable the SML reception log by setting `meters/disable_reception_log` to `true` on a per meter basis.\n\n```yaml\nweb:\n  address: 127.0.0.1:11123\n  disable_request_log: false\n\nmeters:\n  - id: my_smartmeter\n    address: 192.168.0.1:8234\n    reconnect_delay: 10\n    read_timeout: 5\n    connect_timeout: 10\n    debug: false\n    disable_reception_log: false\n```\n\nThen start the application:\n\n```shell\n./sml-to-http -config config.yml\n```\n\nThe log should now yield that the connection is successful and that SML frames are being decoded.\nYou can then try to access the API:\n\n```shell\ncurl http://127.0.0.1:11123/processImage\n```\n\nThe response should look something along the lines of:\n\n```json\n{\n  \"meters\": {\n    \"my_smartmeter\": {\n      \"connected\": true,\n      \"lastUpdate\": \"2023-06-06T13:12:10.064515753Z\",\n      \"values\": {\n        \"1-0:1.8.0*255\": {\n          \"value\": 123456.7,\n          \"unit\": 30\n        },\n        \"1-0:2.8.0*255\": {\n          \"value\": 234567.8,\n          \"unit\": 30\n        },\n        \"1-0:16.7.0*255\": {\n          \"value\": -3210,\n          \"unit\": 27\n        },\n        \"... continued ...\": {}\n      }\n    }\n  }\n}\n```\n\nThe response above has been truncated a bit, but you should get the gist out of it.\nIn the example above, the OBIS key `1-0:1.8.0*255` yields a value of `123456.7`, which represents 123456.7 kWh of retrieved energy from the energy provider.\nAlso, we have sold 234567.8 kWh of energy to the service provider.\nAnd our current power draw is -3210 W, so we are currently selling 3210 Watts to the service provider.\nA positive value here would mean that we currently buy energy from the provider.\nPlease refer to your smart meter user manual for exported OBIS items.\n\nNote:\nMost smart meters will only export basic information via the optical interface when the PIN protection is not deactivated.\nThis is by design, as the currently used power is considered privacy sensitive.\nTo get the full data set, please refer to the manual of your smart meter on how to enable the full data set.\n\n## Debugging SML output\n\nWhen you have a dump of the meter's output in a file, you can decode the file's content using the following command.\nIt will dump every *valid* SML message in the file.\nInvalid messages (e.g. CRC does not match or invalid structure) are ignored.\n\n```shell\n./sml-to-http -dump \u003cfile\u003e\n```\n\n## Integration with OpenHAB\n\nThe proxy is currently in production use in combination with OpenHAB, but may of course serve other systems.\nFor this example, the HTTP binding and the JSONPath transformation addons are required.\nAn example configuration might be:\n\n```text\nThing http:url:smlToHttp \"SML to HTTP\" [\n    baseURL=\"http://127.0.0.1:11123/processImage\",\n    refresh=2\n] {\n    Channels:\n        Type number : my_smartmeter_1_8_0 \"My SmartMeter 1.8.0\" [ stateTransformation=\"JSONPATH:$.meters.my_smartmeter.values.['1-0:1.8.0*255'].value\", unit=\"Wh\", mode=\"READONLY\" ]\n        Type number : my_smartmeter_2_8_0 \"My SmartMeter 2.8.0\" [ stateTransformation=\"JSONPATH:$.meters.my_smartmeter.values.['1-0:2.8.0*255'].value\", unit=\"Wh\", mode=\"READONLY\" ]\n        Type number : my_smartmeter_16_7_0 \"My SmartMeter 16.7.0\" [ stateTransformation=\"JSONPATH:$.meters.my_smartmeter.values.['1-0:16.7.0*255'].value\", unit=\"W\", mode=\"READONLY\" ]\n}\n```\n\n## License\n\n    SML to HTTP proxy\n    Copyright (C) 2023  Stephan Brunner\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboomer41%2Fsml-to-http-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboomer41%2Fsml-to-http-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboomer41%2Fsml-to-http-proxy/lists"}