Working on README
This commit is contained in:
parent
60545b2909
commit
3248262e7a
111
README.md
111
README.md
@ -3,19 +3,22 @@
|
||||
**Version v2 is a complete rewrite from scratch and a breaking update.**
|
||||
You need to adapt your `config.json` !
|
||||
|
||||
## Currently supported
|
||||
## Currently supported accessories
|
||||
This plugin currently supports the following services (and characteristics):
|
||||
|
||||
* LightBulb (on/off, brightness, hue, saturation, r, g, b, w)
|
||||
* Fan (active)
|
||||
* TemperatureSensor (current temperature)
|
||||
* Thermostat (current- / target temperature, currentheatingcoolingstate)
|
||||
* MotionSensor (motion detected)
|
||||
* OccupancySensor (presence detected)
|
||||
* ContactSensor (contact state)
|
||||
* Switch (on/off)
|
||||
* Outlet (on/off)
|
||||
* WindowCovering (CurrentPosition, TargetPosition).
|
||||
| Type | Description |
|
||||
|:----------------------------------------|:--------------------------------------------------------|
|
||||
| ContactSensor | Simple contact sensor, for example for windows |
|
||||
| [Doorbell](#doorbell) | Doorbell, sends message to devices on ring |
|
||||
| [Fan](#fan) | Simple on/off fan, may be extended in future |
|
||||
| [Lightbulb](#lightbulb) | Everything, from simple light to dimmable, RGB and RGBW |
|
||||
| [MotionSensor](#motionsensor) | Detects and reports motion |
|
||||
| [OccupancySensor](#occupancysensor) | Detects presence in a room |
|
||||
| [Outlet](#outlet) | Simple on/off wall outlet |
|
||||
| [TemperatureSensor](#temperaturesensor) | Temperature sensor |
|
||||
| [Thermostat](#thermostat) | Thermostat with temperature sensor and heating state |
|
||||
| [Switch](#switch) | Simple on/off switch |
|
||||
| [WindowCovering](#windowcovering) | Window covering (shutters, blinds, ...) |
|
||||
|
||||
Other accessories are being worked on and will be added as soon as ready.
|
||||
|
||||
@ -62,38 +65,100 @@ The following parameters are available to configure the plugin as platform in ho
|
||||
If the `port` and `tls` parameters are not specified the plugin defaults to port 2424 without tls encryption.
|
||||
|
||||
### Common accessories characteristics
|
||||
The following characteristics are valid for all accessories.
|
||||
The following characteristics are valid for all accessories:
|
||||
|
||||
Mandatory:
|
||||
| Parameter | Possible values | Mandatory | Description |
|
||||
|:-------------|:----------------------------------------------|:----------|:--------------------------------|
|
||||
| type | <type> from the above list of supported types | Yes | Type of accessory |
|
||||
| name | Any \<string> | Yes | Visible name in HomeKit |
|
||||
| manufacturer | Any \<string> | No | Visible manufacturer in HomeKit |
|
||||
| model | Any \<string> | No | Visible model in HomeKit |
|
||||
|
||||
#### Example:
|
||||
```json
|
||||
{
|
||||
"type": "OccupancySensor",
|
||||
"name": "Presence kitchen",
|
||||
}
|
||||
```
|
||||
|
||||
Optional:
|
||||
```json
|
||||
{
|
||||
"manufacturer": "Preussen",
|
||||
"model": "Motion 360 KNX",
|
||||
}
|
||||
```
|
||||
### Doorbell
|
||||
*TODO*
|
||||
A doorbell is an accessory that simply sends a message to all devices enrolled in the home that someone rang the doorbell.
|
||||
HomeKit displays a message that "This accessory is not currently supported by the Home app.".
|
||||
Further investigation is needed, but for now it still works.
|
||||
#### Characteristics in addition to [common characteristics](#common-accessories-characteristics)
|
||||
| Parameter | Possible values | Mandatory | Description |
|
||||
|:-------------|:----------------|:----------|:---------------------------------------|
|
||||
| SinglePress | <item> | Yes | SHNG item to monitor for doorbell ring |
|
||||
|
||||
#### Example:
|
||||
```json
|
||||
{
|
||||
"type": "Doorbell",
|
||||
"name": "Main door",
|
||||
"SinglePress": "Technik.Asterisk.Klingel"
|
||||
}
|
||||
```
|
||||
|
||||
### Fan
|
||||
*TODO*
|
||||
For now this accessory only supports turning the fan on and off. Further improvements are possible, but i don't have the needed hardware for testing.
|
||||
|
||||
#### Characteristics in addition to [common characteristics](#common-accessories-characteristics)
|
||||
| Parameter | Possible values | Mandatory | Description |
|
||||
|:----------|:----------------|:----------|:---------------------------------------|
|
||||
| Active | <item> | Yes | SHNG item to set and get the fan state |
|
||||
|
||||
#### Example:
|
||||
|
||||
```json
|
||||
{
|
||||
"type": "Fan",
|
||||
"name": "Fan bathroom",
|
||||
"Active": "OG.Bad.Ventilator"
|
||||
}
|
||||
```
|
||||
|
||||
### LightBulb
|
||||
*TODO*
|
||||
|
||||
### Occupancy sensor
|
||||
*TODO*
|
||||
This sensor is tripped if it detects presence in a room.
|
||||
|
||||
#### Characteristics in addition to [common characteristics](#common-accessories-characteristics)
|
||||
| Parameter | Possible values | Mandatory | Description |
|
||||
|:------------------|:----------------|:----------|:----------------------------------|
|
||||
| OccupancyDetected | <item> | Yes | SHNG item to monitor for presence |
|
||||
|
||||
|
||||
#### Example:
|
||||
```json
|
||||
{
|
||||
"type": "OccupancySensor",
|
||||
"name": "Presence bathroom",
|
||||
"manufacturer": "Preussen",
|
||||
"model": "Motion 360 KNX",
|
||||
"OccupancyDetected": "OG.Bad.Praesenz"
|
||||
}
|
||||
```
|
||||
|
||||
### Motion sensor
|
||||
*TODO*
|
||||
This sensor is tripped if it detects motion in a room.
|
||||
|
||||
#### Characteristics in addition to [common characteristics](#common-accessories-characteristics)
|
||||
| Parameter | Possible values | Mandatory | Description |
|
||||
|:---------------|:----------------|:----------|:--------------------------------|
|
||||
| MotionDetected | <item> | Yes | SHNG item to monitor for motion |
|
||||
|
||||
|
||||
#### Example:
|
||||
```json
|
||||
{
|
||||
"type": "OccupancySensor",
|
||||
"name": "Presence bathroom",
|
||||
"OccupancyDetected": "EG.Flur.Bewegung"
|
||||
}
|
||||
```
|
||||
|
||||
### Contact sensor
|
||||
*TODO*
|
||||
|
||||
@ -118,17 +118,28 @@ export class WindowCovering implements AccessoryPlugin {
|
||||
}
|
||||
|
||||
updateDirection() {
|
||||
let direction;
|
||||
if (this.targetPosition < this.currentPosition) {
|
||||
direction = 'DECREASING';
|
||||
this.positionState = this.platform.Characteristic.PositionState.DECREASING;
|
||||
} else if (this.targetPosition > this.currentPosition) {
|
||||
direction = 'INCREASING';
|
||||
this.positionState = this.platform.Characteristic.PositionState.INCREASING;
|
||||
} else {
|
||||
direction = 'STOPPED';
|
||||
this.positionState = this.platform.Characteristic.PositionState.STOPPED;
|
||||
}
|
||||
this.platform.log.debug(
|
||||
'updateDirection for', this.accessory.name,
|
||||
': current =', this.currentPosition,
|
||||
'target =', this.targetPosition,
|
||||
'direction:', direction,
|
||||
);
|
||||
}
|
||||
|
||||
convertRange(value: number, oldmin: number, oldmax: number, newmin: number, newmax: number, inverted: boolean): number {
|
||||
let result = (((value - oldmin) * (newmax - newmin)) / (oldmax - oldmin)) + newmin;
|
||||
result = Math.round(result);
|
||||
if (inverted) {
|
||||
result = newmax - result;
|
||||
}
|
||||
|
||||
@ -1,12 +1,13 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2018", // ~node10
|
||||
"target": "ES2019",
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es2015",
|
||||
"es2016",
|
||||
"es2017",
|
||||
"es2018"
|
||||
"es2018",
|
||||
"es2019"
|
||||
],
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
@ -22,6 +23,7 @@
|
||||
"src/Accessories/.ts"
|
||||
],
|
||||
"exclude": [
|
||||
"**/*.spec.ts"
|
||||
"**/*.spec.ts",
|
||||
"node_modules"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user