LIFX Developer Zone

Home Assistant: LIFX Switch

Hi Everyone!
I use Home Assistant for my automation.
I have two LIFX Switches but they don’t show up in Home Assistant as a device/entity.
Actually, I use Node-RED currently which I think must use a LAN API?

Is there some way I can control the LIFX Switch using Home Assistant/Node-RED?

I have this working with Home Assistant and Node-RED using node-red-contrib-lifx-api The commands are all via https but I can track state and setup switches in HA to control each switch. Its not lan control so I am reliant on LIFX cloud control

Hey Lebowski9000!
Thanks so much for this, I don’t know how I missed that.
I can now see the switch in Node-RED and can control the whole switch quite easily, however, I haven’t been able to figure out how to control each relay.
Are you able to show me how you have been able to control each relay? I have used the labels of each relay, however, that didn’t work (I tested using a label from a light which worked fine so I know that the token etc works)

This should help

label:Front Switch|0
label:Front Switch|1
label:Front Switch|2
label:Front Switch|3

I found toggle is buggy so use on and off commands

I also use a timestamp to poll the states to make a sensor in Home Assistant so I can see the state.

I use this on the switch to read the on or off

I also use the custom Node RED component to make a switch inside node red with the trigger command automation for on and off to make Home Assistant control them.