Issue with "numeric state below" automation (also the opposite result

Hi,

I couldn’t find a similar issue so created this one :slight_smile:

I created two automations to automatically turn off or on a hue smart plug based on the brightness of a light group.

The “numeric state above” works as I expected, but the “numeric state below” doesn’t. When the brightness goes below the value the smart plug is switched off (as expected). But after i adjust the brightness (further down or up (but still below the given value), the smart plug is switched on. I added a condition for this automation that smart plug needs to switched on, but that didn’t help.

The wrong action doesn’t show up in traces for the automation, but does show up in the logbook.

What am I missing here?

alias: Turn off bank on lower woonkamer brightness
description: ""
trigger:
  - platform: numeric_state
    entity_id: light.woonkamer
    attribute: brightness
    below: 121
condition:
  - condition: device
    type: is_on
    device_id: 70522932d926e527bf3a97438b5fee6d
    entity_id: light.bank_smart_plug
    domain: light
action:
  - type: turn_off
    device_id: 70522932d926e527bf3a97438b5fee6d
    entity_id: light.bank_smart_plug
    domain: light
mode: single

Add an id to your automation (I use this tool) and the traces should show up. So:

alias: Turn off...
id: 8fc56351-7a97-405b-9cb8-5f4ee707b114
description: ""

I wonder if the brightness is “noisy” with intermittent high values or unavailable? It might be worth making a template sensor for the brightness so you can easily see what it’s doing with a history trace.

If a light’s state is on and Home Assistant sends a “turn_off” command but the physical light fails to promptly acknowledge receipt of the command, Home Assistant will immediately set the light’s state back to on.

This is what might be happening here because if you look at the log, the two messages are just 2 seconds apart.

Thanks for the quick and helpful responses!

I added the ID to the automation and went further troubleshooting. I changed the trigger to one specific light instead of the whole group, but that didn’t solve the issue.

In the system log i noticed an error Request failed: attribute (.dimming) is not supported by resource and that was because the hue plug was within the same group and isn’t able to dim (obviously). I moved the hue plug to another room and now the automation is working as desired (and expected).

I had the hue plug in the same room, so my hue dimmer was able to turn the whole group on/off, but now with HASS i can automate to hue plug based on the brightness.

Which one of the entities, in the automation you posted above, is a group? Do you mean light.bank_smart_plug?

The issue wasn’t within the automation itself, but within the fact that the bank_smart_plug was within the group in which i changed the brightness (light.woonkamer). I think the dimming error made the bank_smart_plug switch back on.

Before the “woonkamer” group contained the following: Woonkamer2, Woonkamer1, Hue go, Woonkamer3, bank_smart_plug

The automation had the trigger on the brightness for the whole “woonkamer” group (light.woonkamer), but i changed it to one specific light within that group.

alias: Turn off bank on lower woonkamer brightness
description: ""
trigger:
  - platform: numeric_state
    entity_id: light.woonkamer1
    attribute: brightness
    below: 121
condition:
  - condition: device
    type: is_on
    device_id: 70522932d926e527bf3a97438b5fee6d
    entity_id: light.bank_smart_plug
    domain: light
action:
  - type: turn_off
    device_id: 70522932d926e527bf3a97438b5fee6d
    entity_id: light.bank_smart_plug
    domain: light
mode: single

What do you mean by “dimming error” and how could it turn on light.bank_smart_plug if there’s no service call to turn it on?

The error i posted before :slight_smile:

Request failed: attribute (.dimming) is not supported by resource

So timewindow: I lowered the brightness for “light.woonkamer” so bank_smart_plug was turned off. I waited and changed the brightness for “light.woonkamer” (didn’t matter further down or minimum up (still under the value which was set: 121), which resulted in bank_smart_plug turned on.

I changed the room for the bank_smart_plug within the hue app, so it isn’t part of “light.woonkamer” anymore and after that the automation is working as expected.

I see. You had created a Light Group and one of its members wasn’t a light but a switch which, of course, has no dimming ability. Home Assistant created the group but failed to use it in a trigger that monitored each group member’s brightness.