Lights/LIFX integrated only via NodeRed

Hi,

For different reasons I want HomeAssistant to integrate with my LIFX devices only via NodeRed (node-red-contrib-node-lifx (node) - Node-RED). So far I have installed both HA/NodeRed companion and node-red-contrib-node-lifx.

I have also managed to created a button in HA that via NodeRed turns on one of my lamps.

Now my questions is how can I create a flow that lets NodeRed expose my lifx device as a light in HomeAssistant?

There are 2 options. You can create a template light entity and create the necessary sensor/select/number entities in NR using the companion integration.

Second would be to use mqtt. You could create an mqtt discovery message or manually create the mqtt entity in yaml.

FWIW I’ve used the HA integration for years and had no real issues with it. That node hasn’t been updated in over 5 years. Recently there has been been updates to nodered that have caused problems in old nodes, that’s something you should consider as well.

Edit: The update problems are applicable to the HA addon. If you run nodered separately, you can control the module versions to avoid problem seen in the addon version.

Thankyou very much for your reply!

If I would choose this path – would that include NodeRed or would this path completely omit NodeRed?

I would use the manual mqtt. That is only because I’ve already done it a number of times and I’m most familiar with that method. Not because I see a specific advantage.

Thanks for input!

The project provides this example file: node-red-contrib-node-lifx/example/mqtt.js at 0f0f8a24db2fddea54fb080aa1ca918974b108b8 · ristomatti/node-red-contrib-node-lifx · GitHub – could you just point me in some direction for a way to run this script?

That is not really applicable to HA. I assume that the lifx nodes provide a JSON output when changes are made to the light. Connect that directly to an mqtt out node and choose a topic for the light.

In configuration.yaml add your mqtt entity and use the path you chose for the light.

# Example configuration.yaml entry
mqtt:
  - light:
      schema: json
      name: mqtt_json_light_1
      state_topic: "home/rgb1"
      command_topic: "home/rgb1/set"
      brightness: true
      supported_color_modes: ["rgb"]

Here is an example from my own set up. This is what is sent into an mqtt out.

{
  "id": "xx:xx:xx:xx:xx:xx",
  "confidence": "100",
  "name": "Michael",
  "type": "KNOWN_MAC",
  "retained": "false",
  "timestamp": "Fri Mar 28 2025 21:31:25 GMT+0000 (GMT)",
  "version": "0.2.200"
}

That is sent to the topic monitor/rpi/michael In configuration.yaml I have

mqtt:
      
  sensor:
    - name: "Michael 2ndFl"
      state_topic: monitor/rpi/michael
      value_template: "{{ value_json.confidence }}"
      unit_of_measurement: "%"
      unique_id: e9464d9e-894c-4452-8436-fa4e423ce6d5

To access the different parts of json, you start wit value_json and then the json path. If I wanted the timestamp, value_json.timestamp or the type value_json.type etc

Tip in vs code you can right click and choose generate uuid to get a value for the unique id. The unique id enables editing the entities setting from ha.