2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-16 04:36:02 +00:00

mqtt_gemeric_bridge.template: small changes, add actuator to thermostats

git-svn-id: https://svn.fhem.de/fhem/trunk@23632 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2021-01-28 18:37:14 +00:00
parent 7f54824605
commit aba6032281

View File

@ -14,7 +14,7 @@
###########################################
name:General_Info_MQTT_GENERIC_BRIDGE
filter:TYPE=MQTT_GENERIC_BRIDGE
desc: This attrTemplate-file is still in a very early stage and more like a POC, see <a href="https://forum.fhem.de/index.php/topic,117737.0.html">Forum Thread (reminder: open a new one..)</a> for further info.<br>Note: Using this set of attrTemplate requires 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>See proposals in base_settings_to_MQTT_GENERIC_BRIDGE for reference.
desc: This attrTemplate-file is still in a very early stage and more like a POC, see <a href="https://forum.fhem.de/index.php/topic,117737.0.html">Forum Thread (reminder: open a new one..)</a> for further info.<br>Note: Using this set of attrTemplate requires some basic configuration on the MQTT_GENERIC_BRIDGE side itself, especially, especially <b>different topic structures for sending readings values and receiving commands and/or reading values.</b><br>See proposals in base_settings_to_MQTT_GENERIC_BRIDGE for reference.
order:000000
###########
@ -29,7 +29,7 @@ par:RADIO_SETCLIENTODERMGB_M2D;Set clientOrder on IODev to "MQTT_GENERIC_BRIDGE
par:RADIO_SETCLIENTODERMGB_ONLY;Set clientOrder on IODev to "MQTT_GENERIC_BRIDGE" (MGB only mode);{ my $io = AttrVal("DEVICE",'IODev',""); return 0 if InternalVal($io,'TYPE','MQTT') eq 'MQTT'; AttrVal($io,"clientOrder",undef) }
par:RADIO_SETCLIENTODERM2D_MGB;Set clientOrder on IODev to "MQTT2_DEVICE MQTT_GENERIC_BRIDGE" (default, may cause unintended autocreates);{ my $io = AttrVal('DEVICE','IODev',""); return 0 if InternalVal($io,'TYPE','MQTT') eq 'MQTT'; AttrVal($io,'clientOrder',undef) }
par:RADIO_DONTSETCLIENTODER;Leave clientOrder on IODev (default is "MQTT2_DEVICE MQTT_GENERIC_BRIDGE", may cause unintended autocreates);{ my $io = AttrVal("DEVICE","IODev",""); return 0 if InternalVal($io,'TYPE','MQTT') eq 'MQTT'; AttrVal($io,'clientOrder',undef) }
attr DEVICE globalDefaults sub:base={"DEVICE/set"} pub:base={"DEVICE"}
attr DEVICE globalDefaults sub:base=DEVICE/set pub:base=DEVICE
option:{ RADIO_SETCLIENTODERMGB_M2D }
attr IODEVNAME clientOrder MQTT_GENERIC_BRIDGE MQTT2_\DEVICE
option:{ RADIO_SETCLIENTODERM2D_MGB }
@ -92,11 +92,11 @@ option:{ InternalVal("TARGETDEV",'TYPE','none') eq 'CUL_HM' }
attr TARGETDEV MQTTPREFIXSubscribe desired-temp:stopic={"$base/$device/$name"}
option:{ SENDBASICREADINGS && InternalVal("TARGETDEV",'TYPE','none') eq 'CUL_HM' }
attr TARGETDEV MQTTPREFIXAlias pub:measured-temp=temperature
attr TARGETDEV MQTTPREFIXPublish desired-temp|measured-temp:topic={"$base/$device/$name"}
attr TARGETDEV MQTTPREFIXAlias pub:measured-temp=temperature ValvePosition=actuator
attr TARGETDEV MQTTPREFIXPublish desired-temp|measured-temp|ValvePosition:topic={"$base/$device/$name"}
option:{ SENDALLREADINGS && InternalVal("TARGETDEV",'TYPE','none') eq 'CUL_HM' }
attr TARGETDEV MQTTPREFIXAlias pub:measured-temp=temperature
attr TARGETDEV MQTTPREFIXAlias pub:measured-temp=temperature ValvePosition=actuator
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$device/$name"}
option:{ InternalVal("TARGETDEV",'TYPE','none') eq 'FBDECT' }
@ -122,10 +122,35 @@ option:{ InternalVal("TARGETDEV",'TYPE','none') eq 'ZWave' }
attr TARGETDEV MQTTPREFIXSubscribe desired-temp:stopic={"$base/$device/$name"}
option:{ SENDBASICREADINGS && InternalVal("TARGETDEV",'TYPE','none') eq 'ZWave' }
attr TARGETDEV MQTTPREFIXPublish desired-temp|temperature:topic={"$base/$device/$name"} temperature:expression={$value=~m,(-?\d+(\.\d+)?),?::round($1,1):undef}
attr TARGETDEV mqttGB1Alias reportedState=actuator
attr TARGETDEV MQTTPREFIXPublish desired-temp|temperature|reportedState:topic={"$base/$device/$name"} temperature:expression={$value=~m,(-?\d+(\.\d+)?),?::round($1,1):undef} reportedState:expression={$value=~m,dim.(\d+),?$1:undef}
option:{ SENDALLREADINGS && InternalVal("TARGETDEV",'TYPE','none') eq 'ZWave' }
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$device/$name"} temperature:expression={$value=~m,(-?\d+(\.\d+)?),?::round($1,1):undef}
attr TARGETDEV mqttGB1Alias reportedState=actuator
attr TARGETDEV MQTTPREFIXPublish *:topic={"$base/$device/$name"} temperature:expression={$value=~m,(-?\d+(\.\d+)?),?::round($1,1):undef} reportedState:expression={$value=~m,dim.(\d+),?$1:undef}
#option:{ InternalVal("TARGETDEV",'TYPE','none')!~m,CUL_HM|FBDECT|MAX|ZWave, }
#set DEVICE attrTemplate mgb_thermostat_unknownType
name:mgb_thermostat_unknownType
order:A_10000w1
prereq:{my @devices=devspec2array("TYPE=MQTT_GENERIC_BRIDGE");return 1 if $devices[0];return 0}
filter:NAME=mgbTesting
par:TARGETDEV;Sorry, device type not yet supportet, please contribute. <br>You have to enter again the name of the device you want to put under MQTT_GENERIC_BRIDGE controll;{ undef }
par:MQTTPREFIX;prefix used in MGB;{ InternalVal("DEVICE",'prefix',undef) }
par:MQTT_ALIAS;Set mqttAlias, e.g. to "pub:measured-temp=temperature" or "none" if nothing shall be set here;{undef}
par:PUBLISH_ARGS;Values for mqttPublish, e.g. "desired-temp|measured-temp:topic={"$base/$device/$name"}". Use "none" if nothing shall be set here;{undef}
par:SUBSCRIPTION_ARGS;Value for mqttSubscribe, e.g. "desired-temp:stopic={"$base/$device/$name"}". Use "none" if nothing shall be set here;{undef}
option:{ "MQTT_ALIAS" eq 'none' ? 0 : 1 }
attr TARGETDEV MQTTPREFIXAlias MQTT_ALIAS
option:{ "PUBLISH_ARGS" eq 'none' ? 0 : 1 }
attr TARGETDEV MQTTPREFIXPublish PUBLISH_ARGS
option:{ "SUBSCRIPTION_ARGS" eq 'none' ? 0 : 1 }
attr TARGETDEV MQTTPREFIXSubscribe SUBSCRIPTION_ARGS
############