From 7b7d0fb3fdcc7a5325d2aabb6557dc424107785d Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Fri, 6 Mar 2020 06:50:31 +0000 Subject: [PATCH] mqtt2.template: change in tasmotar gbw template, add alexaName specials to speech recogn - testing only... git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@21363 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- FHEM/lib/AttrTemplate/mqtt2.template | 3 +++ FHEM/lib/AttrTemplate/speechrecogn.template | 23 ++++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/FHEM/lib/AttrTemplate/mqtt2.template b/FHEM/lib/AttrTemplate/mqtt2.template index ee07cf522..868ee459a 100644 --- a/FHEM/lib/AttrTemplate/mqtt2.template +++ b/FHEM/lib/AttrTemplate/mqtt2.template @@ -1136,6 +1136,9 @@ attr DEVICE setList\ pct:colorpicker,BRI,0,5,100 CMNDTOPIC/DIMMER\ white:colorpicker,BRI,0,5,100 { "CMNDTOPIC/COLOR ". sprintf("000000%02X",$EVTPART1*2.55) }\ saturation:colorpicker,BRI,0,1,100 CMNDTOPIC/HSBCOLOR2\ + Speed:colorpicker,BRI,0,1,20 CMNDTOPIC/SPEED\ + Fade:uzsuSelect,ON,OFF CMNDTOPIC/FADE $EVTPART1\ + mode:selectnumbers,0,1,4,0,lin CMNDTOPIC/SCHEME attr DEVICE readingList \ TELETOPIC/LWT:.* LWT\ TELETOPIC/STATE:.* { json2nameValue($EVENT,'',$JSONMAP) }\ diff --git a/FHEM/lib/AttrTemplate/speechrecogn.template b/FHEM/lib/AttrTemplate/speechrecogn.template index 91bfa46a3..633378687 100644 --- a/FHEM/lib/AttrTemplate/speechrecogn.template +++ b/FHEM/lib/AttrTemplate/speechrecogn.template @@ -84,11 +84,32 @@ order:100007 desc:generic template to set speech recognition attributes for to any genericDeviceType including full mapping, call e.g. with set xy attrTemplate speech_recognition_gdt_and_mapping GENERICDEVTYPE=Security 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} par:GENERICDEVTYPE;GENERICDEVTYPE , 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'" } +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 attr DEVICE homebridgeMapping HOMEBRIDGEMAPPING option:TYPE=siri option:TYPE=alexa option:TYPE=gassistant +name:speech_recognition_alaxaName_firstrun +filter:NAME=speechrecognTesting +order:1000020a +desc:generic template to set speech recognition attribute alexaName, call e.g. with set xy attrTemplate speech_recognition_alaxaName_firstrun ALEXANAME=myAlexaName +option:TYPE=alexa +par:ALEXANAME;Please enter alexaName;{ AttrVal("DEVICE","alexaName",undef) } +attr DEVICE alexaName ALEXANAME +set DEVICE attrTemplate speech_recognition_alaxaName_secondrun ALEXAISNAME=ALEXANAME + +name:speech_recognition_alaxaName_secondrun +filter:NAME=speechrecognTesting +order:1000020b +desc:generic template to doublecheck alexaName attribute setting to avoid doubletes , call e.g. with set xy attrTemplate speech_recognition_alaxaName_secondrun ALEXAISNAME=myAlexaName +option:TYPE=alexa +par:ALEXAISNAME;Please enter alexaName;{ AttrVal("DEVICE","alexaName",undef) } +option:{my @devices=devspec2array("alexaName=ALEXAISNAME");; $devices[1] ? return 1 : return 0} +par:ALEXANAME;Please enter alexaName (you may be asked multiple times to avoid already existing names);{undef) } +attr DEVICE alexaName ALEXANAME +option:TYPE=alexa +set DEVICE attrTemplate speech_recognition_alaxaName_firstrun +