Skip to content

Commit cc95a71

Browse files
committed
Move energy api to docusaurus
0 parents  commit cc95a71

28 files changed

+16226
-0
lines changed

.gitignore

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docs/changelog.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# API Changelog
2+
3+
## 2023-01-24
4+
**SDM230-wifi** and **SDM630-wifi** now support `api/v1/system`.The Energy meter should run version 3.00 or later, the device will be updated automatically.
5+
6+
See [Identify](/docs/endpoints/api-v1-identify.md) for more information.
7+
8+
## 2023-01-03
9+
**HWE-P1** has now support for `api/v1/system` and `api/v1/identify`.The P1 meter should run version 4.00 or later, the device will be updated automatically.
10+
11+
See [System](/docs/endpoints/api-v1-system.md) and [Identify](/docs/endpoints/api-v1-identify.md) for more information.
12+
13+
## 2023-01-03
14+
Added documentation about updated `api/v1/data` endpoint. This adds support for more data points in **HWE-P1**
15+
16+
See [Recent measurement](/docs/endpoints/api-v1-data.md)` for more information.
17+
18+
## 2022-11-25
19+
Added documentation about the `api/v1/system` endpoint.
20+
21+
See [System](/docs/endpoints/api-v1-system.md) for more information.
22+
23+
## 2022-11-25
24+
Added documentation about the `api/v1/identify` endpoint.
25+
26+
[Identify](/docs/endpoints/api-v1-identify.md) for more information.
27+
28+
## 2022-10-19
29+
Data points in ``api/v1/data`` are now optional. This means that the fields in [Recent measurement](/docs/endpoints/api-v1-data.md)` won't be send if the data does not exists at all.
30+
This is -for example- possible in the P1 meter; Missing data in the telegram is not send in the API. This allows us to send new additional data more easily.
31+
32+
See [Recent measurement](/docs/endpoints/api-v1-data.md)` for more information.

docs/discovery.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# Discovery
6+
The energy devices can be automatically discovered on your network, the method used for this is [Multicast DNS](https://www.ionos.com/digitalguide/server/know-how/multicast-dns/) (`mDNS`, or sometimes called `Zeroconf` or `Bonjour`). Your application can use this technology to discover the device(s) without the user having to enter the IP address.
7+
8+
## Example scan
9+
The device can be found on the `_hwenergy._tcp` domain.
10+
```
11+
$ dns-sd -B _hwenergy._tcp .
12+
Browsing for _hwenergy._tcp
13+
DATE: ---Wed 13 Oct 2021---
14+
14:51:03.565 ...STARTING...
15+
Timestamp A/R Flags if Domain Service Type Instance Name
16+
14:51:03.566 Add 3 7 local. _hwenergy._tcp. energysocket-AABBCC
17+
14:51:03.566 Add 3 7 local. _hwenergy._tcp. energysocket-DDEEFF
18+
14:51:03.566 Add 3 7 local. _hwenergy._tcp. energysocket-001122
19+
14:51:03.566 Add 3 7 local. _hwenergy._tcp. p1meter-334455
20+
14:51:03.566 Add 3 7 local. _hwenergy._tcp. energymeter-667788
21+
14:51:03.566 Add 3 7 local. _hwenergy._tcp. watermeter-ABCDEF
22+
```
23+
24+
The hostname is formatted as ``<product-name>-<last 6 characters of serial>``, so devices with serial ``AABBCCDDEEFF`` the hostname is as following:
25+
26+
| Device | Example hostname |
27+
|-------------------------|------------------|
28+
| P1 meter | p1meter-DDEEFF |
29+
| Energy Socket | energysocket-DDEEFF |
30+
| Watermeter | watermeter-DDEEFF |
31+
| kWh meter (single phase)| kwhmeter-DDEEFF |
32+
| kWh meter (three phase) | kwhmeter-DDEEFF |
33+
34+
## TXT records
35+
36+
A discovery response contains some extra data that can be used to improve the setup in your application.
37+
38+
| Data | Description |
39+
|---------------|-------------|
40+
| api_enabled | '0' or '1', reflects if the API is enabled (1 means enabled) |
41+
| path | Fixed to '/api/v1'. Can be used to validate that your application supports this device and API version |
42+
| serial | Serial, also the MAC address. Consists of 12 hexadecimal values |
43+
| product_name | A fixed, user-friendly name. This name is not the same that is set by the user in the app. |
44+
| product_code | The product type, see [Supported devices](/docs/getting-started.md#supported-devices). Make sure your application can handle other values for future products |

docs/endpoints/_category_.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Endpoints",
3+
"position": 3,
4+
"link": {
5+
"type": "generated-index",
6+
"description": "Use the endpoints to get real-time local data from your device and control the state of the Energy Socket. Select one of the topics below to learn more about these endpoints."
7+
}
8+
}

0 commit comments

Comments
 (0)