mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-01-31 18:59:33 +00:00
mqtt2.template: Changes to sonos, tasmota2zigbee and shellybulb
git-svn-id: https://svn.fhem.de/fhem/trunk@22424 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
12bc470599
commit
4077061bf0
@ -1606,7 +1606,8 @@ par:IO_DEV;Currently used IO;{ InternalVal("DEVICE","LASTInputDev",AttrVal("DEVI
|
||||
set IO_DEV publish CMNDTOPIC/Backlog StateText1 off; StateText2 on; StateText3 toggle; StateText4 hold; SetOption26 1; SetOption89 1; SaveData 1
|
||||
par:ICON;ICON as set, defaults to MQTT;{ AttrVal("DEVICE","icon","mqtt") }
|
||||
attr DEVICE icon ICON
|
||||
attr DEVICE setList permit_join:0,1,99 cmnd/ZigBee2MQTT/ZbPermitJoin $EVTPART1
|
||||
attr DEVICE setList permit_join:0,1,99 CMNDTOPIC/ZbPermitJoin $EVTPART1\
|
||||
x_ZbSend:textField CMNDTOPIC/zbsend {"device":"0x$EVTPART1","send":{"$EVTPART2":"$EVTPART3"}}
|
||||
attr DEVICE bridgeRegexp \
|
||||
TELETOPIC/([^/]+)/SENSOR:.* "z2t_$1"
|
||||
attr DEVICE readingList
|
||||
@ -1614,7 +1615,7 @@ attr DEVICE readingList
|
||||
STATTOPIC/RESULT:.* { json2nameValue($EVENT,'',$JSONMAP) }
|
||||
set IO_DEV publish CMNDTOPIC/restart 1
|
||||
attr DEVICE model tasmota_zigbee2tasmota_bridge
|
||||
setreading DEVICE attrTemplateVersion 20200716
|
||||
setreading DEVICE attrTemplateVersion 20200718
|
||||
|
||||
|
||||
name:tasmota_zigbee2tasmota_light_dimmer
|
||||
@ -1629,11 +1630,13 @@ attr DEVICE icon ICON
|
||||
attr DEVICE readingList
|
||||
TELETOPIC/SENSOR:.* { $EVENT =~ m,0xDEV_ID.:(.[^}]+.), ? json2nameValue($1,'',$JSONMAP) : undef }
|
||||
attr DEVICE setList on CMNDTOPIC/ZbSend {"device":"0xDEV_ID","send":{"Power":"On"}}\
|
||||
off CMNDTOPIC/ZbSend {"device":"0xDEV_ID","send":{"Power":"Off"}}
|
||||
off CMNDTOPIC/ZbSend {"device":"0xDEV_ID","send":{"Power":"Off"}}\
|
||||
brightness:colorpicker,BRI,0,5,254 CMNDTOPIC/ZbSend { "device":"0xDEV_ID", "send":{"Dimmer":$EVTPART1} }
|
||||
attr DEVICE setStateList on off
|
||||
attr DEVICE jsonMap Dimmer:brightness Power:state
|
||||
set DEVICE attrTemplate speechcontrol_type_light_255
|
||||
attr DEVICE model tasmota_zigbee2tasmota_light_dimmer
|
||||
setreading DEVICE attrTemplateVersion 20200716
|
||||
setreading DEVICE attrTemplateVersion 20200718
|
||||
|
||||
|
||||
|
||||
@ -2222,7 +2225,7 @@ attr DEVICE setList\
|
||||
white_on:colorpicker,BRI,0,1,100 shellies/DEVNAME/color/0/set {"turn":"on","white":"$EVTPART1"}\
|
||||
gain_on:colorpicker,BRI,0,1,100 shellies/DEVNAME/color/0/set {"turn":"on","gain":"$EVTPART1"}\
|
||||
rgb_on:colorpicker,RGB {$EVTPART1=~/(..)(..)(..)/;if($1 ne $2 || $2 ne $3) {"shellies/DEVNAME/color/0/set {\"turn\":\"on\",\"mode\":\"color\",\"gain\":\"100\",\"red\":".hex($1).",\"green\":".hex($2).",\"blue\":".hex($3)."}"}else{"shellies/DEVNAME/color/0/set {\"turn\":\"on\",\"mode\":\"white\",\"brightness\":".int(hex($1)/2.55)."}"}}\
|
||||
effect:select,0,1,2,3 shellies/DEVNAME/color/0/set {"effect":"$EVTPART1"}\
|
||||
effect:selectnumbers,0,1,6,0,lin shellies/DEVNAME/color/0/set {"effect":"$EVTPART1"}\
|
||||
x_update:noArg shellies/DEVNAME/command update_fw\
|
||||
x_mqttcom shellies/DEVNAME/command $EVTPART1
|
||||
deletereading -q DEVICE status_.*
|
||||
@ -3583,56 +3586,7 @@ setreading DEVICE attrTemplateVersion 20200603
|
||||
|
||||
|
||||
name:sonos2mqtt_speaker
|
||||
desc:A sonos2mqtt speaker device without input selector. Suitable e.g. for Sonos Play 1 and Sonos Play One
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
order:M_05a
|
||||
par:BASE_TOPIC;base topic set in configuration.yaml of the sonos2mqtt bridge;{ AttrVal("DEVICE","devicetopic",AttrVal("DEVICE","readingList","")) =~ m,[\b]?([^\/:]+)[\/].+, ? $1 : undef }
|
||||
par:DEV_ID;techname of the device ;{ AttrVal("DEVICE","readingList","") =~ m,[^\/]+[\/](RINCON_[0-9A-Z]+):.*, ? $1 : undef }
|
||||
par:ALIAS;friendly name as set in sonos gadget itself;{ ReadingsVal("DEVICE","name","unknown") }
|
||||
par:DEVNAME;friendly name, used for topic in lowercase;{ lc(ReadingsVal("DEVICE","name","unknown")) }
|
||||
par:ICON;ICON as set, defaults to audio_volume_low;{ AttrVal("DEVICE","icon","audio_volume_low") }
|
||||
attr DEVICE icon ICON
|
||||
attr DEVICE alias ALIAS
|
||||
attr DEVICE jsonMap volume_Master:volume mute_Master:mute transportState:state
|
||||
attr DEVICE devStateIcon 0:10px-kreis-rot 1:10px-kreis-gelb 2:10px-kreis-gruen (0|1).(STOPPED|PAUSED_PLAYBACK):rc_BLANK 2.(STOPPED|PAUSED_PLAYBACK):rc_PLAY@green:play 2.(pause|stop):rc_STOP@red:play 2.PLAYING:rc_STOP@red:stop 2.(TRANSITIONING|play):rc_PLAY@yellow:stop 2.mute:audio_volume_mute@yellow:stop 2.volume:audio_volume_mid@yellow:stop 2.volumeDown:audio_volume_low@yellow:stop 2.volumeUp:audio_volume_high@yellow:stop 2.next:rc_NEXT@yellow:stop 2.previous:rc_PREVIOUS@yellow:stop (STOPPED|PAUSED_PLAYBACK).(false|previous|next|volumeDown|volumeUp|[0-9]+|CURRENT.*|NEXT.*|PAUSED_PLAYBACK):rc_BLANK \b(?!(STOPPED|PAUSED_PLAYBACK)\b)\w+.previous:rc_PREVIOUS:previous \b(?!(STOPPED|PAUSED_PLAYBACK)\b)\w+.next:rc_NEXT:next \b(?!(STOPPED|PAUSED_PLAYBACK)\b)\w+.volumeDown:rc_VOLDOWN:volumeDown \b(?!(STOPPED|PAUSED_PLAYBACK)\b)\w+.volumeUp:rc_VOLUP:volumeUp \b(?!(STOPPED|PAUSED_PLAYBACK)\b)\w+.false:rc_VOLUP:mute+true \b(?!(STOPPED|PAUSED_PLAYBACK)\b)\w+.true:rc_MUTE:mute+false
|
||||
attr DEVICE readingList\
|
||||
BASE_TOPIC/status/DEVNAME/avtransport:.* { json2nameValue($EVENT,'AV_',$JSONMAP) }\
|
||||
BASE_TOPIC/status/DEVNAME/renderingcontrol:.* { json2nameValue($EVENT,'REND_',$JSONMAP) }\
|
||||
BASE_TOPIC/DEV_ID:.* { json2nameValue($EVENT,'',$JSONMAP) }\
|
||||
BASE_TOPIC/connected:.* bridgeConnected\
|
||||
BASE_TOPIC/DEV_ID/error:.* { json2nameValue($EVENT) }
|
||||
attr DEVICE setList\
|
||||
stop:noArg BASE_TOPIC/DEV_ID/control { "command": "stop" }\
|
||||
play:noArg BASE_TOPIC/DEV_ID/control { "command": "play" }\
|
||||
pause:noArg BASE_TOPIC/DEV_ID/control { "command": "pause" }\
|
||||
toggle:noArg BASE_TOPIC/DEV_ID/control { "command": "toggle" }\
|
||||
volumeUp:noArg BASE_TOPIC/DEV_ID/control { "command": "volumeup" }\
|
||||
volumeDown:noArg BASE_TOPIC/DEV_ID/control { "command": "volumedown" }\
|
||||
volume:slider,0,1,100 BASE_TOPIC/DEV_ID/control { "command": "volume", "input": $EVTPART1 }\
|
||||
mute:iconSwitch,false,rc_MUTE,true,rc_VOLUP { my $value = $EVTPART1 eq "true" ? "mute" : "unmute";; qq(BASE_TOPIC/DEV_ID/control { "command": "$value" } ) }\
|
||||
next:noArg BASE_TOPIC/DEV_ID/control { "command": "next" }\
|
||||
previous:noArg BASE_TOPIC/DEV_ID/control { "command": "previous" }\
|
||||
joinGroup:textField BASE_TOPIC/DEV_ID/control { "command": "joingroup", "input": "$EVTPART1"}\
|
||||
leaveGroup:noArg { my $value = ReadingsVal("DEV_ID","groupName","all"); qq(BASE_TOPIC/DEV_ID/control { "command": "leavegroup", "input": "$value" } ) }\
|
||||
setAVTUri:textField BASE_TOPIC/DEV_ID/control { "command": "setavtransporturi", "input": "$EVTPART1"}\
|
||||
notify:textField BASE_TOPIC/DEV_ID/control { "command":"notify","input":{"trackUri":"$EVTPART2","onlyWhenPlaying":false,"timeout":10,"volume":$EVTPART1,"delayMs":700}}\
|
||||
x_raw_payload:textField { my $payload = $EVENT;$payload =~ s/$EVTPART0 //g; qq(BASE_TOPIC/DEV_ID/control $payload)}
|
||||
attr DEVICE stateFormat [$name:bridgeConnected]\
|
||||
[$name:bridgeConnected].[$name:state]\
|
||||
[$name:state].previous\
|
||||
[$name:state].next\
|
||||
[$name:state].volumeDown\
|
||||
[$name:state].volumeUp\
|
||||
\
|
||||
[$name:state].[$name:mute]\
|
||||
<br>[$name:state] CURRENT: [$name:AV_CurrentTrackMetaData_Artist] - [$name:AV_CurrentTrackMetaData_Title] - ([$name:currentTrack_Duration])\
|
||||
<br>[$name:state] NEXT: [$name:AV_NextTrackMetaData_Artist] - [$name:AV_NextTrackMetaData_Title] - ([$name:nextTrack_Duration])
|
||||
attr DEVICE model sonos2mqtt_speaker
|
||||
setreading DEVICE attrTemplateVersion 20200621
|
||||
|
||||
|
||||
name:sonos2mqtt_linein_speaker
|
||||
desc:A sonos2mqtt speaker device with input choice option like
|
||||
desc:A basic sonos2mqtt speaker device
|
||||
filter:TYPE=MQTT2_DEVICE
|
||||
order:M_05b
|
||||
par:BASE_TOPIC;base topic set in configuration.yaml of the sonos2mqtt bridge;{ AttrVal("DEVICE","devicetopic",AttrVal("DEVICE","readingList","")) =~ m,[\b]?([^\/:]+)[\/].+, ? $1 : undef }
|
||||
@ -3643,29 +3597,28 @@ par:ICON;ICON as set, defaults to audio_volume_low;{ AttrVal("DEVICE","icon","au
|
||||
attr DEVICE icon ICON
|
||||
attr DEVICE jsonMap volume_Master:volume mute_Master:mute transportState:state
|
||||
attr DEVICE readingList\
|
||||
BASE_TOPIC/status/DEVNAME/avtransport:.* { json2nameValue($EVENT,'AV_',$JSONMAP) }\
|
||||
BASE_TOPIC/status/DEVNAME/renderingcontrol:.* { json2nameValue($EVENT,'REND_',$JSONMAP) }\
|
||||
BASE_TOPIC/DEV_ID:.* { json2nameValue($EVENT,'',$JSONMAP) }
|
||||
attr DEVICE setList\
|
||||
stop:noArg BASE_TOPIC/DEV_ID/control { "command": "stop" }\
|
||||
play:noArg BASE_TOPIC/DEV_ID/control { "command": "play" }\
|
||||
pause:noArg BASE_TOPIC/DEV_ID/control { "command": "pause" }\
|
||||
toggle:noArg BASE_TOPIC/DEV_ID/control { "command": "toggle" }\
|
||||
volumeUp:noArg BASE_TOPIC/DEV_ID/control { "command": "volumeup" }\
|
||||
volumeDown:noArg BASE_TOPIC/DEV_ID/control { "command": "volumedown" }\
|
||||
input:Queue,TV,Line_In { my $value = $EVTPART1 eq "Queue" ? "queue" : $EVTPART1 eq "TV" ? "tv" : "line";; qq(sonos/RINCON_7828CAF4289001400/control { "command": "switchto$value" } ) }\
|
||||
volumeup:noArg BASE_TOPIC/DEV_ID/control { "command": "volumeup" }\
|
||||
volumedown:noArg BASE_TOPIC/DEV_ID/control { "command": "volumedown" }\
|
||||
volume:slider,0,1,100 BASE_TOPIC/DEV_ID/control { "command": "volume", "input": $EVTPART1 }\
|
||||
mute:on,off { my $value = $EVTPART1 eq "on" ? "mute" : "unmute"; qq(BASE_TOPIC/DEV_ID/control { "command": "$value" } ) }\
|
||||
next:noArg BASE_TOPIC/DEV_ID/control { "command": "next" }\
|
||||
previous:noArg BASE_TOPIC/DEV_ID/control { "command": "previous" }\
|
||||
x_raw_payload:textField { my $payload = $EVENT;$payload =~ s/$EVTPART0 //g; qq(BASE_TOPIC/DEV_ID/control $payload)}\
|
||||
joinGroup:textField BASE_TOPIC/DEV_ID/control { "command": "joingroup", "input": "$EVTPART1"}\
|
||||
leaveGroup:noArg { my $value = ReadingsVal("DEV_ID","groupName","all"); qq(BASE_TOPIC/DEV_ID/control { "command": "leavegroup", "input": "$value" } ) }\
|
||||
setAVTUri:textField BASE_TOPIC/DEV_ID/control { "command": "setavtransporturi", "input": "$EVTPART1"}\
|
||||
notify:textField BASE_TOPIC/DEV_ID/control { "command":"notify","input":{"trackUri":"$EVTPART2","onlyWhenPlaying":false,"timeout":10,"volume":$EVTPART1,"delayMs":700}}
|
||||
attr DEVICE model sonos2mqtt_linein_speaker
|
||||
playUri:textField {fhem("set $NAME setAVTUri $EVTPART1; sleep 1; set $NAME play")}\
|
||||
input:Queue { my $value = $EVTPART1 eq "TV" ? "tv" : $EVTPART1 eq "Line_In" ? "line" : "queue"; qq(BASE_TOPIC/DEV_ID/control { "command": "switchto$value" } ) }\
|
||||
notify:textField BASE_TOPIC/DEV_ID/control { "command":"notify","input":{"trackUri":"$EVTPART2","onlyWhenPlaying":false,"timeout":10,"volume":$EVTPART1,"delayMs":700}}\
|
||||
x_raw_payload:textField { my $payload = $EVENT;$payload =~ s/$EVTPART0 //g; qq(BASE_TOPIC/DEV_ID/control $payload)}
|
||||
attr DEVICE model sonos2mqtt_speaker
|
||||
attr DEVICE alias ALIAS
|
||||
setreading DEVICE attrTemplateVersion 20200621
|
||||
setreading DEVICE attrTemplateVersion 20200717
|
||||
|
||||
|
||||
###########################################
|
||||
|
Loading…
Reference in New Issue
Block a user