Neusoft Dorm Electricity
Query a dormitory electricity balance through the campus payment service. Require the user's campus account, password, and dormitory room number. Treat all credentials and session data as secrets.
Setup
- Copy
config/account.template.jsontoconfig/account.json. - Enter
username,password, andcustRechNo. Use a room format such as24-A120. - Install the dependencies with
python -m pip install -r scripts/upstream/requirements.txt.
Never commit config/account.json or runtime/session_dump.json.
Query
Run:
python scripts/query_balance.py
Optionally override the configured room for a single query:
python scripts/query_balance.py --room 24-A120
Return the room number, balance in CNY, remaining electricity in kWh when available, and the upstream status message. Do not expose the password, session cookie, or raw login payload.
Troubleshooting
- Missing fields: populate
username,password, andcustRechNoinconfig/account.json. - Login failure: verify campus credentials; upstream SSO changes can also cause this.
- Query failure: verify the room format and retry later when the payment service is unavailable.
- Missing
gmssl: installscripts/upstream/requirements.txt.