Using sensor attributes in automation - Not working

Hi Guys,

I have a Xiaomi light sensor which has a number of additional attributes, as do most of the Xiaomi Sensors.

Screen Shot 2021-01-18 at 21.26.40

So I thought that I could use the ‘Dark’ attribute as a condition for my automation like so, but it doesn’t appear to work??

Screen Shot 2021-01-18 at 21.29.17

Could someone tell me what I’m doing wrong? I know I can simply use the numeric state, but using the dark true attribute seems like a more simple and elegant solution.

That’s a bug in the automation editor, somone already posted a feature request as far as I know. The automation editor automatically adds quotes around truey which makes it a string instead of a boolean and then the trigger fails.the only way around this currently is editing the automation in yaml and put it outside of automations.yaml, where the automation editor doesn’t apply automatic formating of the code.

Thanks, @Burningstone I was wondering if this was a bug, glad it wasn’t me going mad. Assume I could create a template sensor and extract the attribute that way, but it would be great to have this working in the automation UI. but I’ll just stick to the numeric state for now.