From 4eb18a7bb2312f994abd506a2a3c35d5e6c74e22 Mon Sep 17 00:00:00 2001 From: Beta-User <> Date: Thu, 14 Mar 2019 06:55:28 +0000 Subject: [PATCH] mqtt2.template: add shelly2rgbw device (4 white chan mode) git-svn-id: https://svn.fhem.de/fhem/trunk@18894 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/lib/AttrTemplate/mqtt2.template | 51 +++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/fhem/FHEM/lib/AttrTemplate/mqtt2.template b/fhem/FHEM/lib/AttrTemplate/mqtt2.template index 15f839c70..3f7c314b6 100644 --- a/fhem/FHEM/lib/AttrTemplate/mqtt2.template +++ b/fhem/FHEM/lib/AttrTemplate/mqtt2.template @@ -810,6 +810,57 @@ attr DEVICE icon temperature_humidity attr DEVICE stateFormat T: temperature °C H: humidity % B: battery % attr DEVICE model A_16_shellyht +#shelly2rgbw +#contributed by user sledge +name:A_17a_shelly2rgbw_4w_split +filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*shellies.* +desc:shelly2rgbw configured with 4 white channels, one device for each channel
Tested with v1.4.8 +par:DEVNAME;name of this shelly;{ AttrVal("DEVICE","readingList","") =~ m,shellies/([^/]*)/, ? $1 : undef } +attr DEVICE readingList shellies/DEVNAME/white/0/status:.* {json2nameValue($EVENT)}\ + shellies/DEVNAME/white/0:.* state\ + shellies/DEVNAME/white/0/set:.* { json2nameValue($EVENT) }\ + shellies/DEVNAME/online:.* online +attr DEVICE setList off:noArg shellies/DEVNAME/white/0/command off\ + on:noArg shellies/DEVNAME/white/0/command on\ + brightness:colorpicker,BRI,0,1,100 shellies/DEVNAME/white/0/set {"ison":"true","mode":"white","brightness":"$EVTPART1"} +setreading DEVICE associatedWith DEVICE_CH1,DEVICE_CH2,DEVICE_CH4 +attr DEVICE webCmd on:off:brightness +attr DEVICE model A_17a_shelly2rgbw_4w_split +attr DEVICE comment Channel 1 for DEVICE, see also DEVICE_CH2, DEVICE_CH3 and DEVICE_CH4 +attr DEVICE icon light_control +attr DEVICE autocreate 0 +attr DEVICE setStateList on off +deletereading DEVICE .* +copy DEVICE DEVICE_CH2 +setreading DEVICE_CH2 associatedWith DEVICE,DEVICE_CH3,DEVICE_CH4 +attr DEVICE_CH2 readingList shellies/DEVNAME/white/1/status:.* {json2nameValue($EVENT)}\ + shellies/DEVNAME/white/1:.* state\ + shellies/DEVNAME/white/1/set:.* { json2nameValue($EVENT) }\ + shellies/DEVNAME/online:.* online +attr DEVICE_CH2 setList off:noArg shellies/DEVNAME/white/1/command off\ + on:noArg shellies/DEVNAME/white/1/command on\ + brightness:colorpicker,BRI,0,1,100 shellies/DEVNAME/white/1/set {"ison":"true","mode":"white","brightness":"$EVTPART1"} +attr DEVICE_CH2 setStateList on off +copy DEVICE DEVICE_CH3 +setreading DEVICE_CH3 associatedWith DEVICE,DEVICE_CH2,DEVICE_CH4 +attr DEVICE_CH3 readingList shellies/DEVNAME/white/2/status:.* {json2nameValue($EVENT)}\ + shellies/DEVNAME/white/2:.* state\ + shellies/DEVNAME/white/2/set:.* { json2nameValue($EVENT) }\ + shellies/DEVNAME/online:.* online +attr DEVICE_CH3 setList off:noArg shellies/DEVNAME/white/2/command off\ + on:noArg shellies/DEVNAME/white/2/command on\ + brightness:colorpicker,BRI,0,1,100 shellies/DEVNAME/white/2/set {"ison":"true","mode":"white","brightness":"$EVTPART1"} +attr DEVICE_CH3 setStateList on off +copy DEVICE DEVICE_CH4 +attr DEVICE_CH4 readingList shellies/DEVNAME/white/3/status:.* {json2nameValue($EVENT)}\ +shellies/DEVNAME/white/3:.* state\ +shellies/DEVNAME/white/3/set:.* { json2nameValue($EVENT) }\ +shellies/DEVNAME/online:.* online +attr DEVICE_CH4 setList off:noArg shellies/DEVNAME/white/3/command off\ + on:noArg shellies/DEVNAME/white/3/command on\ + brightness:colorpicker,BRI,0,1,100 shellies/DEVNAME/white/3/set {"ison":"true","mode":"white","brightness":"$EVTPART1"} +setreading DEVICE_CH4 associatedWith DEVICE,DEVICE_CH2,DEVICE_CH3 +attr DEVICE_CH4 setStateList on off ############### #ebusd