Problem with filter.skipAttributes

Dario5 years ago

Hello, my tracker sometimes sends me invalid positions, so i added a filter.
However I want to know when power it's cutted, valid position or not. So I did:

    <entry key='filter.enable'>true</entry>
    <entry key='filter.invalid'>true</entry>
    <entry key='filter.skipAttributes.enable'>true</entry>
    <entry key='filter.skipAttributes'>alarm,ignition,result,status</entry>

But I receive

2020-03-14 17:10:21  INFO: Position filtered by Invalid filters from device: 91711****

even when I cut power.
Are config wrong? Actually filter.skipAttributes.enable it's not documented, but I read in discussion it's needed.
Thanks!

Dario5 years ago

Checking in the code I find in https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/config/Keys.java

    /**
     * Enable attributes skipping. Attribute skipping can be enabled in the config or device attributes.
     */
    public static final ConfigKey FILTER_SKIP_ATTRIBUTES_ENABLE = new ConfigKey(
            "filter.skipAttributes.enable", Boolean.class);

I have to set it if it's no more documented?
I find in https://github.com/traccar/traccar/blob/master/src/main/java/org/traccar/handler/FilterHandler.java

    private boolean skipAttributes(Position position) {
        if (skipAttributes) {
            String attributesString = Context.getIdentityManager().lookupAttributeString(
                    position.getDeviceId(), "filter.skipAttributes", "", false, true);
            for (String attribute : attributesString.split("[ ,]")) {
                if (position.getAttributes().containsKey(attribute)) {
                    return true;
                }
            }
        }
        return false;
    }

Tried with and without enable, with multiple attributes together, with only alarm, with a specific alarm (powerCut) without succes
It's this feature still usable? or it's deprecated?