gauger 4.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ # uv / python
2
+ .venv/
3
+ __pycache__/
4
+ *.egg-info/
5
+ .pytest_cache/
6
+
7
+ # editors
8
+ .idea/
9
+ .vscode/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,532 @@
1
+ # GREMLIN® Tank Monitoring — Consumer API Reference
2
+
3
+ **Reverse-engineered from:** `GREMLIN Tank Monitoring` v5.1.5 (Android, `com.angusenergy.GremlinTankMonitoring`, built Nov 2022, Expo/React Native SDK 46) and cross-checked against **v5.9.5** (XAPK, built 2024, Expo SDK 51, Hermes bytecode — see §11 for the delta).
4
+ **Source of evidence:** v5.1.5's plain-JS `assets/index.android.bundle` (module IDs cited per section) and v5.9.5's Hermes bytecode string table (HBC v96, parsed per BytecodeFileFormat.h).
5
+ **Vendor:** Angus Energy (Angus Analytics) — consumer tank-monitor app for heating-oil / propane tank level monitors ("GREMLIN" monitors). The v5.9.5 rebrand points at the **"Brite"** platform (`brite2.com`).
6
+
7
+ > **Purpose of this document:** interoperability (querying your own tank's status from your own scripts). All findings come from static analysis of the app bundles plus unauthenticated probes. Response shapes marked *inferred* are derived from how the app consumes them; shapes marked *verified* were confirmed against the live servers (Nov 2026).
8
+
9
+ ---
10
+
11
+ ## 1. Hosts & base URLs
12
+
13
+ | Service | Base URL | Auth | Status (Nov 2026 probe) |
14
+ |---|---|---|---|
15
+ | Consumer API (primary, v5.9.5) | `https://brite2.com` | `x-access-token` header | **LIVE** — verified (`/tms/config` 200, `/consumer/signIn` 401, `/consumer/api` 401, `/consumer/usernameAvailable` 200) |
16
+ | Consumer API (legacy, v5.1.5) | `https://support.paygo.net` | `x-access-token` header | **STILL LIVE** — same backend, parallel host (verified identically) |
17
+ | AMS constants (v5.9.5) | `https://tank-monitor.brite2.com/constants/ams` | none | **LIVE** — verified, catalog refreshed (see §8.1) |
18
+ | Geometry multipliers (v5.9.5) | `https://tank-monitor.brite2.com/constant/multipliers` | none | **LIVE** — verified |
19
+ | AMS constants (v5.1.5, retired) | `http://monitor.service.aa-api.com/constants/ams` | none | **DEAD** — DNS no longer resolves; removed from the app in v5.9.5 |
20
+ | Geometry multipliers (v5.1.5, retired) | `https://monitor.service.aa-api.com/constant/multipliers` | none | **DEAD** — removed from the app in v5.9.5 |
21
+ | Alert/notification service (v5.1.5, retired) | `https://alert.service.aa-api.com/` | `x-access-token` | **DEAD** — replaced in v5.9.5 by endpoints on the main API (§8.3) |
22
+ | TMS config | `GET /tms/config` on either consumer host | none | **LIVE** — returns `{"monitorAPI":{"url":"http://monitors.angusenergy.net/","port":344}}` |
23
+ | Monitor ingest (device→cloud) | `http://monitors.angusenergy.net/:344` (v5.1.5 fallback was `http://monitors.paygo.net/:344`) | n/a | device-side only; not used by the app directly |
24
+ | Device provisioning AP | `http://192.168.4.1` | none | local — GREMLIN monitor in WiFi-setup mode |
25
+ | Branding assets | `https://storage.googleapis.com/aa-platform-branding/logos/…` | none | CDN |
26
+ | Support / TOS | `http://support.gremlinmonitors.com/#/Tos` | none | web site |
27
+
28
+ **How the app binds hosts (v5.9.5):** one axios-style client with `baseURL` **`https://brite2.com`** (no trailing slash) joined with the leading-slash paths (`/consumer/…`, `/tms/…`, `/api/subscribers/…`); a second with `baseURL` **`https://tank-monitor.brite2.com/`** (trailing slash) joined with the *relative* catalog paths `constants/ams` / `constant/multipliers`. Both combinations verified live. The 5.1.5 client below used `https://support.paygo.net`, which still serves every endpoint today.
29
+
30
+ **HTTP client defaults used by the app** (module 1087 in v5.1.5 — shared axios instance; v5.9.5 equivalent uses `https://brite2.com`):
31
+
32
+ ```js
33
+ axios.create({
34
+ baseURL: "https://support.paygo.net", // v5.9.5: "https://brite2.com"
35
+ headers: { Accept: "application/json", "Content-Type": "application/json" },
36
+ timeout: 20000
37
+ })
38
+ // response interceptor rejects with { message, data, status }
39
+ ```
40
+
41
+ Because v5.1.5 hard-depends on the now-dead constants host at login (see §3), **stock v5.1.5 can no longer complete its login sequence**; the consumer endpoints themselves remain live (on both hosts), and v5.9.5 fixed the dependency by moving the catalogs to `tank-monitor.brite2.com`.
42
+
43
+ ---
44
+
45
+ ## 2. Authentication model
46
+
47
+ 1. **Sign in** with username + password → server returns a bearer-ish token plus the subscriber's identity (module 1510):
48
+
49
+ ```
50
+ POST /consumer/signIn
51
+ { "username": "…", "password": "…" }
52
+ →
53
+ {
54
+ "token": "<JWT-like opaque string>", // exact format unverified
55
+ "user": {
56
+ "subscriberId": 12345,
57
+ "dealerId": 678,
58
+ "username": "…",
59
+ "email": "…@example.com"
60
+ }
61
+ }
62
+ ```
63
+
64
+ Bad credentials → HTTP **401** `{"msg":"Invalid username or password."}` *(verified live)*.
65
+
66
+ 2. **All authenticated requests** send the token in a custom header:
67
+
68
+ ```
69
+ x-access-token: <token>
70
+ ```
71
+
72
+ No refresh mechanism was found in the app; the token is cached on-device in AsyncStorage under keys **`access`** and **`subscriberId`** (module 1264) and re-read at app start.
73
+
74
+ 3. **Unauthenticated endpoints:** `/tms/config`, `/consumer/signIn`, `/consumer/register`, `/consumer/usernameAvailable/{u}`, `/consumer/recoverUsername`, `/consumer/changePassword`, the two constants services.
75
+
76
+ ---
77
+
78
+ ## 3. Login sequence (module 1510, `startLogin`)
79
+
80
+ The app performs this on the Login screen, with **up to 5 attempts** (retry counter starts at 5 and decrements per attempt or exception):
81
+
82
+ ```
83
+ 1. GET /tms/config
84
+ → { "monitorAPI": { "url": "http://monitors.angusenergy.net/", "port": 344 } }
85
+ (stored as Config.monitorEndpoint; sent to the physical monitor later,
86
+ fallback defaults "http://monitors.paygo.net/" / 344 — module 1190)
87
+
88
+ 2. GET http://monitor.service.aa-api.com/constants/ams (see §8.1)
89
+ → monitorTypes + containerGeometrys catalog
90
+
91
+ 3. POST /consumer/signIn {username, password}
92
+ → token + user{subscriberId, dealerId, username, email}
93
+ ```
94
+
95
+ The app treats login as **successful only if** all of the following are truthy:
96
+ `token`, `user.subscriberId`, `user.dealerId`, `monitorAPI.url`, `monitorAPI.port`,
97
+ and both `MonitorType` and `ContainerGeometry` catalogs parse to non-empty arrays.
98
+ Since the constants host is now dead, this gate can never pass for stock v5.1.5 — a client written today should simply call `/consumer/signIn` directly.
99
+
100
+ On error the app surfaces `response.data.msg` (module 1509).
101
+
102
+ ---
103
+
104
+ ## 4. Tank status endpoints — **the core of the API**
105
+
106
+ All three are on `https://support.paygo.net`, require `x-access-token`, and are invoked together by the dashboard (module 1264 → service module 1488).
107
+
108
+ ### 4.1 `GET /consumer/api` — customer & tank list
109
+
110
+ Auth: `x-access-token`.
111
+
112
+ Response *(shape verified against the live server, Nov 2026)*:
113
+
114
+ ```json
115
+ {
116
+ "customerName": "John Smith",
117
+ "accountNum": "A-123456",
118
+ "address": {
119
+ "line1": "123 Main St",
120
+ "city": "Anytown",
121
+ "state": "NY",
122
+ "postalCode": "12345"
123
+ },
124
+ "phoneNumber": "5555551234",
125
+ "tanks": [
126
+ {
127
+ "key": 16618, // JSON NUMBER — opaque tank/container key, used for /levels
128
+ "name": 1, // numeric names are numbers too; app renders "Tank #"+name
129
+ "lastDeliveryDate": "2026-10-12", // "YYYY-MM-DD" or absent
130
+ "nextDeliveryDate": "2026-11-29" // "YYYY-MM-DD" or absent
131
+ }
132
+ ]
133
+ }
134
+ ```
135
+
136
+ > **Note — `key` and numeric `name` are JSON numbers on the wire** (verified live:
137
+ > `"key": 16618`). The app never notices because JS coerces during string
138
+ > interpolation; strictly-typed clients must convert before using the key in the
139
+ > `/levels` path. `accountNum` may likewise arrive as a number rather than a string.
140
+
141
+ ### 4.2 `GET /consumer/api/tanks/{key}/levels` — reading history
142
+
143
+ Auth: `x-access-token`. `{key}` is `tanks[].key` from §4.1.
144
+
145
+ **v5.9.5 addition:** the app now calls this as
146
+ `GET /consumer/api/tanks/{key}/levels?startDate=<YYYY-MM-DD>` (string literal `/levels?startDate=`),
147
+ i.e. bounded to a date window instead of pulling the full history. The v5.1.5 form
148
+ (plain `/levels`) still exists server-side and returns the unbounded history.
149
+
150
+ Response:
151
+
152
+ ```json
153
+ {
154
+ "levels": [
155
+ { "readingDate": "2026-11-21", "percent": 46.2, "volume": 554.4 },
156
+ { "readingDate": "2026-11-20", "percent": 47.0, "volume": 564.0 }
157
+ ]
158
+ }
159
+ ```
160
+
161
+ App post-processing (module 1488):
162
+
163
+ - Sort **descending by `readingDate`** (UTC diff), keep **top 30** entries.
164
+ - The **newest** entry (`levels[0]`) is the current tank status.
165
+ - Current fill percent = `floor(clamp(percent, 0, 100))`.
166
+ - If a tank has no `percent`, the app flags it "no level" and renders 0%.
167
+ - History table shows `readingDate` and `Math.round(volume)` as "Gallons" (module 1491).
168
+
169
+ ### 4.3 `GET /consumer/api/subscribers/{subscriberId}/logo` — dealer branding
170
+
171
+ Auth: `x-access-token`. Body is a **string** (URL of a dealer logo on
172
+ `https://storage.googleapis.com/aa-platform-branding/logos/…`). The app swaps a
173
+ test-site logo for a fallback image and uses `…/logos/blank.png` on any error.
174
+
175
+ ### 4.4 `GET /consumer/api/subscribers/{subscriberId}/tmsContacts?dealerId={dealerId}` — dealer contacts
176
+
177
+ Auth: `x-access-token`. Response is passed through to the UI as the dealer-info
178
+ object (name/phone/email — exact fields not referenced in the bundle).
179
+
180
+ ### 4.5 Tank status — resulting data model (as the dashboard uses it)
181
+
182
+ ```
183
+ customer : { name, account, address{line1, city, state, postalCode}, phone }
184
+ tank : { key, name, percent (0-100 int), volume (gal, latest), levels[≤30],
185
+ lastDeliveryDate, nextDeliveryDate }
186
+ ```
187
+
188
+ ---
189
+
190
+ ## 5. Account management endpoints
191
+
192
+ All on `https://support.paygo.net`.
193
+
194
+ ### 5.1 `GET /consumer/usernameAvailable/{username}` (module 1263)
195
+
196
+ No auth. → `{ "isAvailable": true }`
197
+
198
+ ### 5.2 `POST /consumer/register` (module 1263)
199
+
200
+ No auth.
201
+
202
+ ```json
203
+ {
204
+ "username": "…",
205
+ "email": "…",
206
+ "password": "…",
207
+ "confirmPassword": "…",
208
+ "accountNumber": "…",
209
+ "phoneNumber": "…",
210
+ "serialNumber": "…" // printed on the back of the monitor / scanned barcode
211
+ }
212
+ ```
213
+
214
+ → `{ "isLocked": false, "msg": … }` — `isLocked:true` means registration rejected
215
+ ("Please check your information."); on success the app surfaces the serial as the message.
216
+
217
+ **Password policy enforced client-side** (module 1508): no spaces, ≥1 uppercase, ≥1 lowercase, ≥1 digit, ≥1 special char, **8–15 characters**.
218
+
219
+ ### 5.3 `POST /consumer/recoverUsername` (module 1505)
220
+
221
+ No auth.
222
+
223
+ ```json
224
+ { "email": "…", "serialNumber": "…" }
225
+ ```
226
+
227
+ → on success `{ "success": true, "msg": [ { "username": "…", "createdOn": 1668000000000 }, … ] }`
228
+ (`createdOn` is an epoch-ms timestamp); on failure `msg` is a string.
229
+
230
+ ### 5.4 Forgot/changed password flows (modules 1504, 1506, 1507, 1508)
231
+
232
+ Two distinct endpoints, both carrying a **hard-coded app constant**
233
+ `code: "5f668b7e-8901-4638-afbd-10379facf6f3"` (appears to be a fixed API/tenant key):
234
+
235
+ **a) `POST /consumer/changePassword`** — set new password (after verifying an emailed code, or when simply logged in and changing it; only `username` is required):
236
+
237
+ ```json
238
+ {
239
+ "username": "…",
240
+ "newPassword": "…",
241
+ "confirmNewPassword": "…",
242
+ "code": "5f668b7e-8901-4638-afbd-10379facf6f3"
243
+ }
244
+ ```
245
+
246
+ → success when `data.error` is null/absent; otherwise `data.error` holds the reason.
247
+
248
+ **b) `POST /consumer/changePasswordConsumer`** — change with knowledge of the old password; **requires `x-access-token`**:
249
+
250
+ ```json
251
+ {
252
+ "oldPassword": "…",
253
+ "newPassword": "…",
254
+ "reenterPassword": "…",
255
+ "code": "5f668b7e-8901-4638-afbd-10379facf6f3"
256
+ }
257
+ ```
258
+
259
+ **Email verification codes** are issued/consumed by `POST /consumer/recoverUsername/sendcode` and `POST /consumer/recoverUsername/checkcode` on the main API host (v5.1.5 used the now-dead alert service for this — §8.3), then the new password is set with the call above.
260
+
261
+ ### 5.5 `POST /consumer/delete` (module 1192)
262
+
263
+ Auth: `x-access-token`. Body: `{ "username": "…" }`
264
+ → `{ "result": { "deleted": true, "error": … } }`
265
+
266
+ ---
267
+
268
+ ## 6. Monitor provisioning endpoints
269
+
270
+ On `https://support.paygo.net`, auth: `x-access-token`.
271
+
272
+ ### 6.1 `POST /tms/validate` (module 1086)
273
+
274
+ ```json
275
+ { "serial": "00012345", "monitorType": 1 }
276
+ ```
277
+
278
+ `monitorType` is a `MonitorTypeKey` from the constants catalog (§8.1). App uses a 4.5 s timeout and **polls every 5 s, up to ~10 times**, until the response contains `canContinue: true`:
279
+
280
+ ```json
281
+ { "canContinue": true }
282
+ ```
283
+
284
+ **Verified live response shape (Nov 2026, v5.9.5 server)** — richer than the v5.1.5
285
+ app consumed, with retry semantics (all field names present in the v5.9.5 string table):
286
+
287
+ ```json
288
+ {
289
+ "continueMessage": "There was an error, please try again",
290
+ "retryMessage": "",
291
+ "canRetry": false,
292
+ "canContinue": false,
293
+ "isCheck": "03"
294
+ }
295
+ ```
296
+
297
+ Requires `x-access-token` (the app sends it even though the serial check is pre-provisioning).
298
+
299
+ ### 6.2 Map monitor serial → tank (module 1183)
300
+
301
+ ```
302
+ POST /api/subscribers/{subscriberId}/containers/{tankKey}/monitors
303
+ { "serialNumber": "00012345", "type": "TMS" }
304
+ ```
305
+
306
+ Note the different root (`/api/…`, not `/consumer/api/…`). `tankKey` is the `tanks[].key` from §4.1.
307
+
308
+ ### 6.3 Install geometry (module 1183)
309
+
310
+ ```
311
+ PUT /api/subscribers/{subscriberId}/containers/{tankKey}/monitors
312
+ {
313
+ "locationId": 1, // 1, or 2 when monitorType ∉ {1, 6}
314
+ "monitorAntennaTypeId": 1, // same rule as locationId
315
+ "shapeId": 4, // ContainerShapeKey
316
+ "height": 60,
317
+ "width": 72,
318
+ "length": 150,
319
+ "sensorOffset": 0, // "Offset" (non-propane only)
320
+ "outletHeight": 6, // "Outlet"
321
+ "safeCapacity": 275, // SafeCapacity / tank gallons
322
+ "type": 2, // MonitorTypeKey
323
+ "multiplier": 1, // tank count multiplier (dual tanks ⇒ 2)
324
+ "containerGeometryKey": 123 // numeric, coerced with unary +
325
+ }
326
+ ```
327
+
328
+ The app computes dimensions via the multipliers catalog (§8.2): it looks up the
329
+ `ContainerGeometryKey` with the chosen `ContainerGeometryMultiplier` and uses the
330
+ returned `Width`/`Height`/`Length` when present, falling back to user input.
331
+
332
+ ---
333
+
334
+ ## 7. Local device provisioning (monitor's own WiFi AP)
335
+
336
+ When a GREMLIN monitor is in setup mode it hosts an AP; the phone joins it and
337
+ talks to **`http://192.168.4.1`** (module 1190). All requests are plain HTTP with
338
+ generous timeouts (GET 30 s, POST 5 s).
339
+
340
+ ### 7.1 `GET http://192.168.4.1/`
341
+
342
+ Returns **HTML**. The app scrapes it:
343
+
344
+ - Serial: text after `<td class="style23" align="left">…</td>`, leading zeros stripped.
345
+ - Nearby SSIDs: every `<option value="…">` (two alternative parses, entries
346
+ `choose_from_list` / `manually_entered` excluded).
347
+
348
+ ### 7.2 `POST http://192.168.4.1/data?command=send` — set the cloud upload endpoint
349
+
350
+ Body is a **plain string**, not JSON:
351
+
352
+ ```
353
+ TEKSettings={'SURL':'http://monitors.angusenergy.net/','SPORT':'344'}
354
+ ```
355
+
356
+ `SURL`/`SPORT` come from `GET /tms/config` (§3); hardcoded fallback is
357
+ `http://monitors.paygo.net/` / `344`. This tells the monitor where to POST its readings.
358
+
359
+ ### 7.3 `POST http://192.168.4.1/config?command=wifi` — set home WiFi
360
+
361
+ Body is JSON: `{"ssid": "HomeNetwork", "password": "wifipassphrase"}`
362
+
363
+ The full happy-path install is therefore:
364
+
365
+ ```
366
+ scan/enter serial → POST /tms/validate (poll until canContinue)
367
+ → join monitor AP → scrape GET 192.168.4.1 (serial + SSIDs)
368
+ → POST /data?command=send (SURL/SPORT)
369
+ → POST /config?command=wifi (home SSID/password)
370
+ → POST /api/subscribers/{sub}/containers/{tankKey}/monitors (serial)
371
+ → PUT /api/subscribers/{sub}/containers/{tankKey}/monitors (geometry)
372
+ ```
373
+
374
+ ---
375
+
376
+ ## 8. Constants / catalog services
377
+
378
+ ### 8.1 `GET https://tank-monitor.brite2.com/constants/ams` (v5.9.5; verified live)
379
+
380
+ > v5.1.5 called this at `http://monitor.service.aa-api.com/constants/ams` — that host is dead; v5.9.5 moved it to `https://tank-monitor.brite2.com/` (joined with the relative path `constants/ams`).
381
+
382
+ ```json
383
+ { "result": [ { "MonitorType": "<JSON-encoded array (string)>",
384
+ "ContainerGeometry": "<JSON-encoded array (string)>" } ] }
385
+ ```
386
+
387
+ Both strings parse to arrays. **Verified live catalog (Nov 2026): 4 monitor types, 31 geometries.**
388
+
389
+ **MonitorType[]** (new catalog — includes the WiFi monitor generation):
390
+
391
+ ```json
392
+ [
393
+ {"MonitorTypeKey":1, "MonitorTypeName":"Heating Oil - WiFi", "MonitorTypeDescription":"750", "MonitorTypeCalculation":1, "MonitorTypeImageURL":"https://storage.googleapis.com/aa-platform-assets/image/750Barcode.jpg"},
394
+ {"MonitorTypeKey":5, "MonitorTypeName":"Propane - Cellular", "MonitorTypeDescription":"822", …},
395
+ {"MonitorTypeKey":6, "MonitorTypeName":"Heating Oil - Cellular", "MonitorTypeDescription":"811", …},
396
+ {"MonitorTypeKey":7, "MonitorTypeName":"Non Heating Liquid - Cellular","MonitorTypeDescription":"871", …}
397
+ ]
398
+ ```
399
+
400
+ **ContainerGeometry[]** — tank presets, now also carrying `ContainerContentTypeName` and `MonitorTypeCalculation`; same dimension fields as before (`ContainerGeometryKey`, `ContainerGeometrySequence`, `ContainerContentTypeKey`, `ContainerShapeKey`, `ContainerShapeName`, `Title`, `ContainerImageURL`, `Preset`, `Multiplier`, `Height`, `Width`, `Length`, `Diameter`, `SensorOffset`, `OutletHeight`, `SafeCapacity`).
401
+
402
+ Shape helpers in the app (module 1183) describe which dimensions each shape needs:
403
+
404
+ | `ContainerShapeKey` | Needs height+width | Needs diameter | Width ⇒ height |
405
+ |---|---|---|---|
406
+ | 1, 2, 3, 4 (rectangular family) | ✔ | ✖ | ✖ |
407
+ | 5 | ✖ | ✔ | ✖ |
408
+ | 6, 7 (cylindrical vertical 200/2500) | ✖ | ✔ | ✔ |
409
+
410
+ ### 8.2 `GET https://tank-monitor.brite2.com/constant/multipliers` (v5.9.5; verified live)
411
+
412
+ Same envelope: `{ "result": [ { "ContainerGeometry": "<JSON array string>" } ] }`,
413
+ entries keyed by `ContainerGeometryKey` + `ContainerGeometryMultiplier` (now with an
414
+ explicit `ContainerGeometryMultiplierKey`) with `Width`, `Height`, `Length`.
415
+ Verified live: 24 entries.
416
+
417
+ ### 8.3 Push-notification & verification codes
418
+
419
+ **v5.1.5 (dead):** these lived on `https://alert.service.aa-api.com/` (`Config.alertUrl`) — `check`, `notify`, `sendcode`, `checkcode`, all token-authenticated. That host no longer resolves.
420
+
421
+ **v5.9.5 (replacement endpoints on the main API host):**
422
+
423
+ | Endpoint | Body | Notes |
424
+ |---|---|---|
425
+ | `POST /consumer/api/notification/notify` | `{username, tokens, notify}` | push-notification preference; `tokens` = Expo push-token string |
426
+ | `POST /consumer/recoverUsername/sendcode` | `{username, createdOn}` | emailed verification code for forgot-password |
427
+ | `POST /consumer/recoverUsername/checkcode` | `{email, code, createdOn}` | consumes the code before `/consumer/changePassword` |
428
+
429
+ All authenticated with `x-access-token` where the app is logged in. The old
430
+ `alertUrl + "check"` (read preference) has no identifiable counterpart string in the
431
+ 5.9.5 bundle — the preference is most likely read from another response (e.g.
432
+ `/consumer/api`) or kept locally; the app still prompts "Receive push notifications?".
433
+
434
+ **Password-verification codes:** issued/consumed via `sendcode`/`checkcode` (above), then the new password is set via `POST /consumer/changePassword` with the tenant code (§5.4).
435
+
436
+ ---
437
+
438
+ ## 9. Error handling & quirks
439
+
440
+ - **Error envelope:** errors are surfaced as `response.data.msg` (string) — e.g. `{"msg":"Invalid username or password."}` on 401 from `/consumer/signIn` (verified) and `{"msg":"You are not authorized to access this content."}` on 401 from `/consumer/api` (verified).
441
+ - **Retries:** login ×5 (module 1510); `/tms/validate` polled ~10× at 5 s intervals (module 1085/1086).
442
+ - **Levels pagination:** the app keeps only the newest 30 readings per tank, newest first; v5.9.5 additionally bounds the query with `?startDate=`.
443
+ - **Percent sanitization:** `floor(clamp(p, 0, 100))`; tanks without a `percent` read as 0%/"no level".
444
+ - **Mixed URL styles:** some calls use `http://` (constants/ams on aa-api.com in v5.1.5, device AP, monitor ingest) while the consumer API is `https://` — the app never pins certificates (only Expo's update channel uses `expo-root.pem`); `android:usesCleartextTraffic` is set for the device-AP flow.
445
+ - **Hardcoded values in the app:** tenant code GUID `5f668b7e-8901-4638-afbd-10379facf6f3` (both versions); fallback ingest `http://monitors.paygo.net/` port `344` in v5.1.5 → `http://monitors.angusenergy.net` in v5.9.5; fallback logo `…/logos/blank.png`.
446
+ - **Persistent storage:** AsyncStorage keys `access` (token) and `subscriberId` (both versions).
447
+
448
+ ---
449
+
450
+ ## 10. Minimal "query my tank" recipe
451
+
452
+ ```
453
+ 1. POST https://brite2.com/consumer/signIn # legacy host also live:
454
+ {"username": U, "password": P} # https://support.paygo.net/...
455
+ headers: Content-Type: application/json
456
+ → token, user.subscriberId, user.dealerId
457
+
458
+ 2. GET https://brite2.com/consumer/api
459
+ headers: x-access-token: <token>
460
+ → customerName/address/phone + tanks[].key, name, delivery dates
461
+
462
+ 3. For each tank:
463
+ GET https://brite2.com/consumer/api/tanks/<key>/levels # v5.9.5 app adds ?startDate=YYYY-MM-DD
464
+ headers: x-access-token: <token>
465
+ → levels[]; levels[0] = current status (percent, volume, readingDate)
466
+ → sort by readingDate desc for history (cap 30 to mirror the app)
467
+ ```
468
+
469
+ A complete, runnable implementation of this recipe is provided in two forms:
470
+ the **`gauger` package + `gauger` CLI** (httpx/pydantic/typer — `uv run gauger status …`),
471
+ and **`reference/gremlin_client.py`** (stdlib-only, runs anywhere with no dependencies).
472
+
473
+ ---
474
+
475
+ ## 11. Delta: v5.1.5 → v5.9.5
476
+
477
+ v5.9.5 (XAPK `Gremlin+Tank+Monitoring_5.9.5_APKPure.xapk`, Expo SDK 51, **Hermes bytecode** instead of plain-JS Metro) was diffed string-table vs string-table against v5.1.5. **The tank-status contract is unchanged** — same paths, same `x-access-token` auth, same request/response models, same tenant GUID, same device-provisioning flow. What changed is *where* things live:
478
+
479
+ | Area | v5.1.5 | v5.9.5 |
480
+ |---|---|---|
481
+ | Consumer API base | `https://support.paygo.net` | **`https://brite2.com`** (old host still live in parallel) |
482
+ | Constants + multipliers | `monitor.service.aa-api.com` (dead) | **`https://tank-monitor.brite2.com/`** — same response envelope, catalog refreshed (4 monitor types incl. "Heating Oil - WiFi"; 31 geometries; multipliers now keyed by `ContainerGeometryMultiplierKey`) |
483
+ | Levels query | `/consumer/api/tanks/{k}/levels` | same, **plus `?startDate=<date>`** |
484
+ | Push pref write | `{alertUrl}notify` (alert service, dead) | **`POST /consumer/api/notification/notify`** (main API) |
485
+ | Verification codes | `{alertUrl}sendcode` / `checkcode` (dead) | **`POST /consumer/recoverUsername/sendcode` / `checkcode`** (main API) |
486
+ | Alert service host | `https://alert.service.aa-api.com/` (`Config.alertUrl`) | removed entirely |
487
+ | `/tms/validate` response | `{canContinue}` (inferred) | richer, **verified live**: `{continueMessage, retryMessage, canRetry, canContinue, isCheck}` |
488
+ | Device ingest fallback | `http://monitors.paygo.net/` : 344 | **`http://monitors.angusenergy.net`** (matches live `/tms/config`) |
489
+ | Manifest/permissions | Expo 46 | Expo 51; adds `ACCESS_NETWORK_STATE`, Android-13 `POST_NOTIFICATIONS`; `usesCleartextTraffic` retained (device AP + http ingest) |
490
+
491
+ Unchanged between versions (verified by exact string-table match): all `/consumer/*`
492
+ paths, `/tms/config`, `/tms/validate` path, `/api/subscribers/{sub}/containers/{tankKey}/monitors`
493
+ POST+PUT, `/logo`, `/tmsContacts?dealerId=`, `x-access-token`, tenant GUID
494
+ `5f668b7e-8901-4638-afbd-10379facf6f3`, AsyncStorage keys `access`/`subscriberId`,
495
+ every tank/customer/level field name (`customerName`, `accountNum`, `tanks[].key/name/lastDeliveryDate/nextDeliveryDate`,
496
+ `levels[].readingDate/percent/volume`), and the local device flow (`192.168.4.1`,
497
+ `TEKSettings={'SURL':…,'SPORT':…}`, `/config?command=wifi` `{ssid,password}`).
498
+
499
+ > **Bottom line for API consumers:** a client written against v5.1.5's
500
+ > `https://support.paygo.net` still works today; new integrations should target
501
+ > `https://brite2.com`, and the constants catalogs are usable again at
502
+ > `https://tank-monitor.brite2.com`.
503
+
504
+ ---
505
+
506
+ ## Appendix A — Evidence index (module IDs in v5.1.5 `assets/index.android.bundle`)
507
+
508
+ > v5.9.5 ships Hermes bytecode (HBC v96), which has no readable modules; its evidence is
509
+ > the parsed string table (27,637 strings), extracted with **`hermes_strings.py`** in this
510
+ > folder (HBC v74–v96 string-table parser per `BytecodeFileFormat.h`: 128-byte header,
511
+ > 16-byte `SmallFuncHeader`, string entries `isUTF16:1 | offset:23 | length:8`; accepts a
512
+ > raw bundle, `.apk`, or `.xapk`).
513
+ > The v5.9.5 app-service string cluster (indices 2014–2039) contains every path listed
514
+ > in this document adjacent to `https://tank-monitor.brite2.com/`, plus `https://brite2.com`
515
+ > as the consumer base.
516
+
517
+ | Module ID | Contents |
518
+ |---|---|
519
+ | 1085 / 1086 | `monitorActivateCheck` — `POST /tms/validate` polling |
520
+ | 1087 | axios instance (`baseURL https://support.paygo.net`, timeouts, interceptor) |
521
+ | 1118 | `Config` singleton (token, monitorEndpoint, alertUrl, serialNumber) |
522
+ | 1169 | constants/ams usage on the serial-entry screen |
523
+ | 1183 | `mapAndGeometry` — monitor POST/PUT provisioning |
524
+ | 1190 | device AP scraping + `TEKSettings` + wifi config |
525
+ | 1192 | account screen — `alertUrl check/notify`, `/consumer/delete` |
526
+ | 1263 | `startRegister` — usernameAvailable + register |
527
+ | 1488 | `getLogo` / `getConsumerTankData` / `getConsumerDealerData` |
528
+ | 1491 | levels history table (readingDate, volume) |
529
+ | 1504 / 1506 | `sendcode` / `checkcode` |
530
+ | 1505 | `recoverUsername` |
531
+ | 1507 / 1508 | `changePasswordConsumer` / `changePassword` |
532
+ | 1509 / 1510 | login screen / `startLogin` (5-retry sequence) |