1.4.9 • Published 1 year ago

node-red-contrib-openhab3 v1.4.9

Weekly downloads
89
License
Apache-2.0
Repository
github
Last release
1 year ago

NPM Version Apache 2 license Publish NPM package NPM downloads

node-red-contrib-openhab3

No longer maintained

As of 2023-02-15 (YYYY-MM-DD), this project is no longer being maintained by me and its up for adoption. If you are interested in maintaining it please let me know. This project comes with an Apache 2 license which would need to be respected.

Description

This plugin facilitates the automation of openHAB items via Node-RED. It's useful if you want to add automation rules, but not want to use the openHAB built-in rules for that. The plugin provides you with nodes in Node-RED that can (when explicitly called via an input message) get and update the state of Items and Groups defined in openHAB. It also provides an openhab2-in2 node that will immediately output message(s) when the relevant Item or Group state is updated or changed.

This plugin supports openHAB versions up until the current latest stable v3.x RELEASE. If you are still using this module with openHAB 2.x than please consider upgrading it. Support for v2 could break at any time since version 1.4.0 of this plugin as I'm no longer testing it and I will drop support for it altogether soon.

This plugin is a fork from Peter De Mangelaere node-red-contrib-openhab2 package with additions and changes I find useful.

Installation

Install this package node-red-contrib-openhab3 via the Manage palette menu of your Node-RED instance.

Technical

The openhab2-in2 and openhab2-out2 nodes use GET, POST and PUT requests sent to the openhab REST API via the url http://openhab:port/rest/items/<item> The openhab2-in2 and openhab2-events2 nodes receive updates via a Server-Sent Events (SSE) connection that is established once per controller and once per events-node, via the url http://openhab:port/rest/events.

Changes

VersionDescription
1.4.9Fix typo
1.4.8Added unmaintained notice
1.4.7Update readme
1.4.6Update README; Test with Node-RED 3.0.2
1.4.5Update npm packages
1.4.4Fix bug with eventsource hitting a 401/403
1.4.3Update npm packages
1.4.2Announce reduced support for OH 2.x
1.4.1Fix SSE events handling for OH 3.3
1.4.0Add support for OH 3.3
1.3.45Add badges to README (fix)
1.3.44Add badges to README (fix)
1.3.43Add badges to README (fix)
1.3.42Add badges to README
1.3.41Update eventsource package to 2.0.2
1.3.40No actual change, test improved npm security
1.3.39No actual change, improve release process
1.3.38No actual change, except testing a change to Github actions
1.3.37Update packages
1.3.36Update many packages
1.3.35Update all packages (for Scorecard)
1.3.34Scorecard only finds examples in examples dir
1.3.33Improve scorecard
1.3.32openhab2-out2 node outputs message when one was actually sent (#26)
1.3.31Update NodeJS packages.
1.3.30Use 'httpNodeRoot'-setting for "get items list" call.
1.3.29Add support for the "get items list" call to a Node-RED instance running under another webroot (not /)
1.3.28Test an automated release (no actual changes)
1.3.27Prevent 'get items'-call interference with previous plugin
1.3.26Improve release procedure
1.3.25Fix for 'TypeError: Cannot read property 'length' of undefined' in monitor node
1.3.24Show proper status for monitor node
1.3.23Improve CommunicationStatus event status
1.3.22Update docs; Use correct spelling for openHAB
1.3.21Always send payload as a string via out2 node
1.3.20Replace request package with axios (#3)
1.3.19Use official eventsource package
1.3.18Add option for sending NULL-values for get2-node (#22)
1.3.17Fix issue #21
1.3.16get2 node only sends state when not NULL
1.3.15Pass on existing topic for get2 node when not set from config
1.3.14Fix for group members for groups
1.3.13Also return group members for groups
1.3.12Spread load a little at start-up
1.3.11Return all group members for get2-node
1.3.10Revert fix error reporting bug for CommunicationError
1.3.9Fix error reporting bug for CommunicationError
1.3.8Update the node-documentation shown in Node-RED
1.3.7Fix/'work around' for NPE in 77-openhab2.js:396:31
1.3.6Add support for OAuth2 token with OH3 (issue #7)
1.3.5Fix openhab2-events2 node to also work with OpenHAB v3 (issue #6)
1.3.4Upgrade this module to be built and tested with Node.js v12
1.3.3Add support for GroupItemStateChangedEvent event
1.3.2Remove (useless) nodes picture; Update README
1.3.1Update nodes picture in this README
1.3.0Renamed all nodes to be unique from the original package

Nodes

See 77-openhab2.html for info on the provided nodes. This is best viewed from Node-RED, adding a node and viewing its corresponding Help page.

Testing the plugin (for development purposes)

Prerequisites for running this test environment are docker and docker-compose. It allows you to test this plugin for development purposes. Docker is used to start a clean Node-RED, OpenHAB v2 and OpenHAB v3 environment, with this plugin installed into Node-RED before the service is started (inside the container).

# Start by running Node-RED and OpenHAB
./run.sh

After a little while, you can visit:

When in the Node-RED UI, you can import flow.json via the Import option, which contains some example tests for each of the nodes, per OpenHAB version, running simultaneously.

You can verify the server sides event connections to be working as well. They are used by the plugin to receive any updates from OpenHAB:

When finished, you can reset the test-setup from scratch (this also removes volumes):

./clean.sh
1.4.9

1 year ago

1.4.8

1 year ago

1.4.7

1 year ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.42

2 years ago

1.3.43

2 years ago

1.3.41

2 years ago

1.3.44

2 years ago

1.3.45

2 years ago

1.3.36

2 years ago

1.3.39

2 years ago

1.3.37

2 years ago

1.3.38

2 years ago

1.3.40

2 years ago

1.3.31

2 years ago

1.3.32

2 years ago

1.3.30

2 years ago

1.3.35

2 years ago

1.3.33

2 years ago

1.3.34

2 years ago

1.3.29

2 years ago

1.3.25

2 years ago

1.3.28

2 years ago

1.3.26

2 years ago

1.3.27

2 years ago

1.3.20

3 years ago

1.3.21

3 years ago

1.3.24

3 years ago

1.3.22

3 years ago

1.3.23

3 years ago

1.3.18

3 years ago

1.3.17

3 years ago

1.3.15

3 years ago

1.3.16

3 years ago

1.3.14

3 years ago

1.3.13

3 years ago

1.3.12

3 years ago

1.3.11

3 years ago

1.3.10

3 years ago

1.3.9

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.8

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.6

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago