在Home Assistant尋找Entity ID

緣由

在使用ESPhome加入SPG30 TVOC sensor時,在元件設定說明頁面看到參數說明

compensation (Optional): The block containing sensors used for compensation. Both values must be supplied in order to be able to generate the absolute humidity to be reported to the sensor.

temperature_source (Optional, ID): Give an external temperature sensor ID here. The data must be in Celsius. This can improve the sensor’s internal calculations.

humidity_source (Optional, ID): Give an external relative humidity sensor ID here. This can improve the sensor’s internal calculations.

這說表示可引入其它sensor所讀取到的溫度與溼度,做為內部演算結果改善用,這裡提到的ID就是這個

從Home assistan找出sensor的entity id

  1. 進行 home assistant 首頁

  2. 點「設定

  3. 點「裝置與服務picture 0

  4. 如果是使用ESPhome韌體的就點ESPhome picture 1

  5. 選裝置

  6. 感測器的數值

  7. 彈出圖表後,按右上齒輪

  8. 會看到「實體ID」這個就是 entity id,可以直接複製

entity id 要轉為 id 才能使用

在設備yaml格式的設定檔中,將entity id對應成id,下面就是將sensor.room_temperature對應至ha_temp,此設定檔內,直接使用ha_temp這個id即可

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
sensor:
  - platform: homeassistant
    id: sht40_temp
    entity_id: sensor.rear_window_temperature

  - platform: homeassistant
    id: sht40_humi
    entity_id: sensor.rear_window_relative_humidity

  - platform: sgp30
    eco2:
      name: "eCO2"
    tvoc:
      name: "TVOC"
    store_baseline: yes
    compensation:
      temperature_source: sht40_temp # 直接使用id
      humidity_source: sht40_humi # 直接使用id
Built with Hugo
Theme Stack designed by Jimmy