Closed brunohenriquy closed 3 days ago
A lot of the sensors here seem to be uninteresting values that would never change. Such values might be better as attributes under another entity to reduce clutter in the UI.
How can I do it? I didn't understand very well!
To add things as extra attributes, you just add them under the dps list with a name that is not handled specially by the entity. For sensors, only "sensor" and "unit" have special handling plus the general things like "name", "device_class" etc, so any other name will be added as an extra attribute.
So instead of:
- entity: sensor
name: Sector 1
icon: "mdi:numeric-1-circle"
class: enum
category: diagnostic
dps:
- id: 101
type: string
name: sensor
mapping:
- dps_val: Armado
value: Armed
- dps_val: Desarmado
value: Disarmed
- dps_val: Memoria
value: Memory
- dps_val: Disparado
value: Triggered
- entity: sensor
name: Sector 1 Name
icon: "mdi:numeric-1-circle-outline"
category: diagnostic
dps:
- id: 120
type: string
name: sensor
you could have the name as an attribute of the Sector 1 sensor (since name will not change during operation, so you don't really need to track its state):
- entity: sensor
name: Sector 1
icon: "mdi:numeric-1-circle"
class: enum
category: diagnostic
dps:
- id: 101
type: string
name: sensor
mapping:
- dps_val: Armado
value: Armed
- dps_val: Desarmado
value: Disarmed
- dps_val: Memoria
value: Memory
- dps_val: Disparado
value: Triggered
- id: 120
type: string
name: sensor_name
To add things as extra attributes, you just add them under the dps list with a name that is not handled specially by the entity. For sensors, only "sensor" and "unit" have special handling plus the general things like "name", "device_class" etc, so any other name will be added as an extra attribute.
Ohhhh Sweet! Thanks!
@make-all All adjustments have been made, can we proceed to merge it?
@make-all you've changed the name from "Alarm Central" to "Alam control", shouldn't the file name be renamed to alarm_control.yaml as well?
Thank you for pointing out the file name. It should not be this generic, as this is not a generic device template.
Thank you for pointing out the file name. It should not be this generic, as this is not a generic device template.
@make-all
But isn't it also wrong having the same name as a product entry? Today it is an specific device template, what if in the future another manufacturer uses the same structure but with a different brand and model name?
The config file name just needs to be unique, so another device matching it does not really matter. But making it too generic when it is not could lead to confusion.
The config file name just needs to be unique, so another device matching it does not really matter. But making it too generic when it is not could lead to confusion.
Gotcha!! Thanks! xD
Added support for an unrecognized Alarm Central (HLG Infinity).
Product
Functions