Skip to content

Commit

Permalink
Add publish docs
Browse files Browse the repository at this point in the history
  • Loading branch information
longzheng committed Dec 13, 2024
1 parent 60db491 commit d048d8b
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default withMermaid(
},
{ text: 'Site meter', link: '/configuration/meter' },
{ text: 'Limiters', link: '/configuration/limiters' },
{ text: 'Publish', link: '/configuration/publish' },
],
},
{
Expand Down
98 changes: 98 additions & 0 deletions docs/configuration/publish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
# Publish

Optionally configure the active limits to be published to an external system.

[[toc]]

## MQTT

Write active limits to a MQTT topic.

To configure a MQTT output, add the following property to `config.json`

```js
{
"publish": {
"mqtt": {
"host": "mqtt://192.168.1.2", // (string) required: the MQTT broker host
"username": "user", // (string) optional: the MQTT broker username
"password": "password", // (string) optional: the MQTT broker password
"topic": "limits" // (string) required: the MQTT topic to write
}
}
...
}
```

The MQTT topic will contain a JSON message that meets the following schema

```ts
type ActiveInverterControlLimit = {
opModEnergize:
| {
value: boolean;
source: InverterControlTypes;
}
| undefined;
opModConnect:
| {
value: boolean;
source: InverterControlTypes;
}
| undefined;
opModGenLimW:
| {
value: number;
source: InverterControlTypes;
}
| undefined;
opModExpLimW:
| {
value: number;
source: InverterControlTypes;
}
| undefined;
opModImpLimW:
| {
value: number;
source: InverterControlTypes;
}
| undefined;
opModLoadLimW:
| {
value: number;
source: InverterControlTypes;
}
| undefined;
};

type InverterControlTypes =
| 'fixed'
| 'mqtt'
| 'sep2'
| 'twoWayTariff'
| 'negativeFeedIn';
```

For example

```js
{
"opModEnergize": {
"source": "sep2",
"value": true
},
"opModConnect": {
"source": "sep2",
"value": true
},
"opModExpLimW": {
"source": "sep2",
"value": 1500
},
"opModImpLimW": {
"source": "sep2",
"value": 1500
}
}
```

0 comments on commit d048d8b

Please sign in to comment.