I figured out how to simplify my IFTTT configuration and now I can use Google Home to control all lights in my house with a single IFTTT applet. I accomplished this by sending commands from IFTTT to a item called VoiceCommand using the example at https://github.com/openhab/openhab/wiki/Controlling-openHAB-with-your-voice. After exposing the VoiceCommand item, I created an applet by doing the following:
From “My Applets”, select “New Applet”
Press “this”, search for “Google Assistant” , and select it
Select “Say a phrase with a text ingredient”
Under “What do you want to say?”, enter “Turn $” and then press “Create Trigger”
Now press “that”, search for “openHAB”, and select it
Select “Send a command”
Under “Which item”, select “VoiceCommand”, under “Command to Send” enter “Turn {{TextField}}” and press “Create Action”
Press the “Finish” Button.
Other phrases that I have implemented are Open and Close. I don’t have dim working yet since i want to say something like “OK Google, Dim the kitchen lights to 50%”, and haven’t figured how to parse out the numeric value.
Interesting. I haven’t tried using VoiceCommand as a trigger. I simply created a applet for each light (2 for each actually, one for on and one for off).
It seems like the process simply takes the work off of making multiple applets in IFTTT and instead creating multiple individual rules. I don’t see how this makes it any more or less convenient. Am I missing something? I very may well be, I’m not familiar at all with the VoiceCommand option.
Ok, thanks. I wasn’t sure if I was missing something. To me IFTTT is just a temporary setup until (hopefully) Google opens up direct actions and OpenHab can tie in directly.
This may seem silly, but did you have to do anything special to get VoiceCommand to appear in myopenhab.org? I have used it with IFTTT for over a year with my.openhab, but since the switch, I can’t get it to appear. I have added to openhabcloud:expose=, and the one other item that I have exposed is appearing.
Thanks, got it working. When items are exposed to myopenhab.org they will only show up once there has been an update to the item. That’s why a forced value was needed. I believe there should be no reason to force a value anymore once the items is fully exposed.
Like you said, this creates a problem with items that contains numbers (dimmers, thermostat setpoints, volume). I’m not sure which way is better due to that.
I can’t admit to understand, but have you looked at the git page here:
The rules seem to have a way to parse for numbers, be it decimals or percent. I’m more of a copy and paste coder but maybe there is a way to use these in conjunction so that Google Assistant pushes to text phrase but the rule parses out the number.
I tried switching to HueEmulation with Google Home, but IFTTT is as responsive and works better in general. I also have more control of what happens with rules vs names of devices. I was surprised since there are a couple of additional hops with IFTTT.