When does the battery icon in deCONZ turn red?

Apologies if this is documented somewhere or has been asked and answered before:

In deCONZ, battery-operated devices such as motion sensors from e.g. IKEA or Philips/Signify have a symbol for the battery percentage remaining.

This symbol turns from bright green to intermediate colors to red.

What are the thresholds, e.g. when does the symbol turn red?
Are these thresholds identical for all battery-operated devices?

Thanks in advance,
Chris

I seem to have found it in the other repository GitHub - dresden-elektronik/deconz: deCONZ core generic Zigbee application in the file zm_gnode.cpp.

Less or equal than 20% : Red
Less or equal than 40% : orange
Less or equal than 60% : yellowish green
Greater than 60% : bright green

The reason I wanted to know was that I wanted to created my own alert based on the same thresholds as deconz…

    if (battery >= 0 && battery <= 100)
    {
        m_battery = battery;
        if (battery <= 20)
        {
            m_pm = QPixmap(QLatin1String(":/icons/faenza/gpm-primary-020.png"));
        }
        else if (battery <= 40)
        {
            m_pm = QPixmap(QLatin1String(":/icons/faenza/gpm-primary-040.png"));
        }
        else if (battery <= 60)
        {
            m_pm = QPixmap(QLatin1String(":/icons/faenza/gpm-primary-060.png"));
        }
        else
        {
            m_pm = QPixmap(QLatin1String(":/icons/faenza/gpm-primary-100.png"));
        }

        m_pm = m_pm.scaledToHeight(26);
    }

Hello, but why you don’t use API return ? You will have the battery level with it.

I was planning to use the API to retrieve the battery level.
My question was not about that, but how to interpret the level in the same way deCONZ does.
Now I will use 20% as the threshold for a battery low warning.

{
    "config": {
        "alert": "none",
        "battery": 94,
        "delay": 32,
        "ledindication": false,
        "on": true,
        "reachable": true,
        "sensitivity": 1,
        "sensitivitymax": 4,
        "usertest": false
    },

Ha ok, so for information, batterie level is not something linear, you can have 100% during 2 years, then 100> 90% in 1 years, then 90% to 50 in the same year.