Skip to main content

Collect data from Hitchi Smartmeter and expose it via MQTT

Project description

pysmartmeter

Collect data from Hitchi Smartmeter (USB Version) and expose it via MQTT.

quickstart

~$ git clone https://github.com/jedie/pysmartmeter.git
~$ cd pysmartmeter
~/pysmartmeter$ make install-poetry
~/pysmartmeter$ make install
~/pysmartmeter$ ./cli.sh --help
+ exec .venv/bin/python -m pysmartmeter --help
PySmartMeter v0.1.0

 Usage: python -m pysmartmeter [OPTIONS] COMMAND [ARGS]...

╭─ Options ─────────────────────────────────────────────────────────────────────────────────────────╮
│ --install-completion        [bash|zsh|fish|powershell|pwsh]  Install completion for the specified │
│                                                              shell.                               │
│                                                              [default: None]                      │
│ --show-completion           [bash|zsh|fish|powershell|pwsh]  Show completion for the specified    │
│                                                              shell, to copy it or customize the   │
│                                                              installation.                        │
│                                                              [default: None]                      │
│ --help                                                       Show this message and exit.          │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯
╭─ Commands ────────────────────────────────────────────────────────────────────────────────────────╮
│ check-code-style                                                                                  │
│ coverage                     Run and show coverage.                                               │
│ debug-settings               Display (anonymized) MQTT server username and password               │
│ debug-systemd-service        Just print the systemd service file content                          │
│ detect-serial                Just print the detected serial port instance                         │
│ dump                         Just dump serial output                                              │
│ fix-code-style               Fix code style via darker                                            │
│ mypy                         Run Mypy (configured in pyproject.toml)                              │
│ publish-loop                 Publish current data via MQTT (endless loop)                         │
│ setup-systemd-service        Setup PySmartMeter systemd services and starts it.                   │
│ store-settings               Store MQTT server settings.                                          │
│ systemd-status               Call systemd status of PySmartMeter services                         │
│ systemd-stop                 Stop PySmartMeter systemd services                                   │
│ test                         Run unittests                                                        │
╰───────────────────────────────────────────────────────────────────────────────────────────────────╯

Test if you Hitchi Smartmeter with CP2102 USB to UART Bridge Controller works, e.g.:

~/pysmartmeter $ ./cli.sh dump

Maybe you have to setup permissions, e.g.:

sudo chmod +r /dev/ttyUSB0

publish smartmeter data via MQTT

You have to store your MQTT settings (host, port, username, password) one time, e.g.:

~/pysmartmeter$ ./cli.sh store-settings

Setup systemd service:

~/pysmartmeter$ sudo ./cli.sh setup-systemd-service

various links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysmartmeter-0.1.0.tar.gz (29.8 kB view details)

Uploaded Source

Built Distribution

pysmartmeter-0.1.0-py3-none-any.whl (37.3 kB view details)

Uploaded Python 3

File details

Details for the file pysmartmeter-0.1.0.tar.gz.

File metadata

  • Download URL: pysmartmeter-0.1.0.tar.gz
  • Upload date:
  • Size: 29.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pysmartmeter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d53111b6bce07b797e5656671776af39e0a2a3bc2804b3bb8f32f04a36b20aa6
MD5 e0a5a797a918d292f5e83d2a1478016c
BLAKE2b-256 81435acb5182c5f6cd3f47b662bcbbf83d3bfe62cac83af03f572f1424e65881

See more details on using hashes here.

File details

Details for the file pysmartmeter-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pysmartmeter-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 37.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for pysmartmeter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c50968824905de9a3c237f303caaf6224c7822a3208ad48f2c6f7b005d61fdf8
MD5 3070e3e60211527b073265b92dfd6895
BLAKE2b-256 5388188b9b0443a678cf10593f2613a298bca2a2c2ed231f51af74ba5986253f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page