Skip to main content

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 status for 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


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

simt_emlite-1.2.12-cp314-cp314t-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.14tWindows x86-64

simt_emlite-1.2.12-cp314-cp314t-win32.whl (2.6 MB view details)

Uploaded CPython 3.14tWindows x86

simt_emlite-1.2.12-cp314-cp314t-musllinux_1_2_x86_64.whl (18.4 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

simt_emlite-1.2.12-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (18.9 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

simt_emlite-1.2.12-cp314-cp314t-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

simt_emlite-1.2.12-cp314-cp314-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.14Windows x86-64

simt_emlite-1.2.12-cp314-cp314-win32.whl (2.2 MB view details)

Uploaded CPython 3.14Windows x86

simt_emlite-1.2.12-cp314-cp314-musllinux_1_2_x86_64.whl (16.6 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

simt_emlite-1.2.12-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (16.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

simt_emlite-1.2.12-cp314-cp314-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

simt_emlite-1.2.12-cp313-cp313-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.13Windows x86-64

simt_emlite-1.2.12-cp313-cp313-win32.whl (2.1 MB view details)

Uploaded CPython 3.13Windows x86

simt_emlite-1.2.12-cp313-cp313-musllinux_1_2_x86_64.whl (16.7 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

simt_emlite-1.2.12-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (17.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

simt_emlite-1.2.12-cp313-cp313-macosx_11_0_arm64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

File details

Details for the file simt_emlite-1.2.12-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 5be5c67ea4ee6a824c908fce98868615f03056ab95e0e21d9456818d33acc4da
MD5 27141bbdd9401729dd2170f680e453f0
BLAKE2b-256 439004ba110f87549c7878371400372876026735e26f3370f9a40af8f653b044

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp314-cp314t-win32.whl.

File metadata

  • Download URL: simt_emlite-1.2.12-cp314-cp314t-win32.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: CPython 3.14t, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314t-win32.whl
Algorithm Hash digest
SHA256 f564d5bc29e762eee0d658621f05fd41f3f8e59a9fcfb6318b0121e5da7ddf7a
MD5 b1c64ae939ef5741f30e22fcf8c1125a
BLAKE2b-256 e83b938743eb9f4c0c6e6d48af6ef2cc65740d0f44df1b9dd71c01cc32c8c289

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 01201d844213e4cdc876faf48da9a9428c00861bd3c13ff78536ceb9549575d1
MD5 521e4d17eb04f3ad4c21bd549b9136d4
BLAKE2b-256 8bb7ace9a531b34920b62ede0c2e3e2d22a6b3e89d262343014842583e91e074

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7bdb7f4fe05b4ea699c87129502b3615218f8df6b969f2e8a71abc647c8b634c
MD5 8aa27cc1843fa08763d7f24fc393f6e6
BLAKE2b-256 4ec9b86709062c40aaf7c08d20961e8d56116fd2cbd4660fd43d479911d7ea44

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 eefec8b3b8ca11dc3791c0377e76591683259a86919480cd30172ddb42f55a42
MD5 4469b9732fdc744b1325e541df6f6ad4
BLAKE2b-256 23e95bb8447e980db038f04bdcabfe1f64333d6ad275116bba49a1e916703875

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 4f34e9a537e043a36972cd4fa10162c186ebff8f916c0466b13d3313c73bf7c6
MD5 9e7780823a0c13f45a0caf7ed156c4c0
BLAKE2b-256 7ad9eb47896d52674f8852299bf5c7e728124af070b1a89e0df29f1269766bc7

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp314-cp314-win32.whl.

File metadata

  • Download URL: simt_emlite-1.2.12-cp314-cp314-win32.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.14, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314-win32.whl
Algorithm Hash digest
SHA256 ff185b6f9c246e7e45d1acf3c2b3d8c0abcd3f4bb20aefb94b9136d0e9dfb380
MD5 9e22340d89c0e10859fa55dc80f95d58
BLAKE2b-256 4cb4dcc001b6333f83a6ecd431857362f4b36435043efa554d645ab9516db77f

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3a6d6dd230a62ddb55ef08ef29638773881faf54db5a97d0590aea86fbfb7889
MD5 7c7a0c35e1faae3b16c32d3e55031ac6
BLAKE2b-256 73586711a31900fdc94b927187308ab6e27162891e1abd4b07153da93243e408

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 57f8ed5403786039c6a5b9d2057d1ef7ffc9cc1fd0f40f0b20b1b547befddf89
MD5 c4f72ca5004e080b299d27f840b7afc1
BLAKE2b-256 4b66337e5a161e2436ef4b662bf450edf58be7862a793ebefc163291f669e182

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c2b46bcc9e45e2972e73742c8b0061495767c9254e6fab067a33f8d9947aa04b
MD5 f664d2a5510c6abc25111b3f366da0c8
BLAKE2b-256 c517f4acc39047b3a43e1f632f07423afc0ff4a1f98ef5cc948b44a7a89275c3

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cdd866e71e730573c94b7ed6054091b149a4b12b205777b5d798811cce9914fa
MD5 fd5b18441c21152b87298f9a54b4567a
BLAKE2b-256 2692259667f575252ab4cbb067312f08c33f600dbb5cec2c634aa5255078b678

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp313-cp313-win32.whl.

File metadata

  • Download URL: simt_emlite-1.2.12-cp313-cp313-win32.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.13, Windows x86
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for simt_emlite-1.2.12-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 3820e04ce7569ea88905f181282cc237c001a5b6bbb1e3c6c4db593fabb4b8a6
MD5 1a33e1b1db96ba9d3c6d77045602fe68
BLAKE2b-256 cc46f42d5130ecdc1d47edcd32182004622a0e755a91fe108fddc0f626a2042e

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4fee094788339d3111e774024d8ea370c16169bbd3794ebe56059f65c542d339
MD5 72fa7ba25b8f2f87dcce2e8ee48fae8f
BLAKE2b-256 3d156d68f2c9d7c0674928fc54c4ddc5532343edb6a53584d4d3605630d9e4ae

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9f8930af5db8ccadb0b9f2b33d6176d5978cf2f32363c441942446d5866e9997
MD5 ae6f16417956f97ce41df46ecc6ff573
BLAKE2b-256 72850a347f5e1a86919ed19b267eed14a7fcd595de1a97a44b438ec1b2682505

See more details on using hashes here.

File details

Details for the file simt_emlite-1.2.12-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for simt_emlite-1.2.12-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 449b3b263239ade42e408a0d0cc8c2788bcffbf9c912b8a4618b6ee95bce8fdf
MD5 3a291b2211e1d6197971bfecd8671b49
BLAKE2b-256 d2037bec3d44fb4a9523b5d5a6447c974a02b0608cae7967bf31a39f29e96f6f

See more details on using hashes here.

Supported by

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