npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-unipi-ng

v1.1.4

Published

Unipi Neuron NG Plugin for Homebridge. A new version of the original homebridge-unipi plugin.

Downloads

319

Readme

Homebridge Unipi NG

Why

I originally developed the homebridge-unipi plugin to control my Unipi Neuron board with HomeKit. While the plugin worked well for many years, it was based on an older Homebridge version and the code could be cleaner. It was also missing some features that I wanted to add. So... time for a rewrite.

What is different

  • The plugin is now based on the latest Homebridge version
  • The plugin only exposes the devices that you actually configure in the config.json file
  • The plugin is cleaner and written in Typescript
  • The plugin supports different 'virtual' devices, like lights, fans, ...
  • Devices can optionally derive their state from a unipi output
  • Devices can target a Unipi output directly or in 'pulse' mode
  • Devices can BOTH derive their state and target and output. For example to be able to determine the state of a light after power loss.
  • The plugin supports multiple Unipi boards
  • Works with HomeAssistant and possibly other platforms.
  • Push buttons are exposed as singular accessories, instead of services on the main accessory. This is because Home Assistant does not support previous multi-service old setup.
  • The plugin supports a 'debug' option to log all messages from a specific device. This can be useful to determine the correct configuration for a device.
  • The plugin supports a 'disabled' option for devices. This can be useful to temporarily disable a device without removing it from the configuration.
  • The plugin will by default create virtual evok 'monitoring' circuits that are fake inputs that will reflect the input state. This way, even if the device state is changed from another UniPi integration, the state will be reflected in the HomeKit interface.
  • Support for timer devices. These devices are shown as switches, and can be triggered (started) manually, by homekit or by an evok trigger.
  • Support for 'monitor' devices. These devices are shown as switches, and can be used to derive the state of an output device from an input device. They can also trigger a homekit event, or an evok target device.

What is the same

  • Buttons can easily toggle other devices (lights, lamps, ...)
  • Devices mapped to a UniPi output can either be toggled directly using the output state or in 'pulse' mode, where the output is pulsed for a short time in order to toggle a pulse relay.
  • Buttons support single, long and double press actions

Release history

Use with Home Assistant

In Home Assistant, add a new 'Homekit Device' integration. Configure the integration with the Homebridge pin code and optionally the IP and port. Home Assistant will likely detect the integration and propose pairing with it.

Installation

  1. Install the plugin using npm -g install homebridge-unipi-ng or npm install homebridge-unipi-ng
  2. Add the plugin to your Homebridge config.json file. Note that you should disregards the sample bridge in the config below. I do however recommend that you use the ciao advertiser.
{
	"bridge": { // Keep what you have here
		"name": "Example Unipi NG Bridge",
		"username": "01:02:03:04:05:06",
		"port": 54321,
		"pin": "123-45-678",
		"advertiser": "ciao"
	},
	"accessories": [],
	"platforms": [
		{ // This is the block you should add
			"id": "unique-platform-id", // A unique id for this platform
			"platform": "UnipiNGPlatform", // The platform type (exact)
			"name": "Unipi NG Platform", // The name of the platform
			"devices": [ // The list of the devices to expose
				{
					"id": "neuron-1", // A unique id for this device
					"disabled": false, // By default, not disabled. Use for devices that you want to disable.
					"manufacturer": "UniPi", // Optional manufacturer
					"model": "Neuron M203", // Optional model
					"serial": "140", // Optional serial
					"name": "UniPi Neuron 1", // Display name
					"type": "evok", // Required for the Unipi devices
					"options": { // Options for the device
						"url": "ws://192.168.86.252/ws", // Websocket URL to the Unipi device
						"debug": [ // Debug options. Will log an evok message if all properties match
							{ // Example: Log all messages from inputs
								"dev": "input"
							},
							{ // Example: Log all messages from relay 2_01
								"dev": "relay",
								"circuit": "2_01"
							}
						]
					}
				},
				{ // A light. Targets the relay 2_02 on neuron-1 for switching. Maintains own state.
					"id": "light-bathroom",
					"name": "Bathroom lights",
					"type": "light",
					"manufacturer": "MiBoxer",
					"target": {
						"pulse": true,
						"evok": "neuron-1",
						"dev": "relay",
						"circuit": "2_02"
					}
				},
				{ // A light. Targets the relay 2_02 on neuron-1 for switching. Reads state from input 1_02.
					"id": "light-hallway",
					"name": "Hallway lights",
					"type": "light",
					"manufacturer": "MiBoxer",
					"source": {
						"evok": "neuron-1",
						"dev": "input",
						"circuit": "1_02"
					},
					"target": {
						"pulse": true,
						"evok": "neuron-1",
						"dev": "relay",
						"circuit": "2_02"
					}
				},
				{ // Shows the state of User LED 1 as a light (disabled)
					"id": "led-user-1",
					"disabled": true,
					"manufacturer": "UniPi",
					"model": "Neuron",
					"serial": "Not set",
					"name": "User LED One",
					"type": "light",
					"source": {
						"evok": "neuron-1",
						"dev": "led",
						"circuit": "1_01"
					}
				},
				{ // A fan. Targets the relay 2_01 on neuron-1 for switching. Maintains own state.
					"id": "fan-bathroom",
					"name": "Badkamer Ventilator",
					"type": "fan",
					"target": {
						"pulse": true,
						"evok": "neuron-1",
						"dev": "relay",
						"circuit": "2_01"
					}
				},
				{ // A push button
					"id": "button-hallway-lights",
					"name": "Button for hallway lights",
					"manufacturer": "Niko",
					"type": "button",
					"source": {
						"evok": "neuron-1",
						"dev": "input",
						"circuit": "1_01"
					}
				},
				{
					"id": "switch-something",
					"name": "A switch that controls something (unknown)",
					"manufacturer": "MiBoxer",
					"type": "switch",
					"target": {
						"pulse": false,
						"evok": "neuron-1",
						"dev": "relay",
						"circuit": "2_04"
					}
				}
			],
			"platform": "UnipiNGPlatform"
		}
	]
}