2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

mqtt2.template:

- zigbee2mqtt: prepare bridge for graphical network map
- tasmota: renaming of templates and changes to 4-ch-unified


git-svn-id: https://svn.fhem.de/fhem/trunk@18028 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2018-12-22 17:16:28 +00:00
parent e5017ab2aa
commit b25830a613

View File

@ -13,15 +13,15 @@
# zigbee2mqtt
# The zigbee2mqtt bridge device (entire hex id of devices as bridgeRegexp)
name:L_01_zigbee2mqtt_bridge
desc:The zigbee2mqtt bridge device <br>NOTE: JSON of networkmap raw will not be expanded! <br>If you want that, change readingList accordingly, "get <device> networkmap raw" will lead to an empty afterwards.
desc:The zigbee2mqtt bridge device
filter:TYPE=MQTT2_DEVICE
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:([^/]+)[/].*:, ? $1 : undef }
attr DEVICE bridgeRegexp\
BASE_TOPIC/([A-Za-z0-9]*)[/]?.*:.* "zigbee_$1"
attr DEVICE getList\
devicelist:noArg log BASE_TOPIC/bridge/config/devices\
networkmap:raw networkmap_raw BASE_TOPIC/bridge/networkmap $EVTPART1\
networkmap_graphviz graphviz BASE_TOPIC/bridge/networkmap graphviz
networkmap_raw:noArg raw BASE_TOPIC/bridge/networkmap raw\
networkmap_graphviz:noArg graphviz BASE_TOPIC/bridge/networkmap graphviz
attr DEVICE readingList\
BASE_TOPIC/bridge/state:.* state\
BASE_TOPIC/bridge/config/devices:.* {}\
@ -31,7 +31,7 @@ attr DEVICE readingList\
BASE_TOPIC/bridge/log:.* log\
BASE_TOPIC/bridge/networkmap:.* {}\
BASE_TOPIC/bridge/networkmap/graphviz:.* graphviz\
BASE_TOPIC/bridge/networkmap/raw:.* networkmap_raw
BASE_TOPIC/bridge/networkmap/raw:.* raw
attr DEVICE setList\
log_level:debug,info,warn,error BASE_TOPIC/bridge/config/log_level $EVTPART1\
permit_join:true,false BASE_TOPIC/bridge/config/permit_join $EVTPART1\
@ -46,27 +46,10 @@ name:L_01a_zigbee2mqtt_bridge_0x
desc:The zigbee2mqtt bridge device <br>New version, using entire device name including "0x"
filter:TYPE=MQTT2_DEVICE
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:([^/]+)[/].*:, ? $1 : undef }
set DEVICE attrTemplate L_01_zigbee2mqtt_bridge_0x
attr DEVICE bridgeRegexp BASE_TOPIC/(0x[A-Za-z0-9]*)[/]?.*:.* "zigbee_$1"
attr DEVICE setList\
permit_join:true,false BASE_TOPIC/bridge/config/permit_join $EVTPART1\
remove:textField BASE_TOPIC/bridge/config/remove $EVTPART1\
log_level:debug,info,warn,error BASE_TOPIC/bridge/config/log_level $EVTPART1\
rename:textField BASE_TOPIC/bridge/config/rename {"old":"$EVTPART1","new":"$EVTPART2"}\
network_map:raw,graphviz BASE_TOPIC/bridge/networkmap $EVTPART1\
devicelist:noArg BASE_TOPIC/bridge/config/devices
attr DEVICE readingList BASE_TOPIC/bridge/log:.* { json2nameValue($EVENT) }\
BASE_TOPIC/bridge/state:.* state
attr DEVICE model L_01a_zigbee2mqtt_bridge_0x
# The zigbee2mqtt bridge device: (allows friendly names for devices, but adds new device(s) when receiving interface messages)
name:L_01b_zigbee2mqtt_bridge_speaking_names
desc:The zigbee2mqtt bridge device - new version<br>Allows friendly names for devices, but adds new device(s) also when receiving messages related to the service itself
filter:TYPE=MQTT2_DEVICE
par:BASE_TOPIC;base topic set in configuration.yaml of the zigbee2mqtt bridge;{ AttrVal("DEVICE","readingList","") =~ m,[^:]+:([^/]+)[/].*:, ? $1 : undef }
set DEVICE attrTemplate L_01_zigbee2mqtt_bridge_0x
attr DEVICE bridgeRegexp BASE_TOPIC/([A-Za-z0-9]*)[/]?.*:.* "zigbee_$1"
attr DEVICE model L_01b_zigbee2mqtt_bridge_speaking_names
# The zigbee2mqtt bridge device
name:L_01x_zigbee2mqtt_bridge_outdated
desc:The zigbee2mqtt bridge device <br>Original version, kept in repo for compability reasons. <br>Truncs device name from "0x"
@ -236,7 +219,7 @@ attr DEVICE stateFormat {\
attr DEVICE model A_01b_tasmota_1ch+motion+SI7021
# tasmota 2ch as one FHEM device.
name:A_02_tasmota_2ch_unified
name:A_02a_tasmota_2ch_unified
filter:TYPE=MQTT2_DEVICE
desc:Configures a single device including all readings <br>NOTE: untested!
set DEVICE attrTemplate A_01a_tasmota_basic_state_power1
@ -250,10 +233,10 @@ attr DEVICE stateFormat {\
. " P2:" . FW_makeImage(lc ReadingsVal($name, "POWER2", "off"))\
. "</div>"\
}
attr DEVICE model A_02_tasmota_2ch_unified
attr DEVICE model A_02a_tasmota_2ch_unified
# sonoff 2 channel device flashed with Tasmota.
name:A_02a_tasmota_2channel_split
name:A_02_tasmota_2channel_split
filter:TYPE=MQTT2_DEVICE
desc:sonoff 2 channel device flashed with Tasmota. <br>NOTE: a second device will be created for the second channel
set DEVICE attrTemplate A_01a_tasmota_basic_state_power1
@ -266,11 +249,11 @@ attr DEVICE_CH2 setList \
off:noArg COMMAND/POWER2 0\
on:noArg COMMAND/POWER2 1\
toggle:noArg COMMAND/POWER2 2
attr DEVICE model A_02a_tasmota_2channel_split
attr DEVICE model A_02_tasmota_2channel_split
# tasmota 4ch as one FHEM device.
name:A_04_tasmota_4ch_unified
name:A_04a_tasmota_4ch_unified
filter:TYPE=MQTT2_DEVICE
desc:Configures a single device including all readings
set DEVICE attrTemplate A_01a_tasmota_basic_state_power1
@ -288,31 +271,30 @@ attr DEVICE stateFormat {\
. " P4:" . FW_makeImage(lc ReadingsVal($name, "POWER4", "off"))\
. "</div>"\
}
attr DEVICE model A_04_tasmota_4ch_unified
attr DEVICE model A_04a_tasmota_4ch_unified
# tasmota 4ch as one FHEM device.
name:A_04_tasmota_4ch_unified_test
name:A_04b_tasmota_4ch_unified_test
desc:Configures a single device including all readings <br>uses multiline for webCmd <br>NOTE: untested!
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 setList \
POWER1:on,off cmnd/DEVNAME/POWER1 $EVTPART1\
POWER2:on,off cmnd/DEVNAME/POWER2 $EVTPART1\
POWER3:on,off cmnd/DEVNAME/POWER3 $EVTPART1\
POWER4:on,off cmnd/DEVNAME/POWER4 $EVTPART1
attr DEVICE webCmd POWER1:POWER2:POWER3:POWER4
attr DEVICE stateFormat {\
"<div>P1:" . FW_makeImage(lc ReadingsVal($name, "POWER1", "off"))\
. " P2:" . FW_makeImage(lc ReadingsVal($name, "POWER2", "off"))\
. " P3:". FW_makeImage(lc ReadingsVal($name, "POWER3", "off"))\
. " P4:" . FW_makeImage(lc ReadingsVal($name, "POWER4", "off"))\
. "</div>"\
}
attr DEVICE webCmdLabel Kanal 1:Kanal 2\
:Kanal 3:Kanal 4
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\
POWER4:on,off,toggle cmnd/DEVNAME/POWER4 $EVTPART1
attr DEVICE setStateList on off toggle
attr DEVICE stateFormat P1: POWER1 P2: POWER2 P3: POWER3 P4: POWER4
attr DEVICE webCmd POWER1 toggle:POWER2 toggle:POWER3 toggle:POWER4 toggle
attr DEVICE model A_04b_tasmota_4ch_unified_test
###########################################
# SHELLY
#