Advertisement
xangin

QingPing Air sensor lite screen switch

May 19th, 2023 (edited)
1,597
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.11 KB | None | 0 0
  1. #################################################################################
  2. # 完成後即可控制開關青萍空氣檢測儀lite的螢幕
  3. # 1. 將所有內容存在/config/packages/air_sensor_screen_switch.yaml內
  4. # 2. 修改sensor.xxxxxxxxxx成任一青萍空氣檢測儀lite的實體ID,共有三個
  5. # 3. YAML檢查錯誤沒問題後,重新載入模板實體,即會得到switch.air_sensor_screen可供開關
  6. # Inspired by Jas0n from "Line社群Dcard智慧家庭"
  7. #################################################################################
  8. switch:
  9.   - platform: template
  10.     switches:
  11.       air_sensor_screen: #可修改成想要的實體ID
  12.         friendly_name: '青萍空氣檢測儀lite螢幕開關' #可修改成想要的名稱
  13.         unique_id: "air_sensor_screen"
  14.         turn_on:
  15.           - service: xiaomi_miot.call_action
  16.             data:
  17.               entity_id: sensor.xxxxxxxxxx #修改成任一青萍空氣檢測儀lite的實體ID
  18.               siid: 9
  19.               aiid: 2
  20.               params:
  21.                - 0
  22.               throw: false
  23.         turn_off:
  24.           - service: xiaomi_miot.call_action                                   # 這個區塊只要下一次即可
  25.             data:                                                             # 下過後可將此區塊註解掉
  26.               entity_id: sensor.xxxxxxxxxx #修改成任一青萍空氣檢測儀lite的實體ID  #
  27.               siid: 9                                                          #
  28.               aiid: 3                                                          #
  29.               params:                                                         #
  30.                 - 1439                                                         #
  31.               throw: false                                                     #              
  32.           - service: xiaomi_miot.call_action
  33.             data:
  34.               entity_id: sensor.xxxxxxxxxx #修改成任一青萍空氣檢測儀lite的實體ID
  35.               siid: 9
  36.               aiid: 2
  37.               params:
  38.                - 1
  39.               throw: false  
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement