Skip to content

Commit

Permalink
v0.4.3 fix knxd DPT type conversion for DPT5.001
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulvm committed Apr 7, 2023
1 parent 695f740 commit d7787c7
Show file tree
Hide file tree
Showing 9 changed files with 329 additions and 386 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Changelog

## 0.4.3
- merged PR #198 (Update WindowCoveringTilt.js) by @EyeOfTheStorm
- merged PR #204 (Update GarageDoorOpenerAdvanced.js) by @christof-fersch
- fix knxd DPT type conversion, was overrun by #194 (Fixes for knxjs integration) in the case that handlers with `KNXObjects` were present.
- accordingly update GiraJalousieActuator
- removed the documentation of the built-in web server, as the most functionality is either gone (restart homebridge) and/or covered by the homebridge GUI now (webserver is still there but will be removed)

## 0.4.2
- fix undefined variable name

Expand Down Expand Up @@ -31,7 +39,7 @@ Example in the config file (e.g. in Homebridge GUI):
}
]
```
- quite a while back @jendrik found some issues and fixed them. They have been in the master branch ever since but not properly honored or published in a release.
- quite a while back @jendrik found some issues and fixed them. They have been in the master branch ever since but not properly honored or published in a release. PR #194 also contain sthe fixes for using `knxjs` instead of the `eibd` module to talk to other KNX routers than `knxd`

## 0.3.27
- @CyberChris79 found a breaking change in HAP-nodeJS (the HAP protocol implementation which homebridge is build on) which broke the tiny web server that can display HAP Services and such (see https://github.com/snowdd1/homebridge-knx#looking-up-service-types-and-characteristics) *Note to self: the webserver implementation is ugly and has grown too much for kind-of inline code in index.js*
Expand Down
79 changes: 52 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# homebridge-knx Version 0.3
# homebridge-knx Version 0.4
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url][![Dependency status][david-dm-image]][david-dm-url]

KNX platform shim for homebridge.
Expand All @@ -8,19 +8,61 @@ Please also visit [homebridge github homepage](https://github.com/nfarina/homebr

Latest to homebridge-knx changes can be found in the [CHANGELOG.md](CHANGELOG.md)

### This can only be used with homebridge >=0.4.28 and Node >=10.19.0
### This can only be used with homebridge >=1.0 and Node >=10.19.0

### Prerequisites
This node module requires a running (and properly configured) **knx daemon (knxd)**. You can find the latest version [here](https://github.com/knxd/knxd).
This node module requires either
- a running (and properly configured) **knx daemon (knxd)**. You can find the latest version [here](https://github.com/knxd/knxd).
- another KNX router which can be reached by KNX multicasts.

I cannot support the knxd. Please address issues directly at the [knxd issue pages](https://github.com/knxd/knxd/issues). It might help to search the existing issues, as your problem might have been solved already.

### Installation and running
- Install homebridge first, [see there](https://github.com/nfarina/homebridge); nfarina recommends a global install as super user. It's a server tool, so we can safely assume that the person that installes it is sufficiently priviledged to do so. `sudo npm install -g homebridge`
- then install this package to `<any>` directory you want; If you installed homebridge globally I recommend to do so with homebridge-knx: `sudo npm install -g homebridge-knx`
- configure homebridge and its plugins. You might start by copying the [`KNX-sample-config.json`](https://github.com/snowdd1/homebridge-knx/blob/master/KNX-sample-config.json) to a new folder `.homebridge` in your user folder (on a default installation raspberry, it's `/home/pi`) and rename it to config.json
- Then put the configuration file*knx_config.json* into `~/.homebridge`, and adapt them to your needs (knxd address and some test devices in `knx_config.json`). You do not need a `platform` section in `config.json`any more!
- Install homebridge first, from [https://homebridge.io/](https://homebridge.io/);
- Once you have your instance running (without any devices yet), go to the `Plugins` tab and type `knx` in the search box
- `homebridge-knx` should be within the top five hits (yes, there are alternatives), please check the name before installing
- Then put the configuration file *knx_config.json* into `~/.homebridge` (or another folder to your liking, but it should be reaadable and writable by user `homebridge` or group `homebridge` which is created by the homebridge installer), and adapt them to your needs (knxd address and some test devices in `knx_config.json`)
- Eliminate everything (especially all group addresses) that might harm your KNX installation. Sending bus telegrams to your alarm device might wake the neighbourhood unpleasantly!
- when done, start homebridge with `homebridge`. If you have chosen a local install, go to the homebridge folder and do a `bin/homebridge --plugin-path <any>/homebridge-knx` with the path to the homebridge-knx installation.
- If you used the dfeault paths (~/.homebridge/knx_config.json) you can just restart homebridge using the GUI
- If you didn't, or want to use child bridges for more accessories (than 149) you need to configure homebridge (using the GUI e.g.). The following sample is from my test installation

```json
{
"bridge": {
"name": "Homebridge 17AF",
"username": "0E:0B:9B:24:17:AD",
"port": 51485,
"pin": "880-83-869",
"advertiser": "avahi"
},
"accessories": [],
"platforms": [
{
"name": "Config",
"port": 8581,
"auth": "form",
"theme": "auto",
"tempUnits": "c",
"lang": "en",
"platform": "config"
},
{
"name": "KNX",
"platform": "KNX",
"config_path": "/home/pi/homebridge/dg-knx_config.json"
},
{
"name": "KNX",
"platform": "KNX",
"config_path": "/home/pi/homebridge/og-knx_config.json",
"_bridge": {
"username": "0E:0B:9B:24:17:00",
"port": 51490
}
}
]
}
```


# Assumptions
Expand All @@ -35,31 +77,14 @@ Float | DPT9


# knx_config.json
See the [complete Doc!](https://github.com/snowdd1/homebridge-knx/blob/plugin-2.0/knx_config.json.md).
See the [complete Doc!](https://github.com/snowdd1/homebridge-knx/blob/master/knx_config.json.md).


# Add-ins
Add-in (aka "handlers") can change the default behavior. [See the article](https://github.com/snowdd1/homebridge-knx/blob/plugin-2.0/handler-add-in.md)
Add-in (aka "handlers") can change the default behavior. [See the article](https://github.com/snowdd1/homebridge-knx/blob/master/handler-add-in.md)

Happy testing!

# Removing stale accessories from homebridge cache
The new (well, 1/2016) API of homebridge allows homebridge to cache the accessories for platforms that can add or remove accessories during runtime. As a next step in evolution, homebridge-knx already connects to that API.

**Allow homebridge-knx to start the webserver by adding `"AllowWebserver":true,` at the beginning of your knx_config.json!**

As a consequence remain devices, that homebridge-knx does not reconnnect to at start-up, stale and unreachable in HomeKit. To remove those shadows from HomeKit, use the little web server at `<your-homebridge>:18081/list`. You might change the web server port with `"WebserverPort":18082` or whatever port suits you.

![image](https://cloud.githubusercontent.com/assets/11786396/19836160/5d1ddcde-9e98-11e6-8dc2-e621aceb1055.png)
Clicking on the `delete from cache` link will **only** remove the devices from the current homebridge instance and their cache, **not** from the *knx_config.json*, that means they will be rediscovered upon next startup as new device in the default room!

# Looking up service types and characteristics
If you have the webserver enabled (see above), you can get an auto-generated web-page with all the service types and their characteristics from homebridge. See the links at the bottom of your server's list page.


# Killing homebridge
Deprecated. Use the homebridge GUI to do that.


[npm-url]: https://npmjs.org/package/homebridge-knx
[downloads-image]: http://img.shields.io/npm/dm/homebridge-knx.svg
Expand Down
7 changes: 2 additions & 5 deletions knx_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"knxconnection": "knxd",
"knxd_ip": "192.168.178.212",
"knxd_port": 6720,
"AllowWebserver": true,
"WebserverPort": 18082,
"Devices": [
{
"DeviceName": "Arbeitszimmerlampe",
Expand Down Expand Up @@ -68,7 +66,7 @@
}
]
},
{
{
"DeviceName": "TestDevice",
"hint": "Sample to show characteristics without KNX addresses",
"Services": [
Expand All @@ -89,5 +87,4 @@
}
],
"GroupAddresses": []

}
}
4 changes: 0 additions & 4 deletions knx_config.json.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ homebridge-knx expects the following structure in the `knx_config.json`:
"knxconnection": "knxjs",
"knxd_ip": "192.168.1.1",
"knxd_port": 6720,
"AllowWebserver": true,
"AllowKillHomebridge": false,
"Devices": [
]
}
```
`knxconnection` if set to "knxjs" then [javascript based knx multicast](https://www.npmjs.com/package/knx) routing is used, set to any other value or non-existent will default to knxd
`192.168.1.1` has to be changed to your [knxd](https://github.com/knxd/knxd) installation, and `6720` to the port you are using (6720 is default).
`platform` and `name` have become obsolete.
`AllowWebserver`: if set to true, homebridge-knx will start a tiny webserver on port 18081 to allow the removal of devices from homebridge cache (and the running instance). Enable for debugging, disable for secure productive operation!
`AllowKillHomebridge`: if set to true, you'll get a link at the tiny web browser allowing to force a shutdown of homebridge by throwing an exception. You should reset that to false after debugging, because it allows anyone with access to the webserver to shut down your homebridge instance.

`Devices` is an array of objects, each representing an *homekit accessory*.

Expand Down
Loading

0 comments on commit d7787c7

Please sign in to comment.