Skip to content

Commit 9ace57d

Browse files
committed
chore: Update readme
1 parent 9542e94 commit 9ace57d

File tree

1 file changed

+52
-6
lines changed

1 file changed

+52
-6
lines changed

README.md

Lines changed: 52 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010
_Integration to integrate with [monta][monta]._
1111

12-
**This integration will set up the following platforms.**
12+
**This integration sets up the following:**
1313

14-
Platform | Description
14+
Platform | Entities
1515
-- | --
16-
`binary_sensor` | Show something `True` or `False`.
17-
`sensor` | Show info from Monta API.
18-
`switch` | Switch something `True` or `False`.
19-
`services` | `start_charging` and `stop_charging``
16+
`binary_sensor` | Cable Plugged In
17+
`sensor` | Charge point Visibility, Type, State, Last meter reading (kWh), Last Charge (with attributes), Personal Wallet amount, Latest Wallet Transactions
18+
`switch` | Charger Start/Stop
19+
`services` | `start_charging` and `stop_charging`
2020

2121
## Installation
2222

@@ -59,6 +59,52 @@ Client id and secret are obtained from https://portal2.monta.app/applications.
5959

6060
<!---->
6161

62+
## Rate limiting and update cadence
63+
- The integration respects Monta Public API rate limits and HTTP 429 responses.
64+
- On 429, it reads `context.rateLimitResponse.resetsIn` from the response JSON body and backs off accordingly. It does not rely on `Retry-After` or other rate-limit headers.
65+
- To reduce bursts:
66+
- Charge points are fetched at setup and cached, then refreshed infrequently (default every 60 minutes).
67+
- Wallet and transactions refresh every 5 minutes by default.
68+
- Charges (latency-sensitive) refresh every 30 seconds, staggered across multiple charge points to stay well under quota.
69+
- When backing off due to a 429, you will see an INFO log and the coordinator temporarily increases its update interval (capped at 5 minutes) and then recovers automatically.
70+
71+
## Entities and services
72+
73+
- Charge point sensors
74+
- Visibility: `public` or `private`
75+
- Type: `ac` or `dc`
76+
- State: charger state (enum)
77+
- Last meter reading: cumulative energy (kWh)
78+
- Last Charge: exposes latest charge state; attributes include timestamps like `startedAt`, `stoppedAt`, etc.
79+
- Wallet sensors
80+
- Personal Wallet amount (with `credit` attribute when available)
81+
- Latest Wallet Transactions: attributes include a parsed list of recent transactions
82+
- Binary sensors
83+
- Cable Plugged In
84+
- Switches
85+
- Start/Stop charging
86+
- Services
87+
- `monta.start_charging` and `monta.stop_charging`
88+
- Both accept a `charge_point_id` (select your charger device in the UI Service call dialog to populate it)
89+
90+
## Development
91+
92+
- Quick test: `scripts/develop` launches HA with this integration and local `config/`.
93+
- Setup tooling: `scripts/setup` installs Python deps (HA, Ruff, etc.).
94+
- Lint: `scripts/lint` runs Ruff checks and autofixes style.
95+
- In HA UI, add the Monta integration and supply Client ID/Secret.
96+
- Validate that entities appear and update; watch logs for any rate-limit backoff messages.
97+
98+
## Troubleshooting
99+
100+
- 429 Too Many Requests
101+
- The integration automatically backs off based on Monta’s `resetsIn` hint and resumes normal cadence afterward.
102+
- You may see: `Rate limited by API. Backing off update interval to …` in logs.
103+
- Authentication
104+
- If credentials are invalid or tokens expire, HA will surface a config entry auth error; reconfigure the integration.
105+
- Privacy
106+
- Access/refresh tokens are stored using HA’s Storage (`.storage/`) and sensitive fields are redacted from logs.
107+
62108
## Contributions are welcome!
63109

64110
If you want to contribute to this please read the [Contribution guidelines](CONTRIBUTING.md)

0 commit comments

Comments
 (0)