How can i check if a bulb turn on by regular switch?

Hi Forum,

I m new to home assistant and node-red. I have in a room a regular switch and a smart bulb. The bulb is programmed by "behavior on power" to on. Is it possible to become a payload "on" when i switch with a regular switch the power on? I want to change after power on the kelvin and brightness depending on sunset.

Thx a lot for your help.
Best Sko

// PS: I m using Home Assistant, zigbee2mqtt, raspberry pi 4, sonoff usb stick.

If the regular switch is off, does that mean there is no power to the smart bulb and it's not connected to zigbee?

Does it send some sort of status message - "Hi, I'm online" or "Power: on"?

Thx for your replay. Yes when the regular switch is off there is no power to the smart bulb. I tried "event state" and "trigger state" with the bulb inside and connected to a debug node with all infos on. But I dont get any message. Is there a way to get a message with an other node? Its a tradfri bulb, perhaps they dont send any messages when they are turned on by "behavior on power"?

I don't have Tradfri or Home assistant and my zigbee hub is stuck in the drawer because I don't know how to integrate it. So I don't know how they work together.

With a "normal" network, Wifi and ethernet, there are several ways I can tell when a device connects.
The slowest and so least satisfactory way is for Node-red to periodically send a message which rwquires a response, like ping.

There must be an equivalent ability with zigbee but I am sorry I have no idea what it is.

Ok thx for your reply :slight_smile:

My zigbee lights send a message as soon as they are switch on so you could use this to send the required color_temp & brightness command. If you connect a debug node to an MQTT in node with the relevant topic you should be able to check your light

Install mqttexplorer in a PC on the network, connect to your mqtt broker and see what topics the bulb publishes when it is switched on. Then switch it off and see what you get. There may be an Online/Offline state there somewhere.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.