Support use of entities in “max” and “min” properties#184
Support use of entities in “max” and “min” properties#184mreysei wants to merge 7 commits intocustom-cards:masterfrom
Conversation
|
Hi! |
|
Hi @julll190, I'll give it a try. |
|
whenever I try to use your card I get "custom element doesn't exist: bar-card", any ideas? and sensor.billader_estimert_levert_3_fase is a int-number ( 24 ) in this case ... |
|
@HenrikHills probably it is because I created a new beta version that doesn't works haha I deleted it |
haha okay, yeah that worked perfectly, nice thanks!! |
This implements the functionality requested in PR custom-cards#184 for using entity references in severity thresholds, extending beyond the existing min/max/target entity support. Features Added: - Severity from/to properties now support entity references - Dynamic severity thresholds that update based on entity state changes - Automatic detection of entity state changes in severity sections Changes: - Updated _computeSeverityColor() to resolve entity values for from/to - Updated _computeSeverityVisibility() to resolve entity values for from/to - Updated _computeSeverityIcon() to resolve entity values for from/to - Enhanced hasConfigOrEntitiesChanged() to detect severity entity changes Example Usage: ```yaml type: custom:bar-card entities: - entity: sensor.temperature min: 0 max: sensor.max_temperature # Entity reference severity: - from: 0 to: sensor.warning_threshold # Entity reference color: green - from: sensor.warning_threshold # Entity reference to: sensor.critical_threshold # Entity reference color: orange - from: sensor.critical_threshold # Entity reference to: 100 color: red ``` This completes the full entity support for all numeric properties: - min/max (already supported) - target (already supported) - severity from/to (new in this commit)
And this is the working example using an entity and a number
Result of such component

If this PR does not merge because this project is not maintained, you can add a "Custom repository" in HACS with my repository link:
https://github.com/mreysei/bar-card