From 99a57277ae0ccc39f11583ef472e3af6072b40a3 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Mon, 4 Nov 2019 11:25:43 +0000 Subject: [PATCH] mqtt2.template: bugfixes in valetudo and tasmota shutter templates git-svn-id: https://svn.fhem.de/fhem/trunk@20452 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/lib/AttrTemplate/mqtt2.template | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template index 2be31c77f..79d83ec59 100644 --- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template +++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template @@ -727,14 +727,14 @@ par:IO_DEV;Currently used IO;{ AttrVal("DEVICE","IODev",undef)} set DEVICE attrTemplate tasmota_set_lowercase_texts_and_state1 set IO_DEV publish CMNDTOPIC/Backlog LedState 2; SetOption80 1; Interlock 1,2; Interlock ON; SetOption81 1; switchmode1 3; switchmode2 3; PulseTime1 0; PulseTime2 0; SaveData 1; set IO_DEV publish CMNDTOPIC/Restart 1 -defmod configure_DEVICEattrTemplate_at at +00:00:20 set IO_DEV publish CMNDTOPIC/Backlog SHUTTEROPENDURATION 20;; SHUTTERCLOSEDURATION 20;; SHUTTERINVERT 1;; GROUPTOPIC Rollos;; SaveData 1;; +defmod configure_DEVICEattrTemplate_at at +00:00:20 set IO_DEV publish CMNDTOPIC/Backlog ShutterOpenDuration1 20;; ShutterCloseDuration1 20;; ShutterInvert1 1;; SaveData 1;; attr DEVICE setList \ - close:noArg CMNDTOPIC/SHUTTERCLOSE\ - open:noArg CMNDTOPIC/SHUTTEROPEN\ - half:noArg CMNDTOPIC/SHUTTERPOSITION 50\ - pct:slider,0,1,100 CMNDTOPIC/SHUTTERPOSITION $EVTPART1\ - stop:noArg CMNDTOPIC/SHUTTERSTOP\ - resetClose:noArg CMNDTOPIC/SHUTTERSETCLOSE\ + close:noArg CMNDTOPIC/ShutterClose1\ + open:noArg CMNDTOPIC/ShutterOpen1\ + half:noArg CMNDTOPIC/ShutterSetHalfway1 50\ + pct:slider,0,1,100 CMNDTOPIC/ShutterPosition1 $EVTPART1\ + stop:noArg CMNDTOPIC/ShutterStop1\ + resetClose:noArg CMNDTOPIC/ShutterSetClose1\ x_configuration CMNDTOPIC/$EVTPART1 $EVTPART2 attr DEVICE readingList \ TELETOPIC/LWT:.* LWT\ @@ -759,12 +759,12 @@ LWT\ state deletereading -q DEVICE (?!associatedWith).* attr DEVICE setStateList open close half stop pct -attr DEVICE comment After applying the template set "ShutterOpenDuration" and "ShutterCloseDuration" first.\ -Use the "set x_configuration" Option. Example: "set x_configuration ShutterOpenDuration 35"\ -Shutter specific commands available: ShutterOpenDuration, ShutterCloseDuration, ShutterRelay, ShutterSetHalfway, ShutterSetClose, ShutterInvert, ShutterMotordelay, ShutterCalibration; you may use this for general setOptions in tasmota also.\ +attr DEVICE comment After applying the template set "ShutterOpenDuration1" and "ShutterCloseDuration1" first.\ +Use the "set x_configuration" Option. Example: "set x_configuration ShutterOpenDuration1 35"\ +Shutter specific commands available: ShutterOpenDuration1, ShutterCloseDuration1, ShutterRelay1, ShutterSetHalfway1, ShutterSetClose1, ShutterInvert1, ShutterMotordelay1, ShutterCalibration1; you may use this for general setOptions in tasmota also.\ commands may need restart to take effect.\ -For calibration and further information on the available commands see Tasmota wiki. -farewell:template has been applied successfully. Now it's recommended to set shutter's open and close duration and 50% position, see short instruction in comment attribute or the
firmware contributor's wiki. +For calibration, use of more than one shutter device and further information on the available commands see Tasmota wiki. +farewell:template has been applied successfully. Now it's recommended to set shutter's open and close duration and 50% position, see short instruction in comment attribute or the
Tasmota wiki. attr DEVICE model tasmota_2ch_shutter_invert_1 # tasmota 2ch as shutter device. @@ -775,7 +775,7 @@ order:A_02b1 par:CMNDTOPIC;Command topic prefix, without trailing /;{ AttrVal("DEVICE","readingList","") =~ m,([^:]*)\b(tele|cmnd|stat)(/.*)?/LWT:, ? "${1}cmnd$3" : undef } par:IO_DEV;Currently used IO;{ AttrVal("DEVICE","IODev",undef)} set DEVICE attrTemplate tasmota_2ch_shutter_invert_1 -defmod configure_DEVICEattrTemplate_at at +00:00:20 set IO_DEV publish CMNDTOPIC/Backlog SHUTTEROPENDURATION 20;; SHUTTERCLOSEDURATION 20;; SHUTTERINVERT 0;; GROUPTOPIC Rollos;; SaveData 1;; +defmod configure_DEVICEattrTemplate_at at +00:00:20 set IO_DEV publish CMNDTOPIC/Backlog ShutterOpenDuration1 20;; ShutterCloseDuration1 20;; ShutterInvert1 0;; SaveData 1;; attr DEVICE devStateIcon opening:fts_shutter_up@red closing:fts_shutter_down@red Online:10px-kreis-gruen Offline:10px-kreis-rot 100:fts_shutter_10 0:fts_shutter_100 9\d.*:fts_shutter_10 8\d.*:fts_shutter_20 7\d.*:fts_shutter_30 6\d.*:fts_shutter_40 5\d.*:fts_shutter_50 4\d.*:fts_shutter_60 3\d.*:fts_shutter_70 2\d.*:fts_shutter_80 1\d.*:fts_shutter_90 \b\d\b.*:fts_shutter_90 attr DEVICE model tasmota_2ch_shutter_invert_0 @@ -1789,7 +1789,7 @@ filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*valetudo[/].* desc:use this to control a rooted Xiamoni Vacuum / Roborock. For further details visit https://github.com/Hypfer/Valetudo

NOTE: Initial version, not yet fully tested, just build according to https://forum.fhem.de/index.php/topic,104804.0.html
order:X_03 par:BASE_ID;BASE_ID typically is home;{ AttrVal("DEVICE","readingList","") =~ m,([^:]+)[/]valetudo[/].*:, ? $1 : undef } -par:DEVNAME;BASE_ID typically is home;{ AttrVal("DEVICE","readingList","") =~ m,valetudo[/]([^/]+)[/].*:, ? $1 : undef } +par:DEVNAME;DEVNAME typically is rockrobo;{ AttrVal("DEVICE","readingList","") =~ m,valetudo[/]([^/]+)[/].*:, ? $1 : undef } deletereading -q DEVICE (?!associatedWith).* defmod DEVICE MQTT2_DEVICE DEVNAME attr DEVICE icon vacuum_top @@ -1804,8 +1804,8 @@ attr DEVICE setList start:noArg BASE_ID/DEVNAME/command start\ pause:noArg BASE_ID/DEVNAME/command pause\ locate:noArg BASE_ID/DEVNAME/command locate\ fan_power:min,medium,high,max,mop BASE_ID/DEVNAME/set_fan_speed $EVTPART1\ - zone BASE_ID/DEVNAME/send_command zoned_cleanup $EVTPART1\ - goto BASE_ID/DEVNAME/send_command go_to $EVTPART1 + zone BASE_ID/DEVNAME/custom_command {"command":"zoned_cleanup","zone_ids":["$EVTPART1"]}\ + goto BASE_ID/DEVNAME/custom_command {"command":"go_to","spot_id":["$EVTPART1"]} attr DEVICE setStateList charge locate pause stop start attr DEVCID comment For code "valetudo2svg()" see this forum thread. farewell:template has been applied successfully. For map generation you'll need additional code to myUtils, see this forum thread for details.