Exec binding exposed as Google Home Switch always showing "Offline"

If your Exec binding exposed as Google Home Switch shows as “Offline” it may be because the status is “NULL”
You’ll need to somewhat turn it ON/OFF so the status is no longer “NULL” and only then it will show as “OFF” in Google Home.
My knowledge of OH is very basic, so I simply created a one-line Script to force it to go through ON/OFF, using the ‘Run Now’ feature, which did the trick

That’s a good approach. in fact that’s one of the reasons the Scratchpad Script exists. You can create that through the developer side bar.

Other approachs include:

  • the default widget is usually a toggle. Even if the state is NULL, toggling the switch from MainUI anywhere the Item appears, will work
  • you can update or command items from the REST API
  • you can update or command items from the karaf console

For the Exec binding Thing/Point would it be possible to set it to default to “OFF” after creation, rather than “NULL” ?
“OFF” is the state that the Exec binding goes back to, after it finishes running, so in a way it would be more intuitive.

As a bonus, it would fix the problem with Google Home not liking “NULL” as a valid state for a Switch.

the default widget is usually a toggle.
Yes, I knew I saw it somewhere but for the life of me I couldn’t go back to that same screen.

No, I’m pretty sure bindings are allowed to do something like that. But it’s always worth filing an issue. But NULL actually has a meaning that might matter to some users in this case. It means no only is the script not currently running, but it’s never run since OH started up. If the Item is initialized to OFF that use case becomes eliminated.

In MainUI you can find the Item under Settings → Items → Name of Item. The default stand alone widget will be shown at the top.

If the Switch is a part of the semantic model, you’ll find it in the appropriate card under the locations, equipment, or properties tabs.

And of course you can find the Item on the Developer Sidebar.