自定义实体

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

AttributeDescription
friendly_nameName of the entity
hiddenSet to true to hide the entity.
entity_pictureUrl to use as picture for entity
iconAny icon from MaterialDesignIcons.com. Prefix name with mdi:, ie mdi:home.
assumed_stateFor 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_classSets 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

对于具有假定状态的开关,显示两个按钮(关闭,打开)而不是开关。 通过将 assumed_state 设置为 false,您将获得默认的开关图标。

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 tool icon 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。 要调用此服务,请转到服务开发者工具service developer tool icon,选择 homeassistant/reload_core_config 服务并单击“ Call Service ”。

新的自定义信息将在下次实体状态更新时应用。

转载于:https://my.oschina.net/u/3379895/blog/1068862

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值