API and CLI for communicating with the Emlite meters via EMOP
Project description
Simtricity Emlite Python APIs and CLI
This repository contains:
- API to connect to and send EMOP messages to Emlite meters
- a CLI (emop) for sending messages to the meters
Configure
Configuration steps:
- create file ~/.simt/emlite.prod.env from Lastpass secret 'emop-cli-env-file (prod)'
- create file ~/.simt/emlite.qa.env from Lastpass secret 'emop-cli-env-file (qa)'
- ln -s ~/.simt/emlite.<qa|prod|custom>.env ~/.simt/emlite.env
NOTE:
- FLY_DNS_SERVER needs the DNS that wireguard uses (on Linux look under
resolvectl statusfor the interface and DNS)
see also https://www.notion.so/Emop-and-mediators-CLI-setup-834d32be5c794add8716399ab186abe8
Use
emop
emop env_show
emop env_set prod
emop --help
emop prepay_balance EML2137555666
emop csq EML2137555666
emop profile_log_1 --timestamp 2024-07-19T00:00 EML2137555666
Python API
You can also use the library directly in your Python scripts. The library offers two main client classes:
EmliteMediatorAPI: The core client for standard meter operations (reads, basic writes).EmlitePrepayAPI: Extends the core API with prepay-specific functionality (balance, tokens, tariffs).
Initialization and Logging
The EmliteMediatorAPI constructor allows you to configure the connection and log verbosity.
import logging
from simt_emlite.mediator.api_core import EmliteMediatorAPI
# Initialize the client
# The logging_level parameter controls the verbosity of the internal logger.
# It uses the standard python logging module levels (DEBUG, INFO, WARNING, ERROR).
client = EmliteMediatorAPI(
mediator_address="localhost:50051",
logging_level=logging.WARNING # Set to logging.DEBUG for verbose output
)
# Example Usage
serial = "EML2137555666"
try:
voltage = client.instantaneous_voltage(serial)
print(f"Meter {serial} voltage: {voltage}V")
except Exception as e:
print(f"Error: {e}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simt_emlite-1.1.1-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: simt_emlite-1.1.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b6107eac14be8a0e5d9e40d59af37e77f5dcdbf0288f3d7300144bf37a2dd60
|
|
| MD5 |
da44940aac53dd175a711bd7207e345d
|
|
| BLAKE2b-256 |
05b61ae5d2234058faf3676739e3e30734e69eeb58abe3ef23601dd63d77e3dc
|
File details
Details for the file simt_emlite-1.1.1-cp313-cp313-win32.whl.
File metadata
- Download URL: simt_emlite-1.1.1-cp313-cp313-win32.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.13, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af7417eee174ca5eb042bc04b157e56267625ccc8eaf68ff5f6f1a8bc697f8e6
|
|
| MD5 |
39d6e045d8a52c87c91006a8a6a86f1c
|
|
| BLAKE2b-256 |
d51443167298641c39958c4ef15fdbcea61518621143a2385eb8493e8898cc87
|
File details
Details for the file simt_emlite-1.1.1-cp313-cp313-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: simt_emlite-1.1.1-cp313-cp313-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 16.1 MB
- Tags: CPython 3.13, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e7143bed68d32bd0d37609ad48fbaac82e3a559aeceae7da4a99c8ddd527fd85
|
|
| MD5 |
91004dfc9b0b34fea0d62370d9085357
|
|
| BLAKE2b-256 |
433e7a072427bc471245b68018811943fd7df6613684fdd2dfdb8db439d6475a
|
File details
Details for the file simt_emlite-1.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: simt_emlite-1.1.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 16.4 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5a6260a24e0cc7a98ec11561786080f79ba69519c9fcf2884c5094d67fd63688
|
|
| MD5 |
0bec97aad33984a4454de6f8ffcb0f67
|
|
| BLAKE2b-256 |
c2344e901e9686c0a1d568b04e21112de685e88fcb458546f49e9511fef92f7d
|
File details
Details for the file simt_emlite-1.1.1-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: simt_emlite-1.1.1-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.3 MB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb99bfec9f66ef5753e06840ab56403fe470cca4eee2a550796b49be69d3e001
|
|
| MD5 |
1af6753713f8ccaad60cfb281c94b802
|
|
| BLAKE2b-256 |
c89c11949739b681b05815c66f700835c4588d58104866c60249babea7df0085
|