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

mqtt_generic_bridge.template: changes to (global->single attributes)

git-svn-id: https://svn.fhem.de/fhem/trunk@23584 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2021-01-22 11:45:08 +00:00
parent 92e63bc486
commit 03c61228c0

View File

@ -24,7 +24,7 @@ prereq:{my @devices=devspec2array("TYPE=MQTT_GENERIC_BRIDGE");return 1 if $devic
filter:TYPE=MQTT_GENERIC_BRIDGE
desc:This template is proposal to fullfill requirements for the rest of the s some basic configuration on the MQTT_GENERIC_BRIDGE side itself, especially:<br>- different topic structures for sending readings values and receiving commands and/or reading values; <br>- Variable $name must be part of the base topic structures.<br>Note: All outgoing messages will be sent without retain flag; change this to 1, if you need values stored on your MQTT server (e.g. if your clients are not always connected).
order:000001
attr DEVICE globalDefaults sub:base={"DEVICE/set/$device"} pub:base={"DEVICE/$device"} pub:qos=0 sub:qos=2 retain=0
attr DEVICE globalDefaults sub:base={"DEVICE/set"} pub:base={"DEVICE"} pub:qos=0 sub:qos=2 retain=0
farewell:Now you can start to configure your devices to send and receive messages over MQTT!
@ -45,7 +45,7 @@ desc:This template is a first showcase for use of AttrTemplate in MQTT_GENERIC_B
order:A_000001
par:TARGETDEV;Pls enter name of the device you want to put under MQTT_GENERIC_BRIDGE controll;{ undef }
par:MQTTPREFIX;prefix used in MGB;{ InternalVal("DEVICE",'prefix',undef) }
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$name"}
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$device/$name"}
@ -78,32 +78,32 @@ par:MQTTPREFIX;prefix used in MGB;{ InternalVal("DEVICE",'prefix',undef) }
par:TRGETDEVTYPE;TYPE of target device;{ InternalVal("TARGETDEV",'TYPE',undef) }
option:{ "TRGETDEVTYPE" eq "ZWave" || "TRGETDEVTYPE" eq "CUL_HM" }
attr TARGETDEV MQTTPREFIXSubscribe desired-temp:stopic={"$base/$name"}
attr TARGETDEV MQTTPREFIXSubscribe desired-temp:stopic={"$base/$device/$name"}
option:{ "TRGETDEVTYPE" eq "MAX" }
attr TARGETDEV MQTTPREFIXSubscribe desiredTemperature:stopic={"$base/$name"}
attr TARGETDEV MQTTPREFIXSubscribe desiredTemperature:stopic={"$base/$device/$name"}
attr TARGETDEV MQTTPREFIXAlias desiredTemperature=desired-temp
option:{SENDNOREADINGS}
deleteattr TARGETDEV MQTTPREFIXPublish
option:{ SENDBASICREADINGS && "TRGETDEVTYPE" eq "ZWave" }
attr TARGETDEV MQTTPREFIXPublish desired-temp|temperature:topic={"$base/$name"} temperature:expression={$value=~m,(-?\d+(\.\d+)?),?::round($1,1):undef}
attr TARGETDEV MQTTPREFIXPublish desired-temp|temperature:topic={"$base/$device/$name"} temperature:expression={$value=~m,(-?\d+(\.\d+)?),?::round($1,1):undef}
option:{ SENDBASICREADINGS && "TRGETDEVTYPE" eq "CUL_HM" }
attr TARGETDEV MQTTPREFIXAlias pub:measured-temp=temperature
attr TARGETDEV MQTTPREFIXPublish desired-temp|measured-temp:topic={"$base/$name"}
attr TARGETDEV MQTTPREFIXPublish desired-temp|measured-temp:topic={"$base/$device/$name"}
option:{ SENDBASICREADINGS && "TRGETDEVTYPE" eq "MAX" }
attr TARGETDEV MQTTPREFIXPublish desiredTemperature|temperature:topic={"$base/$name"}
attr TARGETDEV MQTTPREFIXPublish desiredTemperature|temperature:topic={"$base/$device/$name"}
option:{ SENDALLREADINGS && "TRGETDEVTYPE" eq "ZWave" }
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$name"} temperature:expression={$value=~m,(-?\d+(\.\d+)?),?::round($1,1):undef}
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$device/$name"} temperature:expression={$value=~m,(-?\d+(\.\d+)?),?::round($1,1):undef}
option:{ SENDALLREADINGS && "TRGETDEVTYPE" eq "CUL_HM" }
attr TARGETDEV MQTTPREFIXAlias pub:measured-temp=temperature
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$name"}
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$device/$name"}
option:{ SENDALLREADINGS && "TRGETDEVTYPE" eq "MAX" }
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$name"}
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$device/$name"}