Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #################################################################################
- # 完成後即可控制開關青萍空氣檢測儀lite的螢幕
- # 1. 將所有內容存在/config/packages/air_sensor_screen_switch.yaml內
- # 2. 修改sensor.xxxxxxxxxx成任一青萍空氣檢測儀lite的實體ID,共有三個
- # 3. YAML檢查錯誤沒問題後,重新載入模板實體,即會得到switch.air_sensor_screen可供開關
- # Inspired by Jas0n from "Line社群Dcard智慧家庭"
- #################################################################################
- switch:
- - platform: template
- switches:
- air_sensor_screen: #可修改成想要的實體ID
- friendly_name: '青萍空氣檢測儀lite螢幕開關' #可修改成想要的名稱
- unique_id: "air_sensor_screen"
- turn_on:
- - service: xiaomi_miot.call_action
- data:
- entity_id: sensor.xxxxxxxxxx #修改成任一青萍空氣檢測儀lite的實體ID
- siid: 9
- aiid: 2
- params:
- - 0
- throw: false
- turn_off:
- - service: xiaomi_miot.call_action # 這個區塊只要下一次即可
- data: # 下過後可將此區塊註解掉
- entity_id: sensor.xxxxxxxxxx #修改成任一青萍空氣檢測儀lite的實體ID #
- siid: 9 #
- aiid: 3 #
- params: #
- - 1439 #
- throw: false #
- - service: xiaomi_miot.call_action
- data:
- entity_id: sensor.xxxxxxxxxx #修改成任一青萍空氣檢測儀lite的實體ID
- siid: 9
- aiid: 2
- params:
- - 1
- throw: false
Advertisement
Advertisement