Page 1 of 1

Speak Variables/Device States

PostPosted: Mon Jun 24, 2019 1:13 pm
by Busta999
Anyone know if/how to use the Speak in Actions to speak a Variable and or Device States?

Re: Speak Variables/Device States

PostPosted: Mon Jun 24, 2019 2:19 pm
by howartp

Re: Speak Variables/Device States

PostPosted: Mon Jun 24, 2019 3:38 pm
by Busta999
I had tried %%v:472339010%% which works in sending iMessages but not in the Speak function of an Action - how did you get it to work?

Re: Speak Variables/Device States

PostPosted: Mon Jun 24, 2019 3:43 pm
by howartp
I haven’t tried it, I was just pointing you to the “how” of how to do it.


Sent from my iPhone using Tapatalk Pro

Re: Speak Variables/Device States

PostPosted: Mon Jun 24, 2019 3:55 pm
by Busta999
Ok

No problem, I'll keep digging.

I had found that section and read it, thanks for the link.

Got the iMessage to work with it was trying to get Speak to work too.

Not a big deal at all :-)

Re: Speak Variables/Device States

PostPosted: Tue Jun 25, 2019 5:41 am
by DaveL17
If you don't mind constructing a short bit of Python code, you can do this easily with a script:

Code: Select all
# Variable value
var = indigo.variables[1308289177]
indigo.server.speak(var.value)

# Device state
dev = indigo.devices[1990702686]
indigo.server.speak(unicode(dev.states['Forecast_High_Temperature']))

Re: Speak Variables/Device States

PostPosted: Tue Jun 25, 2019 5:43 am
by Busta999
Thanks Dave,

Getting into Python is on my todo list, not there yet - but will give it a go.

Thanks

Re: Speak Variables/Device States

PostPosted: Tue Jun 25, 2019 9:02 am
by jay (support)
The built-in Speak text area on the Action dialog doesn't support the device/variable substitution, so the script @DaveL17 posted above is the most straight-forward way. I did tweak it in place to make sure that a string was passed to the speak command.

Re: Speak Variables/Device States

PostPosted: Tue Jun 25, 2019 9:29 am
by DaveL17
Good call Jay.

The coffee hadn’t kicked in yet.


Sent from my iPhone using Tapatalk

Re: Speak Variables/Device States

PostPosted: Tue Jun 25, 2019 9:38 am
by jay (support)
DaveL17 wrote:
The coffee hadn’t kicked in yet.


Not here either really - very surprised I caught it... ☕️