Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ Feature development of the v1 API has been stopped. No new features will be adde

#### 2.0.0 - 21-01-2025

- Initial release of the v2 API.
- Initial release of the v2 API.

#### 2.0.1 - 30-01-2025

- An issue has been resolved where `energy_import_kwh` and `energy_export_kwh` values in the Plug-In Battery [Measurement API](/docs/v2/measurement#plug-in-battery-hwe-bat) were returning invalid values. The values are now the same as those in the HomeWizard Energy app.
- An issue has been resolved where `energy_import_kwh` and `energy_export_kwh` values in the Plug-In Battery [Measurement API](/docs/v2/measurement#plug-in-battery-hwe-bat) were returning invalid values. The values are now the same as those in the HomeWizard Energy app.

#### 2.1.0 - 01-05-2025

- Support has been added to the P1 Meter to control the Plug-In Battery group mode. See [Plug-In Battery API](/docs/v2/batteries) for more information.
- Support has been added to the P1 Meter to control the Plug-In Battery group mode. See [Plug-In Battery API](/docs/v2/batteries) for more information.

#### 2.2.0 - 01-12-2025 (in beta)

- You can now set charge and discharge permissions for the Plug-In Battery group via the `permissions` field in the [Plug-In Battery API](/docs/v2/batteries). See the documentation for more information.
- A new field has been added to `api/batteries`: `battery_count`, which indicates the number of connected Plug-In Batteries.
- When `target_power_w` field in `api/batteries` is updated, it is now pushed over WebSocket connections as well.
- You can now set charge and discharge permissions for the Plug-In Battery group via the `permissions` field in the [Plug-In Battery API](/docs/v2/batteries). See the documentation for more information.
- A new field has been added to `api/batteries`: `battery_count`, which indicates the number of connected Plug-In Batteries.
- When `target_power_w` field in `api/batteries` is updated, it is now pushed over WebSocket connections as well.

## Subscribe to Updates.

Expand Down
4 changes: 2 additions & 2 deletions docs/discovery.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Energy devices can be automatically discovered on your network using <Link to="h

Devices can broadcast one or two services on the network, depending on the available API version(s) of this device:

- `_hwenergy._tcp` - to discover devices that are using API v1 over HTTP
- `_homewizard._tcp` - to discover devices that are using API v2 and later over HTTPS
- `_hwenergy._tcp` - to discover devices that are using API v1 over HTTP
- `_homewizard._tcp` - to discover devices that are using API v2 and later over HTTPS

## `_hwenergy._tcp`.

Expand Down
6 changes: 3 additions & 3 deletions docs/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ To access the data from an Energy device, you have to enable the API. You can do

After enabling the API, you can try to read some data from your device.

- Find the IP address of your meter. You can find this in your router or do this programmatically with [mDNS](/docs/discovery).
- In your internet browser, open `http://<IP ADDRESS>/api/v1/data`.
- If everything is set up correctly, you should now see some text. This is the most recent measurement formatted as JSON. You can use a tool such as <Link to="http://json.parser.online.fr">JSON Parser Online</Link> to get a structured version of the result.
- Find the IP address of your meter. You can find this in your router or do this programmatically with [mDNS](/docs/discovery).
- In your internet browser, open `http://<IP ADDRESS>/api/v1/data`.
- If everything is set up correctly, you should now see some text. This is the most recent measurement formatted as JSON. You can use a tool such as <Link to="http://json.parser.online.fr">JSON Parser Online</Link> to get a structured version of the result.

To understand each value, please read [endpoints](/docs/category/api-v1/).

Expand Down
14 changes: 7 additions & 7 deletions docs/introduction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,18 @@ The HomeWizard P1 Meter, Energy Socket, kWh Meter, Watermeter, and Plug-In Batte

## Terms and Conditions.

- **License** - The HomeWizard Energy API is licensed, not sold. HomeWizard grants the user a non-exclusive license (with no right to sub-license) to the HomeWizard Energy API for personal, non-commercial use.
- **Usage** - The user may not directly or indirectly use the HomeWizard Energy API to sell, lease, loan or generate a revenue from a product, system or software using the API
- **Support** - The usage of the HomeWizard Energy API is officially supported by HomeWizard, however HomeWizard can not supply customer service regarding the implementation of the API in your own or third party applications.
- **License** - The HomeWizard Energy API is licensed, not sold. HomeWizard grants the user a non-exclusive license (with no right to sub-license) to the HomeWizard Energy API for personal, non-commercial use.
- **Usage** - The user may not directly or indirectly use the HomeWizard Energy API to sell, lease, loan or generate a revenue from a product, system or software using the API
- **Support** - The usage of the HomeWizard Energy API is officially supported by HomeWizard, however HomeWizard can not supply customer service regarding the implementation of the API in your own or third party applications.

## API v2.

The HomeWizard Energy API is moving to v2, which is a more secure and feature-rich version of the API. In v2 of the API, we have added the following features:

- **HTTPS** - Your data is securely transmitted.
- **Always available** - No need to turn on the API in the app.
- **Authorization** - Only the devices you trust can access the API.
- **WebSocket support** - Get real-time push-based updates.
- **HTTPS** - Your data is securely transmitted.
- **Always available** - No need to turn on the API in the app.
- **Authorization** - Only the devices you trust can access the API.
- **WebSocket support** - Get real-time push-based updates.

Read more about the [new version of the API here](/docs/category/api-v2).

Expand Down
4 changes: 2 additions & 2 deletions docs/v1/measurement.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ Content-Type: application/json

Each type of meter is available in two versions. The API and functionality is the same for both types.

- **1-phase**: HWE-KWH1 and SDM230-wifi
- **3-phase**: HWE-KWH3 and SDM630-wifi
- **1-phase**: HWE-KWH1 and SDM230-wifi
- **3-phase**: HWE-KWH3 and SDM630-wifi

### Parameters

Expand Down
10 changes: 5 additions & 5 deletions docs/v1/state.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ The `/api/v1/state` endpoint returns the actual state of the Energy Socket.

This endpoint accepts `GET` and `PUT` requests.

- With `GET` you will receive the actual state
- With `PUT` you can control the state.
- With `GET` you will receive the actual state
- With `PUT` you can control the state.

## Parameters.

Expand Down Expand Up @@ -98,9 +98,9 @@ Content-Type: application/json

You can configure multiple parameters at the same time. In this example.

- Socket is turned off.
- Switch-lock is turned off.
- Brightness is set to 127 (50%).
- Socket is turned off.
- Switch-lock is turned off.
- Brightness is set to 127 (50%).

The order of a combined request does not matter, if `switch-lock` was on, the socket will still turn off.
The complete state has to make sense; It is not possible to set `power_on` to false and `switch_lock` to true. See [error handling](/docs/v1/error-handling) for more details.
Expand Down
4 changes: 2 additions & 2 deletions docs/v1/system.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ You can solve this, for example, by adding clear documentation and/or by showing

This endpoint accepts `GET` and `PUT` requests.

- With `GET` will send the actual system state.
- With `PUT` allows to set the system state.
- With `GET` will send the actual system state.
- With `PUT` allows to set the system state.

## Examples.

Expand Down
6 changes: 3 additions & 3 deletions docs/v1/telegram.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import Badge from '@site/src/components/Badge.js'

The `/api/v1/telegram` endpoint returns the most recent, valid telegram that was given by the P1 Meter.

- The checksum is validated when present, telegrams with an invalid checksum are rejected.
- The telegram is not processed in any other form, and can be used by other systems to process the data.
- If you need parsed data, use the [measurement](/docs/v1/measurement) endpoint.
- The checksum is validated when present, telegrams with an invalid checksum are rejected.
- The telegram is not processed in any other form, and can be used by other systems to process the data.
- If you need parsed data, use the [measurement](/docs/v1/measurement) endpoint.

## Example.

Expand Down
10 changes: 5 additions & 5 deletions docs/v2/authorization.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ Content-Length: 0

The local API is used by HomeWizard to enable direct communication between HomeWizard devices on a local network. To simplify setup for non-technical users, tokens can also be generated via the HomeWizard Energy app or background process using the cloud.

- Cloud-generated users are prefixed with `cloud/`, local users are prefixed with `local/`.
- These tokens are for local device communication only and do not provide access to the cloud nor can be used by the cloud itself.
- All users, including cloud-generated ones can be viewed with the [`GET /api/user`](#list-users) endpoint.
- Users created via the cloud can be revoked at any time, either by the cloud itself or through the [`DELETE /api/user`](#delete-user) endpoint.
- Disabling the cloud prevents the generation of cloud-generated users. For more details, see [cloud communication](/docs/v2/system#cloud-communication).
- Cloud-generated users are prefixed with `cloud/`, local users are prefixed with `local/`.
- These tokens are for local device communication only and do not provide access to the cloud nor can be used by the cloud itself.
- All users, including cloud-generated ones can be viewed with the [`GET /api/user`](#list-users) endpoint.
- Users created via the cloud can be revoked at any time, either by the cloud itself or through the [`DELETE /api/user`](#delete-user) endpoint.
- Disabling the cloud prevents the generation of cloud-generated users. For more details, see [cloud communication](/docs/v2/system#cloud-communication).

## SSL Certificate Validation (HTTPS) {#https}.

Expand Down
16 changes: 8 additions & 8 deletions docs/v2/batteries.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,26 +38,26 @@ The `/api/batteries` endpoint can be used to retrieve information about the cont

The group of connected batteries can be controlled in three different modes:

- `zero` - The Plug-In Battery will try to keep the power consumption/production of your home at zero. This means that the Plug-In Battery will charge or discharge to maintain a net-zero power balance. This is the default mode.
- `to_full` - All connected Plug-In Batteries will be charged to 100%, regardless of the power consumption/production of your home. When all batteries are fully charged, the Plug-In Battery will switch to the **zero** mode.
- `standby` - Batteries will enter standby mode. This means that the Plug-In Battery will neither charge nor discharge. _For new implementations we recommend to use the `permissions` field to disallow both charging and discharging instead of using this mode._
- `zero` - The Plug-In Battery will try to keep the power consumption/production of your home at zero. This means that the Plug-In Battery will charge or discharge to maintain a net-zero power balance. This is the default mode.
- `to_full` - All connected Plug-In Batteries will be charged to 100%, regardless of the power consumption/production of your home. When all batteries are fully charged, the Plug-In Battery will switch to the **zero** mode.
- `standby` - Batteries will enter standby mode. This means that the Plug-In Battery will neither charge nor discharge. _For new implementations we recommend to use the `permissions` field to disallow both charging and discharging instead of using this mode._

## Permissions

The `permissions` field can be used to set specific permissions for charging and discharging the connected Plug-In Batteries. The possible values are:

- `charge_allowed` - Allow the Plug-In Battery to charge.
- `discharge_allowed` - Allow the Plug-In Battery to discharge.
- `charge_allowed` - Allow the Plug-In Battery to charge.
- `discharge_allowed` - Allow the Plug-In Battery to discharge.

Provide these via an array when updating the `permissions` field. For example, to allow both charging and discharging, set `permissions` to `["charge_allowed", "discharge_allowed"]`. To disallow both, set it to an empty array `[]`.

### Backwards compatibility with `standby` mode

Mode `standby` is exactly the same as mode `zero` with both charging and discharging disallowed, therefore the following rules apply for backwards compatibility:

- When switching to `standby` mode, the `permissions` field will be set to an empty array `[]`.
- When adding a permission to the `permissions` field while in `standby` mode, the mode will automatically switch to `zero`.
- `zero` mode with both permissions allowed is the same as the default `zero` mode.
- When switching to `standby` mode, the `permissions` field will be set to an empty array `[]`.
- When adding a permission to the `permissions` field while in `standby` mode, the mode will automatically switch to `zero`.
- `zero` mode with both permissions allowed is the same as the default `zero` mode.

## Examples

Expand Down
6 changes: 3 additions & 3 deletions docs/v2/system.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ The `/api/system` endpoint can be used to get and set some system information, l

The Plug-In Battery has some exceptions compared to the P1 Meter:

- The `api_v1_enabled` parameter is not available for the Plug-In Battery. The battery only supports the v2 API.
- For safety reasons, the `reboot` action is not available for the Plug-In Battery.
- The `cloud_enabled` parameter is read-only and always set to `true`. The Plug-In Battery requires a cloud connection for initial setup, error reporting, and firmware updates. HomeWizard is working on options to enable fully local use of the Plug-In Battery.
- The `api_v1_enabled` parameter is not available for the Plug-In Battery. The battery only supports the v2 API.
- For safety reasons, the `reboot` action is not available for the Plug-In Battery.
- The `cloud_enabled` parameter is read-only and always set to `true`. The Plug-In Battery requires a cloud connection for initial setup, error reporting, and firmware updates. HomeWizard is working on options to enable fully local use of the Plug-In Battery.

:::tip Good to know
The battery is fully controlled locally by the P1 Meter, ensuring fast operation and continued functionality even if the internet connection is lost.
Expand Down
6 changes: 3 additions & 3 deletions docs/v2/telegram.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import Badge from '@site/src/components/Badge.js'

The `/api/telegram` endpoint returns the most recent, valid telegram that was given by the P1 Meter.

- The checksum is validated when present, telegrams with an invalid checksum are rejected.
- The telegram is not processed in any other form, and can be used by other systems to process the data.
- If you need parsed data, use the [measurement](/docs/v2/measurement) endpoint.
- The checksum is validated when present, telegrams with an invalid checksum are rejected.
- The telegram is not processed in any other form, and can be used by other systems to process the data.
- If you need parsed data, use the [measurement](/docs/v2/measurement) endpoint.

## Example.

Expand Down
12 changes: 6 additions & 6 deletions docs/v2/websocket.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ The WebSocket is accessible at `wss://<IP ADDRESS>/api/ws`. The connection is se

After authentication, you can subscribe to topics. Topics correspond to available endpoints, with the data matching that returned by the endpoint. Once subscribed, the device sends the latest values and updates when data changes. The `type` field consist of the topic name, and the `data` field contains the data from the endpoint.

- **`*`** - Subscribe to all topics
- **`device`** - Subscribe to [device information](/docs/v2/device_information) updates
- **`user`** - Subscribe to [user list](/docs/v2/authorization#list-users) updates
- **`measurement`** - Subscribe to [measurement](/docs/v2/measurement) updates
- **`system`** - Subscribe to [system](/docs/v2/system) updates. Only `cloud_enabled` and `status_led_brightness_pct` are updated in real time.
- **`batteries`** - Subscribe to [battery group](/docs/v2/batteries) updates. Only `mode`, `permissions` and `target_power_w` are updated in real time.
- **`*`** - Subscribe to all topics
- **`device`** - Subscribe to [device information](/docs/v2/device_information) updates
- **`user`** - Subscribe to [user list](/docs/v2/authorization#list-users) updates
- **`measurement`** - Subscribe to [measurement](/docs/v2/measurement) updates
- **`system`** - Subscribe to [system](/docs/v2/system) updates. Only `cloud_enabled` and `status_led_brightness_pct` are updated in real time.
- **`batteries`** - Subscribe to [battery group](/docs/v2/batteries) updates. Only `mode`, `permissions` and `target_power_w` are updated in real time.

```json title="Example"
{"type": "subscribe", "data": "system"}
Expand Down
16 changes: 8 additions & 8 deletions docs/versioning.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import Link from '@docusaurus/Link'

The HomeWizard Energy API follows [semantic versioning](https://semver.org/), with the version number structured as `MAJOR.MINOR.PATCH`. The v1 API only uses the `MAJOR` version, while the v2 API uses both `MAJOR` and `MINOR`.

- `MAJOR` version updates signal incompatible changes in the API.
- `MINOR` version updates add backward-compatible features or enhancements.
- `PATCH` version updates provide backward-compatible bug fixes.
- `MAJOR` version updates signal incompatible changes in the API.
- `MINOR` version updates add backward-compatible features or enhancements.
- `PATCH` version updates provide backward-compatible bug fixes.

### Backward Compatibility

Expand Down Expand Up @@ -106,14 +106,14 @@ X-Api-Version: 3.0.1

Firmware versions for HomeWizard products follow one of these formats: `x.yy` or `x.yyzz`.

- `x` is the **major** version
- `y` is the **minor** version
- `z` is the **patch** version (optional)
- `x` is the **major** version
- `y` is the **minor** version
- `z` is the **patch** version (optional)

For example:

- `1.23` → major version 1, minor version 23
- `2.1501` → major version 2, minor version 15, patch version 01
- `1.23` → major version 1, minor version 23
- `2.1501` → major version 2, minor version 15, patch version 01

### Release Notes

Expand Down
Loading