Motion colors inverted (clear=red, motion=green), Other bars to (safe=red?)

Since I switched to hassio all my motion binary sensor have inverted their color.

I now get a clear with red color bar and a motion with green color bar clicking one of my motion sensors in the ui to show the history (24h) :confused:

Besides that I enjoying hassio very much! :+1:

Although you did not say, I will assume you moved from a Home Assistant install to Hassio.
Did you have a custom Lovelace theme when you used HA ?
A custom theme may be able to accomplish this.

Yes - I’m coming from a python environment install to a hassio install.

I didn’t had any custom lovelace themes (not before, not after). Always went with the default one.

It’s weird because the color is really for every single motion sensor inverted…

still inverted - still weird :confused:

Same here.

1 Like

congratulations! :poop:

Is it a feature or a bug? :beetle:

Are you accidentally using esphome and having a binary sensor inverted? :face_with_monocle: But no… nothing to do with that…

New test with meteoalarm component:

image

I’m certainly save that safe shouldn’t be red - right? :roll_eyes:

1 Like

Same issue here. When my doors are closed (they are set up as binary sensors) the state in the GUI is correct (open/close icons, open icon is yellow), but in the history, open shows up as green and closed as red. That seems off …

I am running HA 0.91.2 as a manual setup on Raspbian.

Contribute to this issue here https://github.com/home-assistant/home-assistant/issues/24173 to let the dev’s know their is something wrong! Hope we get a fix soon :upside_down_face:

1 Like

Unfortunately the issue mentioned above has been closed, but this problem has still not been resolved - I’m on Home Assistant 0.106.6 and the colors are still wrong for binary sensors.

yea… some thing’s stay broken forever sadly :roll_eyes:

I am having the same issue except I am running in a virtual python environment. Did anyone ever resolve this?

image

I have this same problem on a fresh install of HassOS, updated to the latest HA 2012.12.1. Colors are inverted pretty much across the board on my all my ZWave sensors. Clear/unclear, safe/unsafe, open/closed… they’re all exactly the opposite of what you’d expect.

I see this has been an issue for quite a while now, and that the github issue linked above went stale and got auto-closed by the bot. That seems kind of crazy. Does anyone have any insight into why this has gone so stale? Is there some underlying code or logic problem that makes this non-trivial for the devs to address? Did anyone ever find a way to fix this with custom Lovelace themes?

@fabaff (member of home assistant) mentioned in the github issue:

There is no visual representation of the state in the history, as far as I remember. The colors are chosen randomly.

But the weird thing is that before I moved to hassio (I had a a python install) all the visual history made sense for me. I probably also bumped the hass version itself at the time.

I remember that specially the motion binary sensor was correctly displayed this time with:

  • no motion → green
  • motion → red

Good old times

I’m new to HA and I too noticed that motion detector colors are inverted (green = motion, red = safe).
It is not valid to invert the sensor because that displays that motion is detected. Green color, but erroneous state.
I looked at the source (current as of September 22, 2021) and could this be an easy fix?
File frontend-dev/src/components/chart/state-history-chart-timeline.ts :
Line 18 has a set variable

BINARY_SENSOR_DEVICE_CLASS_COLOR_INVERTED

It has things like door and window in the set. Can

"motion",

simply be added at line 24 to correct the issue?

Try it out and tell us if you had success!

I’d love to. I am new to HA. Could you point me to the doc that explains compilation and installation onto a RPI?

Try to create a new thread or post to the discord for a question that is off topic from the main thread please.