Skip to content

Commit

Permalink
Updated how to use!
Browse files Browse the repository at this point in the history
  • Loading branch information
scadaguru committed May 27, 2020
1 parent 3a71184 commit 236b31f
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 10 deletions.
74 changes: 69 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,71 @@
# pysmtreader
# pysmtreader (Python based SMT Reader):

API for https://www.smartmetertexas.com
Python application to poll electric Smart Meter Texas from https://www.smartmetertexas.com

This application uses undocumented API for https://www.smartmetertexas.com.
Big thanks to https://github.com/keatontaylor/smartmetertexas-api for the API details.

# What it does:
It polls www.smartmetertexas.com to get electric meter reading every hour (can be configured to read maximum twice per hour as restricted by www.smartmetertexas.com). Once read it will send read data to Home Assistant (Read more details at https://www.home-assistant.io/)

# How to use:
Applicaton is available at Docker Hub and can be used in one of the two ways:
1. Docker

Run the following command:
~~~
docker run -d -v ./config/:/config scadaguru/pysmtreader
~~~

2. Docker Compose

~~~
version: "3"
services:
pysmtreader:
container_name: pysmtreader
image: scadaguru/pysmtreader
volumes:
- ./config/:/config
restart: unless-stopped
~~~

# Update config.yaml file:
Update default config,yaml with your information mentioned below:
Please update username, password, esiid, meter_number, base_url and access_token lines in the default config.yaml by removing "__REPLACE__" and providing your values otherwise application will not run!

~~~
logs:
level: debug # debug, info(default), warning, error, critical
log_file_name: pysmt # without extension, log extension will be added automatically
health_check:
log_info_line_at: 30 # in minutes, 0: disable
smartmetertexas: # smartmetertexas.com
base_url: https://smartmetertexas.com/api
username: _REPLACE_ # Update with your username to access smartmetertexas.com
password: _REPLACE_ # Update with your password to access smartmetertexas.com
esiid: _REPLACE_ # Update with your ESSID, you can find from your electric bill or once you login to smartmetertexas.com
meter_number: _REPLACE_ # Update with your Meter Number, you can find in your electric bill or once you login to smartmetertexas.com
poll_interval_minutes: 60 # 0: disable, do set below 30 as smartmetertexas.com will not allow reading more than twice in an hour
wait_interval_before_ondemand_read_minutes: 5
force_first_read: False # if true it will attempt to read Smart Meter Texas, otherwise at poll_interval
home_assistant: # Home Assistant access details
base_url: _REPLACE_ # your Home Assistant URL/IP, no slash (/) at the end for example: http://192.168.1.149:8123
access_token: _REPLACE_ # your Home Assistant access token
ha_entity: sensor.smt_reading # home assistnat entity name to be created
~~~

# What Data Sent to Home Assistant:
### current_state: Latest reading value
### prev_state: Previous reading value
### difference: This is computed difference from latest and previoud reading, so if you polling once an hour it is hourly usage
### unit_of_measurement: KW
### odrusage: This is provided by smartmetertexas.com and most likely it is total since last day
### last_timestamp: Last read time in the format of 2020-05-27 14:30:01.674

## Below is the image how it looks in Home Assistant
![Below is the image how it looks in Home Assistant](images/home_assistant.jpg)

# Notes:
1. Make sure to rename config-example.yaml to config.yaml and change "_REPLACE_" text to your values
2. Big thanks to https://github.com/keatontaylor/smartmetertexas-api for providing API documentation
10 changes: 5 additions & 5 deletions config-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ health_check:

smartmetertexas: # smartmetertexas.com
base_url: https://smartmetertexas.com/api
username: _REPLACE_ # your user name for smartmetertexas.com
password: _REPLACE_ # your password for smartmetertexas.com
esiid: _REPLACE_ # your ESSID for smartmetertexas.com
meter_number: _REPLACE_ # your Meter Number for smartmetertexas.com
poll_interval_minutes: 60 # 0: disable, do set below 30 as smartmetertexas.com will not allow readming more than twice in an hour
username: _REPLACE_ # Update with your username to access smartmetertexas.com
password: _REPLACE_ # Update with your password to access smartmetertexas.com
esiid: _REPLACE_ # Update with your ESSID, you can find from your electric bill or once you login to smartmetertexas.com
meter_number: _REPLACE_ # Update with your Meter Number, you can find in your electric bill or once you login to smartmetertexas.com
poll_interval_minutes: 60 # 0: disable, do set below 30 as smartmetertexas.com will not allow reading more than twice in an hour
wait_interval_before_ondemand_read_minutes: 5
force_first_read: False # if true it will attempt to read Smart Meter Texas, otherwise at poll_interval

Expand Down
Binary file added images/home_assistant.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 236b31f

Please sign in to comment.