I have webcore and google assistant.
Between all three of these is there a way I can ask google if the dog has been fed based on if the contact sensor in his food bin has been opened in the last few hours or between two times.
You should be able to do it with webCore.
Create a virtual switch that will be used to tell if the dog has been fed within your parameters.
In webCore, code a piston that turns the virtual switch on when the contact sensor detects the bin was opened. You’re going to use the switch turned on to indicate that the bin was opened within the last x. So you’ll need to add a timer for your period i.e. the last few hours. Then add an action that turns the switch off.
The idea is that the switch is turn on when the bin is opened, the timer kicks in waiting for x hours, and then the switch is turned off.
This is off the top of my head. You’ll have to experiment to see what happens if the lid is opened again while the switch is on, etc. That might complicate things as you’ll have to decide if the 2nd opening resets the timer. You may also have to set a task cancellation policy to make sure the turn off action fires.
If you decide to try this in webCore, rough out a piston and then post in the webCore forum for help polishing.
Once you get it working correctly with the switch turn on properly indicating the dog has been fed, you can incorporate notifications such as letting you know that the dog has not been fed.
This thread might be of interest.
Ok cool, I think I can get that all figured thanks all!
The one piece I really want though is the google piece.
I want to say “Hey Google, has the dog been fed” and if the switch is on then it will say yes. Is this getting into developing a voice app for google?
I’m not sure about Google, as my Google devices are at another location.
But this is something you can test pretty quickly before you do the rest. Create a virtual switch and turn it on. Give Google permissions to access the switch. Then as Google if the switch is on. I haven’t tried this but someone here may be able to provide some insight. But it shouldn’t take very long to test that portion.
Getting several levels of apps deep here, and I know some people don’t like that, so this might not be up your alley!
IFTTT has a Google Assistant integration that can do stuff based on talking to the assistant. I use that when I just want to say something that makes more sense … rather than turn on/turn off something. The replies can also be customized… I’m just not sure if it can be used to check the status of something… if so, then it would work with the above mentioned switch.
This seems like it might be the work around, was hoping to avoid adding anything else as I haven’t used IFTT yet, but it seems like this might be the one way to do it. I’ll keep digging to see if there is another way and will report back.
Alright, I figured it out!!