Smart Home: Automated zonal lights with Aqara FP2, Samotech Zigbee Dimmers, and Node-Red

January 4, 2025 0 By addshore

At some point in 2024 I bought an Aqara FP2 human presence sensor to try and automate the lights in my main open-plan living space. I have been running the installation for nearly a year, now have plans for the future and want to take this opportunity to do a quick write-up on how I have things configured, and how they have been working.

The room

Firstly, a little introduction to the space that I’m playing with…

It’s a kitchen, dinning, living space, with a main single entrance door, as well as large opening bifold doors to the back (both highlighted with red lines). The main flow of people in and out is indicated by the orange arrow on the right, which comes through the main single entrance door.

In this space there are 4 different lighting circuits, which I will call sofa, kitchen, dinning, and living, and there are 2 different sets of light switches.

Light switch A, which is by the main entrance, is a 4 gang set of rocker switches, while light switch B is a 4 gang set of dimmable rotary switches.

An interesting part of this light switch setup is that one switch on panel A is actually for the hallway, and thus the only switch to turn on and off the sofa lights is on panel B. (Kind of annoying if you want to turn all the lights on at once.

So the room is set up with 3 lots of 2 way dimmable switched lights, and a single circuit of dimmable lights for the sofa section.

Aqara FP2 setup

So, firstly, you can pick one of these sensors on Amazon for around £57 right now (about half the cost when I got mine, but also mine was gifted to me!), or £70 direct from Aqara? But if you’re thinking of getting one, you might want to read my final thoughts at the end of this post first!

The sensor uses millimeter-wave radar to detect the presence of people, and has zone positioning and multi-person detection capabilities, and a built-in light sensor, and magnetic mount (that you can also of course mount in other ways.

Throughout my experimenting I left the sensors magnetically connected to a radiator that was fortunately in the corner of my room near the sofa. This seemed to give it a good overall view of the room.

Setup within the app was easy, and I won’t cover this really, but I will show off what the zonal configuration ended up looking like for my room. (Sorry, it’s rotated 90 degrees compared with the previous images).

The mobile app allows you to define zones on a 14×14 grid, and you can easily do this by walking around the space, seeing where you are detected, and then drawing a zone in that area.

I have the sensor mounted in the corner of the room, which is not the recommended situation, but has worked well enough for the past months.

Entrances and exits appear to be key in terms of getting some of the presence detection to kick off speedily.

The TV in the room seemed to act as a fairly big reflector, hence it is covered with a special type of zone marking it as an interference zone (so the sensor can ignore some detections?).

While walking through the main door, to the far end of the room and back again, the visualization in the app looks something like this…

I added the sensor to home assistant with ease using the Home kit integration. Each defined zone appears as its own sensor, with its own state, as well as a light level sensor and another presence sensor for the whole space.

Samotech Zigbee Dimmers

I really hated the idea of changing the aesthetic of my light switches, and also wanted to follow the rule of smart homes, where the smart thing should not ultimately end up dumber than it started (particularly if some of the smarts are broken).

The current switches look something like this… (shocker, I forgot to take nice quality images 8 months ago before changing everything)

After a lot of searching I found Samotech which sell a whole range of dimmer switch options with the same visual appearance as the switches already in my UK home, and likely the same as every other UK home.

Install 1 (single module)

I started off with a single dimmer module (no Samotech faceplate) to try things out, and I installed this on the simple sofa circuit, which was only a 1 way dimmable circuit. (Bought from Amazon for £36.99 as I wanted it quickly!)

Installation was a little tight on my existing faceplate, as the Samotech module seemed to be a few mm wider than my existing click switches. The click switches also have a slight indent to allow for the edge screw holes o the faceplate. This is likely only an issue with 4 gang and 2 gang switches.

With a little bit of sanding and filing I managed to get the module in and all wired up!

I hooked it up to home assistant as a simple switched zigbee device, and tada, i could turn the sofa lights on and off without having to walk to the corner of the room.

And appearance wise, nothing looked or felt different. The switch module still worked as a basic dimmer if you went over and pressed or twisted it, and I had pressed the same click knob back on top of it!

In the coming weeks while playing around I discovered the major downside of using my old faceplate! It hides the 2 buttons on the dimmer module which are required for some configuration and also resetting the device if you want to. (This is actually a change going into the V2 module, as the V1 module allows you to use the knob for these interactions)

Install 2 (4 gang with faceplate)

Being generally happy with the module, but discovering an annoyance with using my old faceplate, I bought another whole 4 gang set, including faceplate from Samotech for £112.99 in April 2024 (now £114.98 on backorder)

This setup has a magnetic faceplate (with the white plastic appearance), in the front of the actual plastic faceplate (which provides access holes to the various buttons and led for each module).

Cramming everything into the same sized back box was a little bit of an issue, despite the modules themselves being essentially the same size, but the previous click faceplate seemed to be designed with some extra space (a few mm) being provided recessed within the plate itself, vs the Samotech plate which is essentially flat.

Due to the cramming the faceplate doesn’t fit totally flush to the wall, and also generally doesn’t seem to quite cover the same amount of space, hence being able to see the cut-out when looking at it from above.

To complete the 2 way circuits, I also had to replace the regular toggle switches in the hallway with retractive ones, per the Samotech manual, and wire everything up appropriately.

I’m not super happy with the retractive switches, and would much rather them be toggle switches.

It turns out Samotech now offer compatibility with on/off switches, however you need to specify this by contacting them when ordering modules. They also allow you to return already purchased modules to have this enabled. (See the description of the product on their site)

Adding all the smart dimmers to home assistant worked like a charm, and I could now turn them all on and off with a single click in the app in my custom dashboard.

Which is powered by the following code…

type: entities
entities:
  - entity: light.0x187a3efffe39934d
  - entity: light.0x187a3efffe397d6b
  - entity: light.0x187a3efffe397925
  - entity: light.0x187a3efffe397d5a
  - entity: light.garden_light
footer:
  type: buttons
  entities:
    - entity: scene.living_room_lights_off
      show_icon: true
      show_name: true
    - entity: scene.living_room_lights
      show_icon: true
      show_name: true
    - entity: scene.living_room_lights_50
      show_icon: true
      show_name: trueCode language: CSS (css)

Home assistant & Node-Red

I decided to head straight to Node-Red for the automation of this 4 zone.

After importing all the entity nodes for the lights and sensors so that I could easily copy them around, I created an initial automation with automatic brightness adjusting (thanks to some JS code), as well as per zone light automation based on zonal presence.

Certainly not perfect, but a nice start.

Entering into the room would turn all lights on, and moving in and out of individual zones would then turn lights off behind you. If presence in the whole room was gone, then all lights could be turned off.

With this automation, you can still use the light switches to turn the lights on before you enter the room, and you can also use the switches to turn lights off when you are in the room, as long as you don’t then start changing between zones (as this would trigger that zone to turn on).

After some months of living with this situation, I expanded the automations, making use of an Aqara cube T1 Pro that I had lying around to provide a few overrides to the overall automation.

These were:

  1. Individual zones : A slightly modified version of what you see above, which circuits turning on and off based on the zonal presence
  2. Whole room: A simplified automation where all lights are either on or off based on whole room presence
  3. Not used
  4. No Automation: All automation stops, the room returns to requiring you to turn lights on and off with switched (ewww)
  5. Lights off, automation off: Turn the lights off, and don’t automate anything (good for watching movies)
  6. Lights on, automation off: Turn the light on, and don’t automate anything

It’s a bit hard to look at and follow, but it looks something like this…

I also added some different brightness adjustments based on where in the room the lights are, so during the daytime, the kitchen lights will often be brighter than the other lights, as they cover the darker area of the room. The same brightness adjustment may also decide that the sun is too bright, and to not turn the lights on at all when presence is detected.

It’s probably buggy, but the code behind the “Lux to Pct 500,100” node looks liek this…

// Input lux value
var lux = parseInt(msg.payload);

// Calculate the percentage of brightness inversely proportional to lux
var brightnessPercentage = 0;

if (lux >= 500) {
    // Too light outside, so off
    brightnessPercentage = 0
} else if (lux > 100) {
    // Daytime, but not that light, so full brightness
    brightnessPercentage = 100
} else {
    // Less than 100 lux, so we can probably live with dimmer lights?
    brightnessPercentage = 50
}

// Output the brightness percentage
msg.payload = brightnessPercentage;
return msg;Code language: JavaScript (javascript)

Thoughts & what’s next

I had this setup running all through 2024 and it was rather uneventful (which is a good thing).

I really do enjoy being able to walk in and out of this room, and not have to turn on or off 3 lightswitches, only then to realize the sofa lights are also on, and need to walk to the other side of the room for the 4th light switch.

A few things of note would be…

Powercut and dimmer resets

I did have a power cut which seemingly caused 2 of the smart dimmers to reset themselves, loosing their connection to home assistant etc and causing the automation to break. The manual for the dimmers says that if you power cycle them 5 times, this can be used to factory reset them, so I wonder if this happened during the power cut?

Retractive vs on/off switches

I have another room with a 4 gang set of dimmers, so I will likely buy another 4 gang samotech dimmer set in the future, and request that the on/off feature be enabled, rather than needing retractive switches. I’ll swap that one into this open living space, before returning the set that are currently there to also have this feature enabled.

That means in the future, if I moved or wanted to take the 4 gang smarts out, I wouldnt have to rewrie 2 switch panels to do so, and I also don’t need to buy any more retractive switches for the rest of the house.

Aqara cube T1 Pro slowness

I setup the cube for use in the last large automation, and unfortunatly it doesnt seem to be that reliable in reporting which side it is on. Its rather easy to swap it from side 1 to 6, and not have this be reflected in Home assistant. I currently think this is just a firmware issue on the cube, where it will not detect motion and thus likely stay asleep.

This was also the main complaint from guests and friends, which was that the cube never reacted…

Aqara FP2 coverage

I was very happy with how easy the sensor was to setup, and very happy with how it generally worked, however I dont think a single sensor is enough to cover this room.

At half the price, and also with zones, I might next try purchasing a Everything Presence Lite, or perhaps an Everything Presence One

I’d likely locate these on top of my fridge so that each one focuses on half of the room, and also an entrance each.

This will likely also serve as a more astehtically pleasing mounting location.

Aqara FP2 zone overlaps

I would have very much enjoyed being able to define overlapping zones, but the Aqara app currently can only use a single tile for a sinlge zone.

With overlapping zones, I would be able to iron out some issues where if you are between the boundry of the kitchen and dining area, you perhaps want both lights to stay on, but if the sensor says you are only in the dinning zone, then the kitchen light would turn off…

Zonal switching times

I already have a slow fade off when you leave a zone or a room, just incase the sensor accidently looses you, or you hide behind another person etc which can sometimes cause an issue (probably improved by having 2 sensors in the future)

I can see how having sensors mounted in the ceilling itself would also help avoid this issue…

Node-Red vs HA Automations

I couldnt imagine managing the complex automation without Node-Red. Trying to quickly protoype, adjust things across what is essentially multiple automations, all within the existing home assistant automation stack would liekly be so painfull that I’d just give up.

I do still use Home Assistant automations for basic things, but Node-RED is really quite simple and has been entirely stable throughout the year running on my dinky little Raspberry Pi.