Experimental

Updated November 14, 2022 by luwol03, Shaquu and crxporter

During development, we add new features that are marked as experimental.

These are beta versions containing possible future features. We use beta versions to test and improve our features without compromising the experience of our users.

Open Node-RED in beta mode

In order to be able to use experimental features you have to start Node-RED with NRCHKB_EXPERIMENTAL=true environment variable.

Enter this command in your terminal:

sudo NRCHKB_EXPERIMENTAL=true node-red

With DEBUG in addition:

sudo NRCHKB_EXPERIMENTAL=true DEBUG=NRCHKB* node-red

Use of Debug

Using debug allows you to see logs and possible errors.

Below is a table with all the possible logs and their description:

Options Description
NRCHKB* Show all HK logs
ServiceUtils Show Service node logs
BridgeUtils Show Bridge logs
AccessoryUtils Show Accessory logs
CharacteristicUtils Show Characteristic logs
MdnsUtils Show Mdns logs

Start automatically in beta mode

If you want to start Node-RED in experimental mode when your system restarts:

Raspberry Pi

The file should be located at /lib/systemd/system/nodered.service

sudo nano /lib/systemd/system/nodered.service

Find a line starting with Environment and add one (or both) of the following lines.

Environment="NRCHKB_EXPERIMENTAL=true"
Environment="DEBUG=NRCHKB*"

Watching these logs after enabling the logging can be done using the journalctl -f command.

sudo journalctl -u nodered.service -f

Docker

Edit your docker-compose file like this:

version: '3.8'
services:
  node-red-homekit:
    image: nrchkb/node-red-homekit:latest-12
    environment:
      NRCHKB_EXPERIMENTAL: 'true'
    network_mode: host
    volumes:
      - './data/node-red-homekit:/data'
    container_name: node-red-homekit
    restart: always

Experimental features

Custom Characteristics

It’s possible to add custom characteristics (issues#52).

To do this:

  1. Configure the nrchkb node node.

Custom Characteristics editor

  1. Add your Characteristics on Service node.

Service node Custom Characteristics

Example Eve Characteristics

Custom Characteristics Eve.app

name UUID format description minValue maxValue minStep
Volt E863F10A-079E-48FF-8F27-9C2605A29F52 uint16 Eve Volt 0 400 3
Ampere E863F126-079E-48FF-8F27-9C2605A29F52 float Eve Ampere 0 16 0.01
Watt E863F10D-079E-48FF-8F27-9C2605A29F52 uint16 Eve Watt 0 3500
Kilowatt-Hour E863F10C-079E-48FF-8F27-9C2605A29F52 float Eve Kilowatt-Hour 0 4294967295 0.01
Volt-Ampere E863F110-079E-48FF-8F27-9C2605A29F52 float Eve Volt-Ampere 0 4000 0.01

You can add the above Characteristics directly in the folder ~/.node-red/nrchkb/35b973f1696b4cd60b78ca5f719b83ca by pasting the content below into it:

{"key":"customCharacteristics","value":[{"name":"Volt","UUID":"E863F10A-079E-48FF-8F27-9C2605A29F52","format":"uint16","unit":"","perms":["pr","pw","ev","tw","wr"],"ev":"true","description":"Eve Volt","minValue":"0","maxValue":"400","minStep":"3","maxLen":"","maxDataLen":"","validValues":"","adminOnlyAccess":["0","1","2"]},{"name":"Ampere","UUID":"E863F126-079E-48FF-8F27-9C2605A29F52","format":"float","unit":"","perms":["pr","pw","ev","tw","wr"],"ev":"true","description":"Eve Ampere","minValue":"0","maxValue":"16","minStep":"0.01","maxLen":"","maxDataLen":"","validValues":"","adminOnlyAccess":["0","1","2"]},{"name":"Watt","UUID":"E863F10D-079E-48FF-8F27-9C2605A29F52","format":"uint16","unit":"","perms":["pr","pw","ev","tw","wr"],"ev":"true","description":"Eve Watt","minValue":"0","maxValue":"3500","minStep":"","maxLen":"","maxDataLen":"","validValues":"","adminOnlyAccess":["0","1","2"]},{"name":"Kilowatt-Hour","UUID":"E863F10C-079E-48FF-8F27-9C2605A29F52","format":"float","unit":"","perms":["pr","pw","ev","tw","wr"],"ev":"true","description":"Eve Kilowatt-Hour","minValue":"0","maxValue":"4294967295","minStep":"0.01","maxLen":"","maxDataLen":"","validValues":"","adminOnlyAccess":["0","1","2"]},{"name":"Volt-Ampere","UUID":"E863F110-079E-48FF-8F27-9C2605A29F52","format":"float","unit":"","perms":["pr","pw","ev","tw","wr"],"ev":"true","description":"Eve Volt-Ampere","minValue":"0","maxValue":"4000","minStep":"0.01","maxLen":"","maxDataLen":"","validValues":"","adminOnlyAccess":["0","1","2"]}]}

Service 2

Added Get functionality so that the node can retrieve attribute values when a refresh is requested. issues#392

Together with NRCHKB 2.0.0 (TBC) onSet and onChange will be merged into unified output called events.

It will output data for all event types defined below:

  • set
  • change
  • subscribe
  • unsubscribe
  • characteristic-warning

Node output will look like:

type HAPServiceNodeEvent = {name: CharacteristicEventTypes, context?: any}

type HAPServiceNodeOutput = {
    payload: { [key: string]: any }
    hap: {
        oldValue?: any
        newValue?: any
        context?: any
        event: HAPServiceNodeEvent
        session?: {
            sessionID?: SessionIdentifier,
            username?: HAPUsername,
            remoteAddress?: string,
            localAddress?: string,
            httpPort?: number,
        }
    }
    name?: string
    topic: string
}

Edit this page on GitHub