cancel
Showing results for 
Search instead for 
Did you mean: 

About OnOffState

mizuhaunomori
Community Member

Reading the help on the following page, it seems that OnOffState has options such as greaterThanOrEqualTo

https://developers.home.google.com/automations/schema/reference/entity/sht_device/on_off_state

Has anyone actually made this work?
I think it would be really useful if this command works correctly and not only detects ON/OFF, but also if it was already ON, etc.

1 Recommended Answer

SirHappyCat
Community Member

Briefly tried, but those options do seem strange given that ON/OFF is a BOOL and the comparison operators require a number. The editor will throw an error.

+1 to being able to determine if the device was already on. I've noticed some oddities with LG TVs with Google Home in that it seems to send an ON signal every 3 minutes only while being on. It won't turn on the TV while it is off, but it keeps executing my "When my TV turns on starter" every interval. I assume a workaround would be to ignore the action if the TV is already on, but I can't seem to find a way to do that. I also don't think there is a way to only execute this if it's coming from an OFF to ON state too.

View Recommended Answer in original post

5 REPLIES 5

Alphabet
Community Member

Yeah I'm not sure what any of that means, or how that would work with OnOffState/Command, and I don't have time to test them unfortunately. A lot of states/commands have those keys such as "lessThanOrEqualTo", "greaterThan", etc. None of their examples show how this works, so I'm waiting for documentation to be updated.

SirHappyCat
Community Member

Briefly tried, but those options do seem strange given that ON/OFF is a BOOL and the comparison operators require a number. The editor will throw an error.

+1 to being able to determine if the device was already on. I've noticed some oddities with LG TVs with Google Home in that it seems to send an ON signal every 3 minutes only while being on. It won't turn on the TV while it is off, but it keeps executing my "When my TV turns on starter" every interval. I assume a workaround would be to ignore the action if the TV is already on, but I can't seem to find a way to do that. I also don't think there is a way to only execute this if it's coming from an OFF to ON state too.

@SirHappyCat, thank you for testing briefly! That's unfortunate, but hopefully these options become more built out and stable as the preview progresses.

You could try the "suppressFor" or "for" field to try fixing the LG TV starter, maybe? Not sure exactly what "suppressFor" does. I've noticed that LG's integration with Google Home and Google Assistant can be wacky and buggy at times even before the Script Editor. Like I think I have two to three objects/connections in the Home App just for one LG TV.

Thanks @Alphabet! Yes, "suppressFor" makes it a bit better as a workaround. It seems that when a starter is triggered, "suppressFor" will "disable" the starter for the specified duration after it is first triggered. Now it's balancing frequency of the action. Ultimately, LG shouldn't be sending a ON request every 3min while the TV is on.

Thanks for testing it.
It doesn't seem to be working right now.

I'll wait for the documentation to be updated and the samples to be updated.