Google Home Script Editor
我是家中唯一一個用android 手機的。其他人都是用iphone
所以google home 只會管理我睡房嘅smart devices
最近想到怎樣可以使到冷氣機開咗後自己會係XX小時後自動關閉
我部3/4匹是插在一個smart power switch 到的
我打開google home app, 發現自動化部份, action 只有 on, off 或toggle on/off
沒有辨認當某device on咗後,到若干時候自動關機
跟住係網上找有咩嘢方法
原來最近google home 有個叫script editor (public preview)的東西
可以用 .yaml 格式就可以做到
例如下面部冷氣機開咗後3小時自己關機- metadata:
- name: Auto Off Air Conditioner After 30 Mins
- description: Turns off the switch 30 minutes after it is turned on
- automations:
- - starters:
- - type: device.state.OnOff
- device: Air Conditioner - Bedroom
- state: on
- is: true
- actions:
- - type: time.delay
- for: 180min
- - type: device.command.OnOff
- devices:
- - Air Conditioner - Bedroom
- on: false
複製代碼 |
|
|