#########################################################################
credit must go to @dtich on the indigo forum who came up with the script
#########################################################################
current release is v 2022.4.3
https://github.com/kw123/VoiceReceiver/releases
What does it do?
the PLUGIN
- receives message in indigo variable from iphone dictation shortcut
- analyses the received string to look for commands to
-- start indigo actions (must be defined in plugin menu)
-- switch on/off or dim devices set variables, etc
- sends back ok / not sucessful (you can set) and the iphone speaks that text
- in menu you can define / do :
1. synonymes for devices, variables, actions
2. mappings of bad to good words (eg "hugh" to "hue" or "the bug" to "debug") the plugin will replace the bad strings with the good
3. block words eg if "alarm" is set as blocked word any command containing "alarm" will be ignored
4. print help / config and stats ( how often and when was a command received) to logfile
the SHORTCUT on the iphone / mac / ipad /..
- listens to commands or has a command hardwired into code
- sends command into indigo variable ".. command .."
- receives result from variable ".. feedback .."
- speaks result (ok / not successful) depening on settings
================================ INSTALL ===========================
(A) After plugin install define the configurations in plugin config and menu, see below
in config define
variable and folder names
(language) mappings for on/off turn .. to other languages if you like
eg on -> an or set --> write
in menu define
- synonymes for actions, devices, variables:
to be used: eg use "open garage" instead of "garage door open relay"
- mappings of bad to good words: eg "hugh" to "hue" or "the bug" to "debug"; the plugin will replace the bad strings with the good
- block words: eg if "alarm" is set as blocked word any command containing "alarm" will be ignored
(B) === Create shortcut on iPhone with the following items: ====
you can download a shortcut with empty keys etc athttps://www.icloud.com/shortcuts/467123 ... 3589cf6579
then replace the <xxx> with your variable ids, ip numbers users bearer ... etc
speaking "hey Siri Indigo" pause "turn on office lights"
you could also define eg "hey indigo do" as hey siri replacement for this shortcut:
settings / Accessibility / vocal short cuts / add action / select yor shorcut say "hey indigo do" 3 times save
if you have a light named office lights:
"hey indigo do" pause "turn on office lights" should turn on your office lights
siri sometimes does not produce a "1" but "one" two etc
the plugin will replace null / zero ... twelve to 0,1,2,3,.. 12
also for german, french, spanish - if you need another language, let me know - we could also do dialects
Code: Select all
==== [b] commands[/b] ====================================================
substitute <device> with device name or synonym or "device id:<devId>:" or "deviceid:<devId>:"
substitute <variable> with variable name or synonym or "variable id:<varId>:" or "variableid:<varId>"
substitute <action> with action synonym or "action id:<actionId>:" or "actionid:<actionId>"
substitute <state> with state name
substitute <value> with value to be used
upper and lower cases are ignored
To make find dev anmes etc easier :
commands and names received will be "normalized:"
"_" and "-" "?" "." will be replaced by " "
indigo device and variable names and state names will be normalized:"
"abcDef" will be replaced by "abc def"
"_" and "-" will be replaced by " "
then incoming and indigo names etc can be better compared
commands:
set variable <variable> to value write value to variable, must contain "to"
get variable <variable> get var value and speak it
get <device> state <state> get dev/state value and speak it
notice the differnce to get variable
(set) speed <device> (to) xx for fans; (0-4 or 100) one, two are mapped to 1, 2
beep <device>
lock <device>
unlock <device>
turn on/off <device>
turn <device> on/off
toggle <device>
pulse <device> <secs> (seconds) on for <secs> then off, default = 1 secs
dip <device> <secs> (seconds) off for <secs> then on, default = 1 secs
(set) heat (temperature) <device> to <degrees> (temperature, degrees) for thermostates to set heat target temp
(set) cool (temperature) <device> to <degrees> (temperature, degrees) for thermostatesto seth ac target temp
(set) bright(ness level) <device> (to) <value> (percent / %) will set brightess of dimmer device to <value> 0..100
" and " or "&"" or " then " can be used to concatenate several commands"
=== meta commands ==================================================
list devices will print xx # of devices to logfile; just to show
debug on will enable debug all
debug off will disable debug all
test will print "test" to logfile
help will print ALL THIS to logfile
Code: Select all
[b]Examples [/b]for commands:
turn on office lights will turn on office lights and the phone will speak "ok" or "turned on" depending on settings
turn office lights on will turn on office lights and the phone will speak "ok" or "turned on" depending on settings
turn off deviceid:12345: will turn on indigo device with id 12345
toggle deviceid:12345: will toggle indigo device with id 12345
pulse deviceid:12345: 5 sec will turn on indigo device with id 12345 for 5 secs then off
dip office lights will turn off indigo device "office lights" for 1 secs then on - 1 is the default
open garage will be execute that action if you have defined "open garage" as a synonym for an action
actionid:54321 will execute indigo action with id 54321 if it exists
bright <device1> to xx and wait 5 and turn on <device2> will execute 3 commands
turn on ;SKD;ASJ on will fail and the iphone will speak "not executed" or "device not found" depending on settings
Code: Select all
plugin config Parameters ===========
allow_delta_time = 3.0
message must not be older thn current timestamp + allow_delta_time
expect_time_tag = True
require time stamp value as first work in message
var_name = voice_command_text
name of the variable the plugin will listen to, will be created if it does not exist
var_name_feedback = voice_command_feedback
name of the variable the plugin will write result to be pickup by iphone, will be created if it does not exist
folder_name = voiceReceiver
folder name of the variables, will be created if it does not exist
list devices max = 50
list max number of devices when receiving command list devices
return feedback = detailed
return what to iphone "blank" or "ok/not executed" or detailed info
return strings if successful ============================ if return feedback = detailed
set -> set
get ->
bright -> brightness set
toggle -> toggled
pulse -> pulsed
dip -> dipped
turn -> turned on off
speed -> speed set
beep -> beeped
cool -> cool set
heat -> heat set
lock -> locked
unlock -> unlocked
silence -> silence set
wait -> waited
command word mapping ===============================
set -> set
get -> get
to -> to
of -> of
level -> level
bright -> bright
toggle -> toggle
pulse -> pulse
dip -> dip
turn -> turn
on -> on
off -> off
speed -> speed
beep -> beep
cool -> cool
heat -> heat
lock -> lock
unlock -> unlock
silence -> silence
variable -> variable
wait -> wait
Defined synonymes for actions: ===============================
voice phrase --> action id = indigo name ------------
open garage 1576588508 = open garage door
press button 449021673 = write to log button pressed
stop curtain 463950535 = press stop curtain family room
Defined synonymes for devices: ===============================
voice phrase --> device id = indigo name ------------
left one 20740376 = Actuator Links-001B9F29B52333;
Defined synonymes for variables: ===============================
voice phrase --> variable id = indigo name ------------
cpu usage 905248318 = CPU_usage_ActionCollection
blocked_words = ['alarm', 'lock']
words that are not allowed for devices and actions eg "alarm", when they are present the whole command is ignored
bad to good words: bad good
cour -> color
de back -> debug
de back off -> debug off
hieu -> hue
hugh -> hue
the bag -> debug
the block -> debug
bad phrases to be replaced by good phrases
=============================
with dictation enabled with hardwired command