2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-20 07:16:03 +00:00

speechcontrol.template: fix type; add RHASSPY

git-svn-id: https://svn.fhem.de/fhem/trunk@24520 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2021-05-27 17:53:36 +00:00
parent aa6cf772a6
commit 1a1cf050a0

View File

@ -1,3 +1,4 @@
###########################################
# $Id$
#
@ -19,7 +20,7 @@ name:speechcontrol_type_switch
filter:NAME=speechrecognTesting
order:100001
desc:template to set speech speechcontrol attributes for genericDeviceType switch
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant)");;return 1 if $devices[0];;return 0}
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant|RHASSPY)");;return 1 if $devices[0];;return 0}
attr DEVICE genericDeviceType switch
set DEVICE attrTemplate speechcontrol_general_naming_master_template
@ -27,7 +28,7 @@ name:speechcontrol_type_light
filter:NAME=speechrecognTesting
order:100002
desc:template to set speech speechcontrol attributes for genericDeviceType light
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant)");;return 1 if $devices[0];;return 0}
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant|RHASSPY)");;return 1 if $devices[0];;return 0}
attr DEVICE genericDeviceType light
set DEVICE attrTemplate speechcontrol_general_naming_master_template
@ -35,7 +36,7 @@ name:speechcontrol_type_light_255
filter:NAME=speechrecognTesting
order:100003
desc:template to set speech speechcontrol attributes for genericDeviceType light - brightness in 255 steps
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant)");;return 1 if $devices[0];;return 0}
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant|RHASSPY)");;return 1 if $devices[0];;return 0}
set DEVICE attrTemplate speechcontrol_type_light
attr DEVICE genericDeviceType light
attr DEVICE homebridgeMapping Brightness=brightness::brightness,maxValue=100,factor=0.39216,delay=true
@ -45,7 +46,7 @@ name:speechcontrol_type_blind
filter:NAME=speechrecognTesting
order:100004
desc:template to set speech speechcontrol attributes for genericDeviceType blind
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant)");;return 1 if $devices[0];;return 0}
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant|RHASSPY)");;return 1 if $devices[0];;return 0}
attr DEVICE genericDeviceType blind
set DEVICE attrTemplate speechcontrol_general_naming_master_template
@ -53,7 +54,7 @@ name:speechcontrol_type_thermostat
filter:NAME=speechrecognTesting
order:100005
desc:template to set speech speechcontrol attributes for genericDeviceType thermostat
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant)");;return 1 if $devices[0];;return 0}
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant|RHASSPY)");;return 1 if $devices[0];;return 0}
attr DEVICE genericDeviceType thermostat
set DEVICE attrTemplate speechcontrol_general_naming_master_template
@ -62,7 +63,7 @@ name:speechcontrol_gdt_only
filter:filter:genericDeviceType=.+
order:100006
desc:template to set speech speechcontrol attributes for to any genericDeviceType; call e.g. with set <xy> attrTemplate speechcontrol_gdt_only GENERICDEVTYPE=Security
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant)");;return 1 if $devices[0];;return 0}
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant|RHASSPY)");;return 1 if $devices[0];;return 0}
par:GENERICDEVTYPE;GENERICDEVTYPE <genericDeviceType>, defaults to contact;{ "contact" }
attr DEVICE genericDeviceType GENERICDEVTYPE
set DEVICE attrTemplate speechcontrol_general_naming_master_template
@ -71,7 +72,7 @@ name:speechcontrol_gdt_and_mapping
filter:filter:genericDeviceType=.+
order:100007
desc:generic template to set speech speechcontrol attributes for to any genericDeviceType including full mapping, call e.g. with set xy attrTemplate speechcontrol_gdt_and_mapping GENERICDEVTYPE=contact HOMEBRIDGEMAPPING= "ContactSensorState=state,values=closed:CONTACT_DETECTED;;open:CONTACT_NOT_DETECTED"
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant)");;return 1 if $devices[0];;return 0}
option:{my @devices=devspec2array("TYPE=(siri|alexa|gassistant|RHASSPY)");;return 1 if $devices[0];;return 0}
par:GENERICDEVTYPE;GENERICDEVTYPE <genericDeviceType>, defaults to contact;{ "contact" }
par:HOMEBRIDGEMAPPING;HOMEBRIDGEMAPPING, defaults to "some split-by-semicolon-compatible represantation or the expression to the right";{ 'ContactSensorState=state,values=closed:CONTACT_DETECTED;;open:CONTACT_NOT_DETECTED' }
attr DEVICE genericDeviceType GENERICDEVTYPE
@ -85,9 +86,10 @@ order:10000200
desc:generic template to set attributes for identifying this device by speech speechcontrol software. This template will call several sub-templates - dependent on the speech speechcontrol solutions which are in use in your installation. Pls. do not use one of the subtemplates directly. Call e.g. with set xy attrTemplate speechcontrol_general_naming_master_template
option:{my @devices=devspec2array("TYPE=alexa");; $devices[0] ? return 1 : return 0}
set DEVICE attrTemplate speechcontrol_alexa_specials
option:{my @devices=devspec2array("TYPE=siri");; my @alexas=devspec2array("TYPE=alexa");; ($devices[0] && !$alexas[0]) ? AttrVal("DEVICE","genericDeviceType","none") eq "none" ? 0 : 1 : 0 }
option:{my @devices=devspec2array("TYPE=siri");; my @alexas=devspec2array("TYPE=alexa");; ($devices[0] && !$alexas[0]) ? AttrVal('DEVICE','genericDeviceType','none') eq 'none' ? 0 : 1 : 0 }
#set DEVICE attrTemplate speechcontrol_siri_specials
option:{my @devices=devspec2array("TYPE=gassistant");; $devices[0] ? return 1 : return 0}
option:{my @devices=devspec2array("TYPE=RHASSPY");; $devices[0] ? return 1 : return 0}
#######
# alexa specials
@ -113,7 +115,7 @@ deleteAttr DEVICE alexaName #optional falls Name zuvor vorhanden
set DEVICE attrTemplate speechcontrol_siri_specials CHECKGDTDONE=1
option:{ RADIO_SETalexaNAME }
set DEVICE attrTemplate speechcontrol_request_alexaName
option:{ RADIO_SKIP_SCONTROLL }
option:{ RADIO_SKIPP_SCONTROLL }
set DEVICE attrTemplate speechcontrol_siri_specials CHECKGDTDONE=1 SKIPSCONTROLL=1
@ -135,8 +137,8 @@ filter:NAME=speechrecognTesting
order:1000021a
desc:generic template to set speech speechcontrol attribute alexaName, call e.g. with set xy attrTemplate speechcontrol_siri_specials ALEXANAME=myAlexaName
option:{my @devices=devspec2array("TYPE=(siri)");; $devices[0] ? return 1 : return 0}
par:CHECKGDTDONE;Set this to to 1 if answer was no in previous template;{ 0 }
par:SKIPSCONTROLL;Set this to to 1 if answer was no in previous template;{ 0 }
par:CHECKGDTDONE;Set this to 1 if answer was no in previous template;{ 0 }
par:SKIPSCONTROLL;Set this to 1 if answer was no in previous template;{ 0 }
par:RADIO_KEEPsiriNAME;Keep current attribute value;{ defined AttrVal("DEVICE","siriName",undef) ? undef : SKIPSCONTROLL ? undef : 0 }
par:RADIO_SETsiriNAME;Set a new siriName;{ SKIPSCONTROLL ? undef : 0 }
par:RADIO_DoNotSetsiriName;Leave siriName attribute empty;{ SKIPSCONTROLL ? undef : 0 }
@ -157,26 +159,6 @@ desc:generic template to ask for siriName attribute setting. Only intented for i
par:SIRINAME;Please enter siriName;{ undef }
option:{my @devices=devspec2array("TYPE=(siri)");; $devices[0] ? return 1 : return 0}
attr DEVICE siriName SIRINAME
#option:{my @devices=devspec2array("TYPE=RHASSPY");; $devices[0] ? return 1 : return 0}
#set DEVICE attrTemplate speechcontrol_rhasspy_specials CHECKGDTDONE=1
#############
#no longer used:
name:speechcontrol_alaxaName_secondrun
filter:NAME=speechrecognTesting
order:1000020b
desc:generic template to doublecheck alexaName attribute setting to avoid doubletes. Only intented for internal use by speechcontrol_alaxaName_firstrun and -ask_different_name, called e.g. with set xy attrTemplate speechcontrol_alaxaName_secondrun ALEXAISNAME=myAlexaName
option:{my @devices=devspec2array("TYPE=(alexa)");; $devices[0] ? return 1 : return 0}
par:ALEXAISNAME;Please enter alexaName;{ AttrVal("DEVICE","alexaName",undef) }
option:{my @devices=devspec2array("alexaName=ALEXAISNAME");; $devices[1] ? return 1 : return 0}
deleteattr DEVICE alexaName
set DEVICE attrTemplate speechcontrol_alaxaName_ask_different_name
name:speechcontrol_alaxaName_ask_different_name
filter:NAME=speechrecognTesting
order:1000020c
desc:generic template to set speech speechcontrol attribute alexaName; only intented for internal use by speechcontrol_alaxaName_secondrun, called e.g. with set xy attrTemplate speechcontrol_alaxaName_ask_different_name ALEXANAME=myAlexaName
option:{my @devices=devspec2array("TYPE=(alexa)");; $devices[0] ? return 1 : return 0}
par:ALEXANAME;Please enter alexaName (the one provided last time seem to exist already);{ undef }
attr DEVICE alexaName ALEXANAME
set DEVICE attrTemplate speechcontrol_alaxaName_secondrun ALEXAISNAME=ALEXANAME