Customizing Entities
By default, all of your devices will be visible and have a default icon determined by their domain. You can customize the look and feel of your front page by altering some of these parameters. This can be done by overriding attributes of specific entities.
Be carefull not to forget to place customize
, customize_domain
, and customize_glob
inside homeassistant:
or it will fail.
默认情况下,您的所有设备将是可见的,并具有由其域确定的默认图标。 您可以通过更改一些参数来自定义您的首页的外观和感觉。 这可以通过覆盖特定实体的属性来完成。
注意:
小心不要忘记在 homeassistant:
中放置 customize
, customize_domain
和 customize_glob
,否则会失败。
homeassistant:
name: Home
unit_system: metric
# etc
customize:
# Add an entry for each entity that you want to overwrite.
sensor.living_room_motion:
hidden: true
thermostat.family_room:
entity_picture: https://example.com/images/nest.jpg
friendly_name: Nest
switch.wemo_switch_1:
friendly_name: Toaster
entity_picture: /local/toaster.jpg
switch.wemo_switch_2:
friendly_name: Kitchen kettle
icon: mdi:kettle
switch.rfxtrx_switch:
assumed_state: false
# Customize all entities in a domain
customize_domain:
light:
icon: mdi:home
# Customize entities matching a pattern
customize_glob:
"light.kitchen_*":
icon: mdi:description
Possible values
Attribute | Description |
---|---|
friendly_name | Name of the entity |
hidden | Set to true to hide the entity. |
entity_picture | Url to use as picture for entity |
icon | Any icon from MaterialDesignIcons.com. Prefix name with mdi: , ie mdi:home . |
assumed_state | For switches with an assumed state two buttons are shown (turn off, turn on) instead of a switch. By setting assumed_state to false you will get the default switch icon. |
device_class | Sets the class of the device, changing the device state and icon that is displayed on the UI (see below). |
可能的值
属性 | 描述 |
---|---|
friendly_name | 实体名称 |
hidden | 设置为 true 将隐藏实体 |
entity_picture | 实体图片的URL |
icon | 来自MaterialDesignIcons.com.的图标,使用前缀 mdi: , 比如 mdi:home 。 |
assumed_state | 对于具有假定状态的开关,显示两个按钮(关闭,打开)而不是开关。 通过将 |
device_class | 设置设备的类别,更改UI上显示的设备状态和图标(见下文)。 |
Device Class
Device class is currently supported by the following platforms:
设备类
目前以下平台支持设备类:
Reloading customize
Home Assistant offers a service to reload the core configuration while Home Assistant is running called homeassistant/reload_core_config
. This allows you to change your customize section and see it being applied without having to restart Home Assistant. To call this service, go to the service developer tools, select the service homeassistant/reload_core_config
and click “Call Service”.
New customize information will be applied the next time the state of the entity gets updated.
重新加载自定义
Home Assistant可以在运行时提供重新加载核心配置的服务: homeassistant/reload_core_config
。 这允许您更改自定义部分,并看到它效果,而无需重新启动Home Assistant。 要调用此服务,请转到服务开发者工具,选择 homeassistant/reload_core_config
服务并单击“ Call Service ”。
新的自定义信息将在下次实体状态更新时应用。