Python Script to interface with a Japanese Smart Meter's Echonet protocol via a B Route USB
Based off of the work in this blog
First, add a file to your meter
folder: meter/config.py
, containing the following:
serialPortDev = '/dev/cu.usbserial-DM03SAK8' # For MAC
# For windows try serialPortDev = 'COM3'
# For Linux try serialPortDev = '/dev/ttyUSB0'
# Your B-Route ID
rbid = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
# Your B-Route Password
rbpwd = "XXXXXXXXXXXX"
# DB information for Influx
INFLUX_TOKEN = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
INFLUX_ORG = "example@example.com"
INFLUX_BUCKET = "User's Bucket"
Now Run:
pip install -r requirements.txt
python get_power.py
Add a text file titled .env.local
to the display
folder with the following:
NEXT_PUBLIC_INFLUX_URL=<Your Influx Host URL - probably looks like -> https://us-central1-1.gcp.cloud2.influxdata.com>
NEXT_PUBLIC_INFLUX_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
NEXT_PUBLIC_INFLUX_ORG=<Your Influx Org Name>
NEXT_PUBLIC_INFLUX_BUCKET=<Your Influx Bucket Name>
With nvm installed, run the following to launch the display server:
cd display
nvm use
yarn
yarn build
yarn start
- Echonet Lite Spec: https://echonet.jp/spec_v113_lite_en/
- Specifically the Middleware Specifications
- Also the current Appendix is very useful, search for the "Requirements for low -voltage smart electric energy meter class" section