ha-sun2 icon indicating copy to clipboard operation
ha-sun2 copied to clipboard

Automation based on rising attribute fails

Open randomhammer opened this issue 2 years ago • 1 comments

I have a really strange problem. I have an integration that has a condition that checks the rising attribute of the sun_phase sensor for rising is false. For some reason it always fails. Below is a capture of the condition: Screen Shot 2022-08-24 at 8 26 09 PM

And here is a capture of the current state of the sensor:

Screen Shot 2022-08-24 at 8 26 23 PM

I must missing something simple, but the condition fails and the automation never fires, even though the attribute rising is false.

Any clue what I am doing wrong?

randomhammer avatar Aug 25 '22 01:08 randomhammer

I think you're being bit by a limitation in the UI. It only accepts strings for values, but the attribute is a boolean, and false as a string does not match false as a boolean.

You can work around this limitation by editing that condition in YAML mode. Then change the line:

state: "false"

to:

state: false

pnbruckner avatar Aug 25 '22 13:08 pnbruckner

Ah, this was the solution I needed.

karaminder avatar Apr 25 '23 17:04 karaminder