That’s correct. The reason I hacked the lamp is because I wanted to have a “small” device in my home IT equipment cabinet and not a lamp switching on/off.
The whole solution? It went quite straight forward by just following the instructions in Home Assistant and zigbee2mqtt sites in other words, there is no real added value in publishing my solution because I would just copy&paste what is on those sites/pages.
I have found that using this approach you can actually control the lamps with an old-school light sensor. We already have an outdoor light sensor that turns an outdoor lamp on and off. Now by adding a Hue bulb (I use a mix of Hue and Trådfri) in the outdoor lamp, my Pi script can monitor the reachable state of the lamp. It is unreachable most of the time, but when the old sensor turns it on, it becomes reachable. I then use the script to control two more lamps. Thus, an old analog sensor controls 3 Hue/Trådfri lamps without any wireless sensor!
I have one question. How often does HA monitor the on state of the hacked lamp? I use three seconds as this delay is no problem, but I wonder how often you can ping the gateway/bridge without problems.
Actually used this approach to steer a Nexa in-wall switch (433MHz) vía rfxcom.
I’m not sure I follow you. To my understanding, rules are state driven that is, switch states are not monitored but when it changes it triggers a rule. On the other hand you may have, for instance a thermometer. If you create a rule to trigger something at certain temperature then this rule is to be triggered every time a new temperature value is received. That’s my understanding.
In a few words, how does CC2531 with zigbee2mqtt work? Can you make it respond to any zigbee remote control or dimmer (eg. Hue and IKEA), and can you see which remote made the request? In other words, does it work as a kind of bridge or gateway so that you can respond to the zigbee commands you grabbed and turn the lights on and off etc?
I have a CC2531, and a Tradfri motion sensor.
What I did to notify HA on motion activities is this:
Pressing the pair button (in the middle) 4 times in a row. The red light on the front side should flash a few times and the turn off. After a few seconds it turns back on and pulsate. When connected, the light turns off.
I’ve got the Tradfri as “unsupported” in the zigbee2mqtt map… Partial success so far
I have connected my ikea motion sensors with zigbee2mqtt instead of using the ikea hub, and I can use the motion sensor standalone in HA. Why all this hard work?
The hacking is more fun! Lol. I bought 3 Tradfri motion sensors, 1 gateway and 3 GU10 bulbs. The GU10 bulbs are super easy to extract the zigbee module, add a 3.3V DC-DC module and voila…cheap motion sensors. Thanks for this awesome hack!
The sensor is connected in HA thru zigbee2mqtt but the sensor state stays at N/A
No movement is detected… I can see the battery level. What am I doing wrong?
I like the idea!
Here my solution without soldering: I used the script in the example and added the virtual motion detector. When it detects motion, I immediately turn off the light. In my case I wanted the light on in the evening, so I added a condition that it only turns it off when the sun is set.
I also am having issues with this. I bought the CC2531 as a “Sonoff stick” but not sure if I need to reflash it. It seems to work fine so far wtih my existing devices, but I cannot get the TRADFRI motion sensor to report anything but the battery level.
I tried resetting the device, tried pairing through a TRADFRI outlet instead of direct to coordinator, I even started a zigbee2mqtt setup from scratch and still, no data.
The motion sensor is on version 20190308, but I don’t know what firmware is my stick running. Do I need to reflash the CC2531 to make this work properly?
You need to reflash the stick with the latest firmware. If it is still on the firmware from Sonoff, that one is too old for the Tradfri devices to pair.