what I am thinking the issue is that can_rpm is an attribute I added via the GUI, meaning that in the truck asset, can_rpm doesn’t exist by default. Is that why the colour remains the same?
I have also added the map styling via a JSON generated by chatgpt which gaves rivers and landfills the colours. So is the issue?
Here is my truckasset for introspection :
package org.openremote.model.custom;
import jakarta.persistence.Entity;
import org.openremote.model.asset.AssetDescriptor;
/**
* TruckAsset is an extension of the CarAsset class for fleet management.
* It inherits all attributes from CarAsset and is used specifically for truck vehicles.
*/
@Entity
public class TruckAsset extends CarAsset {
public static final AssetDescriptor<TruckAsset> DESCRIPTOR = new AssetDescriptor<>("truck", null, TruckAsset.class);
protected TruckAsset() {
}
public TruckAsset(String name) {
super(name);
}
public AssetDescriptor<TruckAsset> getAssetDescriptor() {
return DESCRIPTOR;
}
}
Do I need to add the attribute in this file for it to work?
Hey @Saarthi, the marker “range” config will only apply when the attribute is present, has the correct type “number/integer/…” and the value matches any of the configured values.
So by default if the attribute doesn’t contain a value within any of the specified ranges it should show the label you specified with the default asset color.
Once you specify a value within any of the ranges you should see the color change.
I’d like to join this thread and ask an additional question: is it possible to change an asset’s color on the map depending on whether there are active alarms linked to that asset?
For example:
no active alarms → standard color
at least one active alarm (open, acknowledged, in progress) → specific color
I would prefer not to use a dedicated attribute set by a rule, but instead base the color directly on the active alarms linked to the asset.
If this is currently not possible, perhaps this feature could be considered for future development?
It could potentially be extended to differentiate the color based on alarm status (open, acknowledged, in progress) and possibly also severity.
is it possible to change an asset’s color on the map depending on whether there are active alarms linked to that asset?
No this is not possible currently, nor do we have it on the roadmap of some sort.
For me personally, it would a lot of sense to add this feature to the platform.
So it’s a: “Yes please!”
Unfortunately feature requests are a bit difficult since we’re limited in resources at the moment.
Don’t know if you would be open to integrate it? Anyone can contribute this if they’d like.
I was able to modify/add code to change color of an asset with active alarms (and change back to normal color when alarms are cleared/removed) but now I’m facing problem with managing alarms on Android mobile - there’s no “alarm icon” allowing managing alarms. How can I turn it on?
EDIT:
Answering to myself: visible menu options depend on device screen width