Skip to content

Lights example 1: the first step, switch your light

Andre Hartman edited this page Oct 27, 2019 · 1 revision

Objective

You set everything up, you open the Node-RED editor, you look at a blank page and you have no idea what to do next. As first step the most simple automation: switch a light on and off.

Events

Homekit, Homebridge and Node-RED are event-driven tools. They define a situation, a model of reality. Nothing happens until an event occurs. When an event occurs the node-red flows determine a reaction and node-red can send instructions to Homebridge accessories accordingly.

In this example we will - not yet - monitor real-life events but we will create a test event inside Node-RED. Again and this is important, nothing happens until an event occurs!

Components used

We need only two components, it does not get any simpler that that.

  1. Component to create a test event: an 'inject' node.
  2. Component to control the light: a 'hb control' node representing a light accessory in your Homebridge setup.