|
| 1 | +--- |
| 2 | +publishDate: 2025-10-02 |
| 3 | +title: SignalK Automation of Hella LED Dimmer Module |
| 4 | +author: Greg Young |
| 5 | +image: ~/assets/images/Hella-dimmer.webp |
| 6 | +category: Tutorial |
| 7 | +tags: [LED control, Zigbee sensors, Node-RED] |
| 8 | +excerpt: Interface SignalK with an existing Hella Marine LED module to monitor and control LED lights. |
| 9 | +--- |
| 10 | + |
| 11 | +## Background |
| 12 | + |
| 13 | +My boat is fitted with Hella Marine LED dimmer modules that use wall-mounted (hard-wired) push-button switches to control and dim the overhead LED lights. |
| 14 | + |
| 15 | +The boat builder installed only a single wall switch, and its location is sometimes inconvenient. I wanted a second control switch location (without running new wiring throughout the boat), as well as the ability to control the lights via a motion sensor or any SignalK-connected display/control device (e.g., an iPad). |
| 16 | + |
| 17 | +I wanted to retain the existing wall control buttons, but also add additional control options (extra switches) and automation via SignalK. |
| 18 | + |
| 19 | +To achieve this, I needed a wireless (WiFi) module that could interface with SignalK, include an input to sense the current state of the lights (On/Off), and provide an output (momentary pulse) to control the Hella dimmer module. |
| 20 | + |
| 21 | +I selected a **Shelly 1 Plus** module for this purpose. |
| 22 | + |
| 23 | +## Shelly 1 Plus |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +Since my house electrical system runs on 24VDC, it was important to find a module capable of running directly from the existing light circuit. |
| 28 | + |
| 29 | +A “24V” system under battery charging conditions can reach ~29V, which rules out many modules with more limited power supply specifications. |
| 30 | + |
| 31 | +The Shelly 1 Plus can operate from 12V/24–48VDC, includes a single “switch” input, and provides a relay-based output. |
| 32 | + |
| 33 | +An alternative Shelly module that offers dual-channel capability (and could therefore control both Hella module circuits) is the recently released **Shelly Uni**. |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | +## Interface Circuit |
| 38 | + |
| 39 | +The Shelly 1 Plus is powered from the same lighting circuit as the Hella module. |
| 40 | + |
| 41 | +- **Shelly input (SW)** |
| 42 | + Connected to the existing Hella output circuit and used to sense the Hella state (On or Off). |
| 43 | + |
| 44 | +- **Shelly relay outputs (O & I)** |
| 45 | + Connected across the existing wall-mounted push-button switch to send a “pulse.” This creates a momentary short across the switch, which controls the Hella module. |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | +**Note:** The Hella module dims the lights using PWM output. However, the Shelly input cannot detect the dim level—it only senses whether the lights are On. Likewise, the Shelly can only switch the lights On or Off; it cannot directly control Hella dimming. |
| 50 | +(In theory it could, but since it cannot detect the current dim level, this is not practical.) |
| 51 | + |
| 52 | +Even though the Hella output to LEDs is pulse width modulated (PWM) for dimming operation, the Shelly input handles this correctly, and at all dim levels it senses the lights as “On.” |
| 53 | + |
| 54 | +## Configuring the Shelly Device |
| 55 | + |
| 56 | +The Shelly device needs configuration, specifically to “unlink” the connection between its input and output. This is called a **detached input** (because the input is used independently of the output). |
| 57 | + |
| 58 | + |
| 59 | + |
| 60 | +The home screen status will then appear as follows: |
| 61 | + |
| 62 | + |
| 63 | + |
| 64 | +Since the Hella uses a momentary push button for control (to toggle On/Off), the Shelly must emulate this by pulsing its output. The timer function switches it off after 0.1 seconds. |
| 65 | + |
| 66 | + |
| 67 | + |
| 68 | +I chose to use **MQTT connectivity** between the Shelly device and the SignalK server (not via a Shelly plugin). Specifically, I used MQTT RPC (Remote Procedure Calls). |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | +## Zigbee Push Button (Tap) Switches |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | +A Zigbee (wireless) button is used for control purposes. Each button supports three actions: _tap_, _hold_, and _double tap_. |
| 77 | + |
| 78 | +Using a Node-RED flow, a short tap toggles the light On/Off. |
| 79 | + |
| 80 | +For a detailed tutorial on integrating Zigbee wireless devices into SignalK |
| 81 | +[SignalK Zigbee Sensors Tutorial](https://signalk.org/2025/signalk-zigbee-sensors) |
| 82 | + |
| 83 | +## Zigbee Motion Sensors |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | +A motion sensor in the outdoor cockpit area provides JSON data via MQTT. This is used within a Node-RED flow to switch the lights on for a period of time, subject to certain conditions. |
| 88 | + |
| 89 | +## Node-RED Flow for Motion Automation |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | +This Node-RED flow for motion-based control of the lights has several inputs for decision-making: |
| 94 | + |
| 95 | +- **CockpitMotionSensor (MQTT IN Node):** receives status from the Zigbee motion sensor. |
| 96 | +- **environment.mode (day/night) (SignalK subscribe Node):** populated by the `signalk-derived-data` plugin (so the AND gate output can only be true at night). |
| 97 | +- **CockpitLights state (MQTT IN Node):** reports the state from the Shelly input (SW pin). If the lights are On, this is inverted before input to the AND gate, so the logic only triggers if the lights are Off. |
| 98 | + |
| 99 | +The AND gate output is only true if _motion is detected_, _it is night_, and _the lights are currently Off_. |
| 100 | +The **delay (90s) Node** then switches the lights off after 90 seconds. |
| 101 | + |
| 102 | +- **electrical.CockpitLights.state (SignalK send pathvalue Node):** sets a path so the lights’ state can be displayed. |
| 103 | +- **CockpitLights/rpc (MQTT OUT Node):** sends an “Output” message `ON` to the Shelly, which then pulses its output for 0.1 seconds (simulating a button press). |
| 104 | + |
| 105 | +## Node-RED Flow for Zigbee Tap Button |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | +- **zigbee2mqtt/CockpitSwitch (MQTT IN Node):** receives the button action (e.g., tap). |
| 110 | +- **Extract contact payload:** parses the JSON payload. |
| 111 | +- **Switch Node:** has three outputs (tap, double tap, hold). |
| 112 | +- **Set msg.payload:** formats the payload for the MQTT RPC message. |
| 113 | + |
| 114 | +## Summary |
| 115 | + |
| 116 | +I was able to retain the existing Hella Marine dimmer modules and wall switch buttons. With the addition of a Shelly module, a Zigbee wireless motion detector, and a Zigbee wall button integrated into SignalK, I significantly extended the system’s functionality—introducing a level of intelligent boat automation for motion-controlled lighting. |
0 commit comments