cancel
Showing results for 
Search instead for 
Did you mean: 

Custom logic to control devices

Johan5
Community Member

I need to control a commercial smart outlet device in google home with a custom logic algorithm ( If logic true, set device to on).
What options do I have?
Would a matter outlet device be preferable?

1 Recommended Answer

Suc1
Solutions Expert
Solutions Expert

For controlling a commercial smart outlet with custom logic, you have several options:

  1. Matter outlets are indeed preferable as they offer better interoperability and local control. With Matter, you can use the Google Home API to implement your conditional logic and control the device.
  2. For custom logic implementation, you could use either:
    • Google Home Routines with automation triggers
    • A third-party integration platform like Home Assistant
    • Direct API integration using the Google Smart Home SDK

What specific conditions are you trying to evaluate in your logic?

View Recommended Answer in original post

3 REPLIES 3

Suc1
Solutions Expert
Solutions Expert

For controlling a commercial smart outlet with custom logic, you have several options:

  1. Matter outlets are indeed preferable as they offer better interoperability and local control. With Matter, you can use the Google Home API to implement your conditional logic and control the device.
  2. For custom logic implementation, you could use either:
    • Google Home Routines with automation triggers
    • A third-party integration platform like Home Assistant
    • Direct API integration using the Google Smart Home SDK

What specific conditions are you trying to evaluate in your logic?

Johan5
Community Member

Thank you for your answer.

The parameters (conditions) to use in the logic are based on input data from a weather api (rain forecast and observations), and past irrigation.

I was thinking of logging and calculating these input data in a Google sheet using apps script and then automatically calling Google home to set the outlet on, either directly or using a Google cloud run function.

 

I think the main problem has to do with using an external script with custom logic to interact with Google home. However, Google home is evolving, and there might be a solution now with "the new Google home".

 

Can you give me guidance and/or references on how to use custom logic with Google home routines and/or Google Smart Home SDK as you mentioned?

 

/thanks

Suc1
Solutions Expert
Solutions Expert

I recommend using our Smart Home Actions platform. This will let you connect your weather-based irrigation logic to Google Home with minimal complexity.

Key Resources

Getting Started

Start with our quickstart guide at https://developers.home.google.com/smart-home, which walks through setting up your first Smart Home Action.