mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 06:39:11 +00:00
mqtt2.template: tasmota - small changes - Forum topic #95360 #msg882365
git-svn-id: https://svn.fhem.de/fhem/trunk@18162 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
7449d9d4d7
commit
6fcf602c1b
@ -274,16 +274,13 @@ attr DEVICE setList \
|
||||
p2:on,off,toggle cmnd/DEVNAME/POWER2 $EVTPART1\
|
||||
p3:on,off,toggle cmnd/DEVNAME/POWER3 $EVTPART1\
|
||||
p4:on,off,toggle cmnd/DEVNAME/POWER4 $EVTPART1
|
||||
attr DEVICE devStateIcon {\
|
||||
"<div><a href=\"/fhem?cmd.dummy=set ".$name." p1 toggle&XHR=1\">POWER1:"\
|
||||
. FW_makeImage(lc ReadingsVal($name, "POWER1", "off"))\
|
||||
. "</a> <a href=\"/fhem?cmd.dummy=set ".$name." p2 toggle&XHR=1\">POWER2:"\
|
||||
. FW_makeImage(lc ReadingsVal($name, "POWER2", "off")) . "</a></div>"\
|
||||
. "</a> <a href=\"/fhem?cmd.dummy=set ".$name." p3 toggle&XHR=1\">POWER3:"\
|
||||
. FW_makeImage(lc ReadingsVal($name, "POWER3", "off")) . "</a></div>"\
|
||||
. "</a> <a href=\"/fhem?cmd.dummy=set ".$name." p4 toggle&XHR=1\">POWER4:"\
|
||||
. FW_makeImage(lc ReadingsVal($name, "POWER4", "off")) . "</a></div>"\
|
||||
}
|
||||
attr DEVICE devStateIcon { "<div>\
|
||||
<a href=\"/fhem?cmd.dummy=set ".$name." p1 toggle&XHR=1\">POWER1:" . FW_makeImage(lc ReadingsVal($name, "POWER1", "off")) . "</a> \
|
||||
<a href=\"/fhem?cmd.dummy=set ".$name." p2 toggle&XHR=1\">POWER2:" . FW_makeImage(lc ReadingsVal($name, "POWER2", "off")) . "</a> \
|
||||
<a href=\"/fhem?cmd.dummy=set ".$name." p3 toggle&XHR=1\">POWER3:" . FW_makeImage(lc ReadingsVal($name, "POWER3", "off")) . "</a> \
|
||||
<a href=\"/fhem?cmd.dummy=set ".$name." p4 toggle&XHR=1\">POWER4:" . FW_makeImage(lc ReadingsVal($name, "POWER4", "off")) . "</a\
|
||||
></div>" }
|
||||
attr DEVICE userReadings state:POWER.*:.* { lc(ReadingsVal($NAME,"POWER1","") . " " . ReadingsVal($NAME,"POWER2","") . " " . ReadingsVal($NAME,"POWER3","") . " " . ReadingsVal($NAME,"POWER4","")) }
|
||||
attr DEVICE stateFormat P1: POWER1 P2: POWER2 P3: POWER3 P4: POWER4
|
||||
attr DEVICE webCmd :
|
||||
attr DEVICE model A_04b_tasmota_4ch_unified_icon
|
||||
@ -294,12 +291,12 @@ desc:Configures a single device
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
set DEVICE attrTemplate A_01a_tasmota_basic_state_power1
|
||||
par:DEVNAME;ESP's name in the topic;{ AttrVal("DEVICE","readingList","") =~ m,tele/([^/]*)/, ? $1 : undef }
|
||||
attr DEVICE userReadings state:POWER.*:.* { lc(ReadingsVal($NAME,"POWER1","") . " " . ReadingsVal($NAME,"POWER2","") . " " . ReadingsVal($NAME,"POWER3","") . " " . ReadingsVal($NAME,"POWER4","")) }
|
||||
attr DEVICE readingList tele/DEVNAME/LWT:.* LWT\
|
||||
tele/DEVNAME/STATE:.* { json2nameValue($EVENT,'',$JSONMAP) }\
|
||||
tele/DEVNAME/SENSOR:.* { json2nameValue($EVENT,'',$JSONMAP) }\
|
||||
tele/DEVNAME/INFO.:.* { json2nameValue($EVENT,'',$JSONMAP) }\
|
||||
stat/DEVNAME/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }
|
||||
attr DEVICE room MQTT2_DEVICE
|
||||
attr DEVICE setList POWER1:on,off,toggle cmnd/DEVNAME/POWER1 $EVTPART1\
|
||||
POWER2:on,off,toggle cmnd/DEVNAME/POWER2 $EVTPART1\
|
||||
POWER3:on,off,toggle cmnd/DEVNAME/POWER3 $EVTPART1\
|
||||
|
Loading…
Reference in New Issue
Block a user