2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-25 03:44:52 +00:00

mqtt2.template: change shellyPlus_2pm_split, #140771

git-svn-id: https://svn.fhem.de/fhem/trunk@29655 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Beta-User 2025-02-13 21:38:58 +00:00
parent 9d9a5225bc
commit 312c9c3582

View File

@ -3793,6 +3793,7 @@ attr DEVICE devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'fals
attr DEVICE readingList $\DEVICETOPIC/online:.* online\ attr DEVICE readingList $\DEVICETOPIC/online:.* online\
$\DEVICETOPIC/events/rpc:.* { return if $EVENT =~ m{switch:[1-3]}; $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT,'',$JSONMAP) }\ $\DEVICETOPIC/events/rpc:.* { return if $EVENT =~ m{switch:[1-3]}; $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT,'',$JSONMAP) }\
$\DEVICETOPIC/status/switch.0:.* { json2nameValue($EVENT, '', $JSONMAP) }\ $\DEVICETOPIC/status/switch.0:.* { json2nameValue($EVENT, '', $JSONMAP) }\
$\DEVICETOPIC/status/input.0:.* { $EVENT =~ s/"state":true/"input":"on"/g; $EVENT =~ s/"state":false/"input":"off"/g;json2nameValue($EVENT, '', $JSONMAP) }\
$\DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, '', $JSONMAP) }\ $\DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, '', $JSONMAP) }\
fhem2shelly/rpc:.* {} fhem2shelly/rpc:.* {}
attr DEVICE setList toggle:noArg $\DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}\ attr DEVICE setList toggle:noArg $\DEVICETOPIC/rpc {"id":1,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}\
@ -3809,7 +3810,8 @@ deleteattr DEVICE_CH# stateFormat
attr DEVICE_CH# devStateIcon { my $light = FW_makeImage(ReadingsVal($name,'state','off')); my $cons = ReadingsNum($name,'apower',0); my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);qq(<a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwhC</div>) } attr DEVICE_CH# devStateIcon { my $light = FW_makeImage(ReadingsVal($name,'state','off')); my $cons = ReadingsNum($name,'apower',0); my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);qq(<a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwhC</div>) }
attr DEVICE_CH# jsonMap params_switch_#_state:state params_switch_#_aenergy_total:aenergy_total params_switch_#_apower:apower params_switch_#_temperature_tC:temperature params_switch_#_temperature_tF:0 temperature_tC:temperature temperature_tF:0 attr DEVICE_CH# jsonMap params_switch_#_state:state params_switch_#_aenergy_total:aenergy_total params_switch_#_apower:apower params_switch_#_temperature_tC:temperature params_switch_#_temperature_tF:0 temperature_tC:temperature temperature_tF:0
attr DEVICE_CH# readingList $\DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:#}; $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT,'',$JSONMAP) }\ attr DEVICE_CH# readingList $\DEVICETOPIC/events/rpc:.* { return if $EVENT !~ m{switch:#}; $EVENT =~ s/"output":true/"state":"on"/g; $EVENT =~ s/"output":false/"state":"off"/g; json2nameValue($EVENT,'',$JSONMAP) }\
$\DEVICETOPIC/status/switch.#:.* { json2nameValue($EVENT, '', $JSONMAP) } $\DEVICETOPIC/status/switch.#:.* { json2nameValue($EVENT, '', $JSONMAP) }\
$\DEVICETOPIC/status/input.#:.* { $EVENT =~ s/"state":true/"input":"on"/g; $EVENT =~ s/"state":false/"input":"off"/g;json2nameValue($EVENT, '', $JSONMAP) }
attr DEVICE_CH# setList toggle:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":#}}\ attr DEVICE_CH# setList toggle:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":#}}\
off:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":#,"on":false}}\ off:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":#,"on":false}}\
on:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":#,"on":true}}\ on:noArg $\DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":#,"on":true}}\
@ -3824,7 +3826,7 @@ attr DEVICE_CH# devicetopic DEV_TPC
loop:END loop:END
set DEVICE attrTemplate set_associatedWith \CHANNELS=2 set DEVICE attrTemplate set_associatedWith \CHANNELS=2
set DEVICE,DEVICE_CH2 attrTemplate speechcontrol_type_switch set DEVICE,DEVICE_CH2 attrTemplate speechcontrol_type_switch
setreading DEVICE,DEVICE_CH2 attrTemplateVersion 20230927 setreading DEVICE,DEVICE_CH2 attrTemplateVersion 20250213
attr DEVICE,DEVICE_CH2 model shellyPlus_2pm_split attr DEVICE,DEVICE_CH2 model shellyPlus_2pm_split
# Shelly Plus 2 PM using original firmware in roller mode. # Shelly Plus 2 PM using original firmware in roller mode.