npm.io
1.2.2 • Published 2d ago

homebridge-zencontrol-tpi

Licence
Apache-2.0
Version
1.2.2
Deps
1
Size
81 kB
Vulns
0
Weekly
0

Zencontrol Third Party Interface Homebridge plugin

A plugin for Homebridge that enables control over lights using Zencontrol Third Party Interface (TPI).

Features

Groups

DALI Groups will be represented as light switches.

Individual lights

Any light ECGs that aren't part of a group will be represented as a light switch.

Blinds

Any blind controller that has its name (Location name) listed in the Blinds list in the plugin configuration will be represented as a window covering.

If a system variable exists with the same name as the blind but with the word "Position" after it, then it will be used to reflect the position of the blind (0 = closed, 100 = open). This is because the blind controller arc level may not accurately reflect the blind position if it resets to 0 after some time.

If the position system variable is available, HomeKit will send a Recall Min to the blind (instead of the expected Off), and you must setup a trigger + sequence to convert that to Off and to update the position system variable.

Windows

If you have windows controlled by a system variable pair—one for control and one for position—you can list the control variable name in the plugin configuration.

The plugin assumes that the control system variable is set to:

  • 0 for stopped
  • 1 for closing
  • 2 for opening

There should be a position system variable with the same name as the control variable with the word "Position" after it. This has the same semantics as for blinds.

Relays

Any relay that has its name (Location name) listed in the Switches list in the plugin configuration will be represented as a switch. Only named relays are handled to prevent pulling through relays that aren't appropriate.

Temperature

System variables that end with the word "Temperature" will be represented as temperature sensor accessories.

Humidity

System variables that end with the word "Humidity" will be represented as humidity sensor accessories.

Lux

System variables that end with the word "Lux" will be represented as light sensor accessories.

CO2

System variables that end with the word "CO2" will be represented as carbon dioxide sensor accessories.

Set the CO2 level to treat as abnormal in the plugin configuration.

Development

nvm install
nvm use
npm install
npm run build

When I make changes I like to test them on my local Homebridge, which is on another device accessible via ssh:

npm run build && rsync -a --delete dist config.schema.json ubuntu@192.168.1.2:/var/lib/homebridge/node_modules/homebridge-zencontrol-tpi/ && rsync -a --delete node_modules/zencontrol-tpi-node ubuntu@192.168.1.2:/var/lib/homebridge/node_modules/homebridge-zencontrol-tpi/node_modules/

Then I restart Homebridge to load the updated code.

Contributing

This project uses npm and changesets for its build process.

When committing a change, please create a changeset:

npm exec changeset
git commit -a "feat: ..."

Releasing

Pre-release

To enter pre-release mode:

npm exec changeset pre enter next
git add .changeset/pre.json
git commit -m "publish: enter prerelease"

Once you've made changes and committed one or more changesets; bump the version:

npm run release:version
git commit -a -m "publish: prerelease"
npm run release

To exit pre-release mode:

npm exec changeset pre exit
npm run release:version
git commit -a -m "publish: release"
npm run release

Keywords