Friday
I want to use the Condition: of my Google TV On/Off state in Google Home Scripts.
So I have this code:
automations:
starters:
- type: device.state.OnOff
device: Panasonic TV - Lounge
state: on
is: false
condition:
device: Panasonic TV - Lounge
type: device.state.OnOff
state: on
is: false
When it is run, I find in the log:
Automation check: conditions not met.
Starter check: conditions met.
So why is this, i.e. the check is OK to allow the script to run, but the same condition is not met in the script?
Answered! Go to the Recommended Answer.
yesterday
Thanks for clarification. You can skip/remove the condition part since turning off TV in the starter block would trigger light(s) to go off.
Can you please try the below script and let me if that worked for you:
metadata:
name: TVoffLightoff
description: Light goes off if TV is off
automations:
starters:
- type: device.state.OnOff
state: on
is: false
device: TV - Family Room
actions:
- type: device.command.OnOff
on: false
devices: Light - Family Room
Tuesday
Can you give us more details about this home script? What you are trying to achieve with it?
yesterday
I want to use the
condition:
device: Panasonic TV - Lounge
type: device.state.OnOff
state: on
is: false
in other scripts, e.g. turn off lights if (condition) TV is off
yesterday
Thanks for clarification. You can skip/remove the condition part since turning off TV in the starter block would trigger light(s) to go off.
Can you please try the below script and let me if that worked for you:
metadata:
name: TVoffLightoff
description: Light goes off if TV is off
automations:
starters:
- type: device.state.OnOff
state: on
is: false
device: TV - Family Room
actions:
- type: device.command.OnOff
on: false
devices: Light - Family Room
yesterday
I will test your suggestion soon.
But I already have two Starters, -type: device.state.OnOff, and -type: time.schedule(s).
I wish to retain those, hence a Condition seemed the obvious solution.