Motion Light (LEDS), Snapshot

Hi Guys,

I have some dumb RGBCCT 5 in 1 led lights in my kitchen. These are either running a slow rainbow effect or completely OFF. They are run using the ESPThings controller ET-AL01 with ESP32 D1.
The trigger device is an Aqara motion sensor.

I had an automation that worked to a degree. If the kitchen leds were running the “slow rainbow” colour change effect, and someone walked into the kitchen the motion sensor would detect this take a snapshot of the leds and turn the leds to full white 6500K for the duration that someone was presence/motion was detected.
When no motion was detected, it would use the snapshot to return to the leds state prior to the motion detection.

This was all done a couple of years ago and obviously things have possible changed since then within HA that I’ve missed.
What I’m finding now is that, if there are NO leds on in the kitchen, NO rainbow effect, If I walk into the kitchen the motion sensor detects and turns the leds ON to full white, but after no motion is detected instead of the leds going back to NO leds being on as prior to the detection, they are switching from the full white to a pinky/red after.
It used to work as;
Current state of leds, if motion is detected, create snapshot/scene, Full White 6500k until No motion, use snapshot/scene to restore leds state.
But now the way it’s operating is:Current state of leds, if motion is detected, create snapshot/scene, Full White 6500k until No motion, leds then goto pinky red?

Here’s what I have;

alias: kitchen leds catch
description: ""
triggers:
  - type: motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - data:
      scene_id: leds_before_motion
      snapshot_entities:
        - light.kitchen_colour_leds_1
    action: scene.create
  - data:
      kelvin: 6500
      brightness: 255
      effect: None
    target:
      entity_id:
        - light.kitchen_colour_leds_1
    action: light.turn_on
mode: restart

alias: kitchen leds reload
description: ""
triggers:
  - type: no_motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - action: scene.turn_on
    data: {}
    target:
      entity_id: scene.leds_before_motion
mode: restart

Does anyone have any thoughts?

Hi Guys,

Okay so I’ve gone back and followed Scenes On Steroids video here;Scenes - Home Assistant

So here’s what I now have, but this now does nothing?
The motion detecter detects, but no leds on full white for the duration of the detection time?

alias: New Motion
description: ""
triggers:
  - type: motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
    id: LED Motion
  - type: no_motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - if:
      - condition: trigger
        id:
          - LED Motion
    then:
      - action: scene.create
        data:
          snapshot_entities:
            - light.kitchen_colour_leds_1
          scene_id: New LEDs Before
      - action: light.turn_on
        data:
          kelvin: 6500
          brightness_pct: 100
        target:
          entity_id: light.kitchen_colour_leds_1
    else:
      - action: scene.turn_on
        target:
          entity_id: scene.new_leds_before
        data: {}
mode: single

Can someone offer some help please?

Hi Guys,

I’m trying all-sorts of variables with this, but still cant get it working.
Weather the Kitchen leds strips are illuminated with any colour or not illuminate, the motion sensor will detect movement, but I can’t get the leds to illuminate to full white brightness when motion is detected?

alias: New Motion
description: ""
triggers:
  - type: motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
    id: LED Motion
  - type: no_motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - if:
      - condition: trigger
        id:
          - LED Motion
    then:
      - action: scene.create
        data:
          snapshot_entities:
            - light.kitchen_colour_leds_1
          scene_id: New LEDs Before
      - data:
          kelvin: 6500
          brightness_pct: 100
        target:
          entity_id: light.kitchen_colour_leds_1
        action: light.turn_on
    else:
      - action: scene.apply
        data: {}
        entity_id: scene.new_leds_before
mode: single

I’d be really gratefull for some help.

D.

Hi Guys,

Sorry to bump my own post, but I’m strugglling to get this working and under the impression that creating a snapshot on the fly is no longer possible.

Can someone help understand how or why I can’t get this working?

I’ve tried following the documentation and the video as best I can from the following, albeit a 2year old video and I guess 2 year old documentation.

I’m trying to use an Aqara motion sensor to create a snapshot of the current state of my Kitchen LED strips before motion is sensed. The kitchen lLED’s generally run a Slow Rainbow effect
When motion is detected the LED’s goto full brightness White, until no motion is detected, then revert back to their original state from the snapshot taken on-the-fly.
Currently when I have No effect running (ie slow rainbow), on the LED’s I can see that motion is detected (I can see this is working in the device going from Clear to Detected), but I don’t get any White LED’s come On.
If I’m running the Slow Rainbow effect, again motion is detected, but I get no White LEDS and the Slow Rainbow effect continues.

Can someone please offer some advice?

alias: New Motion
description: ""
triggers:
  - type: motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
    id: LED Motion
  - type: no_motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - if:
      - condition: trigger
        id:
          - LED Motion
    then:
      - action: scene.create
        data:
          snapshot_entities:
            - light.kitchen_colour_leds_1
          scene_id: New LEDs Before
      - action: light.turn_on
        data:
          kelvin: 6500
          brightness: 255
        target:
          entity_id: light.kitchen_colour_leds_1
    else:
      - action: scene.turn_on
        target:
          entity_id: scene.new_leds_before
        data: {}
mode: single

I’m also using the ESPThings ET-AL01 LED Driver/Controller running the following;

esphome:
  name: kitchen-colour-leds-1
  friendly_name: Kitchen-colour-leds-1

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxx"

ota:
  - platform: esphome
    password: "xxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kitchen-Colour-Leds-1"
    password: "xxxxxx"

captive_portal:

sensor:
  - platform: wifi_signal
    name: "WiFi Signal $devicename"
    update_interval: 60s
output:
  - platform: ledc
    pin: 26
    frequency: 25000Hz
    id: ledc_cw
  - platform: ledc
    pin: 18
    frequency: 25000Hz
    id: ledc_ww
  - platform: ledc
    pin: 19
    frequency: 25000Hz
    id: ledc_r
  - platform: ledc
    pin: 23
    frequency: 25000Hz
    id: ledc_g
  - platform: ledc
    pin: 05
    frequency: 25000Hz
    id: ledc_b
    
light:
  - platform: rgbww
    name: "kitchen colour leds 1"
    id: kcl1
    warm_white: ledc_ww
    cold_white: ledc_cw
    red: ledc_r
    green: ledc_g
    blue: ledc_b
    cold_white_color_temperature: 5000K
    warm_white_color_temperature: 3000K
    color_interlock: true
    effects:
      - lambda:
          name: Slow Rainbow
          update_interval: 16s
          lambda: |-
            static int state = 0;
            auto call = id(kcl1).turn_on();
            call.set_transition_length(15000);
            if (state == 0) {
              call.set_rgb(1.0, 0.0, 0.0);
            } else if (state == 1) {
              call.set_rgb(1.0, 0.5, 0.0);
            } else if (state == 2) {
              call.set_rgb(1.0, 1.0, 0.0);
            } else if (state == 3) {
              call.set_rgb(0.5, 1.0, 0.0);
            } else if (state == 4) {
              call.set_rgb(0.0, 1.0, 0.0);
            } else if (state == 5) {
              call.set_rgb(0.0, 1.0, 0.5);
            } else if (state == 6) {
              call.set_rgb(0.0, 1.0, 1.0);
            } else if (state == 7) {
              call.set_rgb(0.0, 0.5, 1.0);
            } else if (state == 8) {
              call.set_rgb(0.0, 0.0, 1.0);
            } else if (state == 9) {
              call.set_rgb(0.5, 0.0, 1.0);
            } else if (state == 10) {
              call.set_rgb(1.0, 0.0, 1.0);
            } else if (state == 11) {
              call.set_rgb(1.0, 0.0, 0.5);
            }
            call.perform();
            state++;
            if (state == 12)
              state = 0;
             
      - strobe:
      - strobe:
          name: Strobe Effect With Custom Values
          colors:
            - state: true
              brightness: 100%
              red: 100%
              green: 90%
              blue: 0%
              duration: 500ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms

      - flicker:
      - flicker:
          name: Flicker Effect With Custom Values
          alpha: 95%
          intensity: 10.5%
                  
                  
      - random:
      - random:
          name: Random Effect With Custom Values
          transition_length: 5s
          update_interval: 7s


              
      - pulse:
      - pulse:
          name: "Fast Pulse"
          transition_length: 0.5s
          update_interval: 0.5s
      - pulse:
          name: "Slow Pulse"
          # transition_length: 1s      # defaults to 1s
          update_interval: 2s

Can anyone offer anny assistance please?

Hi guys,

I have HAOS installed in Virtualbox on and old 2009 Always ON Imac
Running Home Assistant OS 13.2.
Conbee11

I’ve had problems with this before and alway thought this was a poor Wi-Fi signal, but now I don’t know if this is a sketch issue, a Wi Fi issue (currently ay 83dbm), or something else?

Okay, I reverted back to my original setup which I’ll document below. This problem has only recently been found as I only really use these LEDs during the darker winter months.

I gone back and read through all the updates for 2024, butt still can’t find whats causing my problem. I’m sure I’ve overlooked something.

What should happen is when motion is detected by the Aqara motion sensor, the kitchen LEDs which are normally on a slow rainbow effect change to full brightness CW, then when no motion is detected revert back from a snapshot to their original state/colour and effect.

What is happening is, motion is detected, the LEDs change to full CW brightness, but when the snapshot is reloaded the LEDs revert back to a red light and no effect.

I’ve attempted and changed many things in an attempt to fix this but had no luck in doing so. I’ve also tried rewriting the automations and scene, due to the updates to automations and scenes over the last year possibly breaking the setup, but his ended up with the automation not working at-all. The LEDs wouldn’t change to full CW when motion was detected for example.

It seems to me that the LED “effect” with ESPHome isn’t being collected or reused with the snapshot?
Does anyone have any ideas what’s going on?
I’d be really grateful for some advice as I’m completely stumped.

Automation to detect motion, create snapshot, LEDs to Full CW

alias: kitchen leds catch
description: ""
triggers:
  - type: motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - data:
      scene_id: leds_before_motion
      snapshot_entities:
        - light.kitchen_colour_leds_1
    action: scene.create
  - data:
      kelvin: 6500
      brightness: 255
    target:
      entity_id:
        - light.kitchen_colour_leds_1
    action: light.turn_on
mode: restart

Scene to put the snapshot into and to be reloaded from after NO motion.

Automation to reload the snapshot from the above scene.

alias: kitchen leds reload
description: ""
triggers:
  - type: no_motion
    device_id: 55e691e9b1cb092f850de53663eb780c
    entity_id: ef1867600fa68c4a2acc25f499e294fb
    domain: binary_sensor
    trigger: device
conditions: []
actions:
  - action: scene.turn_on
    data: {}
    target:
      entity_id: scene.leds_before_motion
mode: restart

ESPHome LED Control Effects on ESPThings Analog Controller.

esphome:
  name: kitchen-colour-leds-1
  friendly_name: Kitchen-colour-leds-1

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxx"

ota:
  - platform: esphome
    password: "xxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kitchen-Colour-Leds-1"
    password: "xxxxxx"

captive_portal:

sensor:
  - platform: wifi_signal
    name: "WiFi Signal $devicename"
    update_interval: 60s
output:
  - platform: ledc
    pin: 26
    frequency: 25000Hz
    id: ledc_cw
  - platform: ledc
    pin: 18
    frequency: 25000Hz
    id: ledc_ww
  - platform: ledc
    pin: 19
    frequency: 25000Hz
    id: ledc_r
  - platform: ledc
    pin: 23
    frequency: 25000Hz
    id: ledc_g
  - platform: ledc
    pin: 05
    frequency: 25000Hz
    id: ledc_b
    
light:
  - platform: rgbww
    name: "kitchen colour leds 1"
    id: kcl1
    warm_white: ledc_ww
    cold_white: ledc_cw
    red: ledc_r
    green: ledc_g
    blue: ledc_b
    cold_white_color_temperature: 5000K
    warm_white_color_temperature: 3000K
    color_interlock: true
    effects:
      - lambda:
          name: Slow Rainbow
          update_interval: 16s
          lambda: |-
            static int state = 0;
            auto call = id(kcl1).turn_on();
            call.set_transition_length(15000);
            if (state == 0) {
              call.set_rgb(1.0, 0.0, 0.0);
            } else if (state == 1) {
              call.set_rgb(1.0, 0.5, 0.0);
            } else if (state == 2) {
              call.set_rgb(1.0, 1.0, 0.0);
            } else if (state == 3) {
              call.set_rgb(0.5, 1.0, 0.0);
            } else if (state == 4) {
              call.set_rgb(0.0, 1.0, 0.0);
            } else if (state == 5) {
              call.set_rgb(0.0, 1.0, 0.5);
            } else if (state == 6) {
              call.set_rgb(0.0, 1.0, 1.0);
            } else if (state == 7) {
              call.set_rgb(0.0, 0.5, 1.0);
            } else if (state == 8) {
              call.set_rgb(0.0, 0.0, 1.0);
            } else if (state == 9) {
              call.set_rgb(0.5, 0.0, 1.0);
            } else if (state == 10) {
              call.set_rgb(1.0, 0.0, 1.0);
            } else if (state == 11) {
              call.set_rgb(1.0, 0.0, 0.5);
            }
            call.perform();
            state++;
            if (state == 12)
              state = 0;
             
      - strobe:
      - strobe:
          name: Strobe Effect With Custom Values
          colors:
            - state: true
              brightness: 100%
              red: 100%
              green: 90%
              blue: 0%
              duration: 500ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms

      - flicker:
      - flicker:
          name: Flicker Effect With Custom Values
          alpha: 95%
          intensity: 10.5%
                  
                  
      - random:
      - random:
          name: Random Effect With Custom Values
          transition_length: 5s
          update_interval: 7s


              
      - pulse:
      - pulse:
          name: "Fast Pulse"
          transition_length: 0.5s
          update_interval: 0.5s
      - pulse:
          name: "Slow Pulse"
          # transition_length: 1s      # defaults to 1s
          update_interval: 2s