How to expose a string item to be controllable via Google assistant

Hi is there a way to expose a string item so that it is controllable via my Google assistant? I don’t find a way with tagging to expose a string.

I want to be able to set string to different text values using Google home basically using voice control.
If not is there any other alternate available to achieve the same?

1 Like

@rlkoshak Hi , is this tagged right? i am new to the community … I am trying to resolve this problem any suggestions ? Thanks .

Hi @Sharath_B_Krishna,

I’m assuming that no one answered the question because no one who’s been on here this past week has a confident answer to give you.

My non-expert answer would be that what you’re asking is not possible. As far as I’m aware, Google has the ability to trigger defined states in items (e.g. ON or OFF), but not convert voice commands to strings for the purpose of controlling items.

What are you trying to accomplish? If you tell us the end result you’re aiming for, there might be other ways to do it without having to resort to strings.

@rpwong okay . What i am trying for is using IR blaster to change TV channel based on the Names of the channel triggered with google assistant.

Eg Voice cmd : Change channel to ZEE STUDIO

once this info is passed as string i use a transformation map and change this to a defined set of IR Codes and transmit it .

How else can i achieve this ?

If you only want to do it for a handful of favourite channels for which you’ve also defined the IR codes, then you could set up individual switches for each one. So you would have a ZEE STUDIO switch that has ON and OFF states, and you would expose it to GA, then set up a routine for the phrasing you want to use. Then you’d just have a rule that triggers the code when the switch toggles ON.

The downside of this is that you’d have to have as many switches as you have channels, but that doesn’t really matter if you rarely use the Google Home app.

The alternative would be to pick up a Logitech Harmony Hub, which does exactly what you want natively via its Google Assistant action. A Broadlink RM Mini 3 might also work, but I don’t know how advanced its Google Assistant action is.

My hardware is all in place and all configured .

Yes I can do the Switch item thing … but gets very cumbersome over time with additions of channels … Was looking for a generic way.

Why does GA binding not support such a action as this will allow lot more automation possible .

I was earlier using IFTTT for the same . However since IFTTT integration is suspended . I am looking for a alternative.


1 Like

Does such an action exist in Google Assistant? I haven’t read through the documentation enough to know one way or another, but if you find out what needs to be done then you could bring it to the attention of the volunteer developers who are maintaining the GA action in openHAB. They might just need someone to tell them why it would be useful (or to tell them that it’s possible).

May I throw a curve ball in?

What about doing the transformation within the Google environment using routines?

(The same is possible in the Alexa environment)

For example

A transformation / routine in Google that does something like this

If Google hears
“Change channel to ZEE STUDIO”

It will actually send a number to an openHAB2 item.

That could work, combined with a dimmer item to accept the number between 1-100. The response from Google wouldn’t be very satisfying though, since it would say something like “setting the ___ to 56”.

Because Google doesn’t provide it. From what I’ve seen the OH Google Assistant integration supports everything that Google allows and provides an API for. Google doesn’t provide an API for this.

Using Routines is probably the only way to support your use case with Google Assistant.

1 Like

@rlkoshak I just wanted to understand how is it implemented in the IFTTT Google Home integration . Like they way it uses google voice commands to accept a string or a number or both in a voice command and then process a action based on that . Does IFTTT google assistant interation do it someother way and we cant adapt it ?

1 Like

I assume so.

@rlkoshak Who can help us here to check and explore this possibility ?

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.