Skip to content

Numeric state condition in automations reads unintuitive values in attribute #25136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
3 of 4 tasks
TX9G9qBxid opened this issue Apr 22, 2025 · 0 comments
Open
3 of 4 tasks

Comments

@TX9G9qBxid
Copy link

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.
  • I have tried reproducing the issue in safe mode to rule out problems with unsupported custom resources.

Describe the issue you are experiencing

Info for context:
Some of my Zigbee bulbs reports turning on with 0% brightness several times a week. I am unable to figure out why, but instead try to fix the problem with an automation turning it off when the bulb turns on with 0% brightness.

When configuring a condition in the automation like this:

condition: numeric_state
entity_id: light.[bulbname]
below: 1
attribute: brightness

... the condition does not pass, thus not triggering the automation

Changing the condition values to above e.g. 101 and below 255 results in the condition triggering when the brightness of the bulb is at e.g. 80%. Since brightness only spans 0-100% I assume the value in the condition is not read in % but rather in the value 0-254. This is further supported by reading the ZHA output from the bulb which reports level 254 when the bulb is at 100%:

Image

Describe the behavior you expected

Since the attribute I am targeting is Brightness, I expect the value on the frontend to be consistent across the UI.

The value representation in the UI should be in % as this is the common value denominator.

Steps to reproduce the issue

  1. Create automation with a Brightness condition for a Zigbee light.
  2. Insert expected value in %, but realize the value is not in percent.

Full automation YAML:
alias: Li-Oddbehavior-Location
description: ""
triggers:

  • trigger: state
    entity_id:
    • light.[REDACTED-bulbname]
      attribute: brightness
      conditions:
  • condition: numeric_state
    entity_id: light.[REDACTED-bulbname]
    below: 1
    attribute: brightness
    actions:
  • action: light.turn_off
    metadata: {}
    data: {}
    target:
    entity_id:
    - light.[REDACTED-bulbname]
    mode: single

What version of Home Assistant Core has the issue?

2025.4.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue?

Firefox 137.0

Which operating system are you using to run this browser?

Ubuntu 24.04

State of relevant entities

Problem-relevant frontend configuration

Javascript errors shown in your browser console/inspector

Additional information

No response

@TX9G9qBxid TX9G9qBxid changed the title Numeric state condition in automations reads unintuitive values Numeric state condition in automations reads unintuitive values in attribute Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant