Guten Abend
nachdem der in der Garage stehende Tiefkühler plötzlich an der Steckdose keine Strom mehr hatte (Doppelsteckdose für 2 Kühler - eine davon defekt) und ich zum Glück den Inhalt noch rechtzeitig retten konnte, habe ich nun für jeden Tiefkühler einen Shelly Plug_s dazwischen gesteckt.
Ich habe das Template Shelly_1_w_engery_meassuring gewählt.
Nun habe ich bei einem beim Reading relay_0_power werte stehen und beim anderen steht nur 0.00
Mein Ziel wäre es, mit einem DOIF bei Unterschreiten von z.B. 1 eine Meldung zu versenden. Natürlich kann ich auf on/off
die Meldung absetzten.
Eine Idee, wo hier der Fehler liegen kann?
Hänge mal von jedem Shelly ein List an.
Ohne Power:
Code
Internals: CID shellyplug_s_266FC0 DEF shellyplug_s_266FC0 DEVICETOPIC KuehlGefrierKombi FUUID 5decf5b8-f33f-b033-da6b-c838f2ba063ea4b3 IODev myBroker LASTInputDev myBroker MSGCNT 717 NAME KuehlGefrierKombi NR 516 STATE on TYPE MQTT2_DEVICE myBroker_MSGCNT 717 myBroker_TIME 2019-12-08 18:38:14 READINGS: 2019-12-08 17:39:43 fw_ver 20191127-095857/v1.5.6@0d769d69 2019-12-08 17:39:43 id shellyplug-s-266FC0 2019-12-08 17:39:43 ip 10.0.0.85 2019-12-08 17:36:28 loadState off 2019-12-08 17:39:43 mac 2CF432266FC0 2019-12-08 17:39:43 new_fw false 2019-12-08 17:39:43 online true 2019-12-08 18:38:14 overtemperature 0 2019-12-08 18:38:14 relay0 on 2019-12-08 18:38:14 relay_0_energy 1095 2019-12-08 18:38:14 relay_0_kWh 0.02 2019-12-08 18:38:14 relay_0_power 0.00 2019-12-08 18:38:14 state on 2019-12-08 18:38:14 temperature 19.06 2019-12-08 18:38:14 temperature_f 66.30
Attributes: IODev myBroker comment To get appropriate loadState values: Change the default limit "100" in readingList to your needs. devStateIcon {my $onl = ReadingsVal($name,"online","false") eq "true"?"10px-kreis-gruen":"10px-kreis-rot";; my $light = ReadingsVal($name,"state","off");; my $cons = ReadingsVal($name,"relay_0_power","unknown");; my $total = ReadingsVal($name,"relay_0_kWh","unknown");; my $temp = ReadingsVal($name,"temperature","-100");;"<a href=\"http://".ReadingsVal($name,"ip","none")." \"target=\"_blank\">".FW_makeImage($onl)."</a> <a href=\"/fhem?cmd.dummy=set $name toggle&XHR=1\">".FW_makeImage($light)."</a><div>Verbrauch: $cons / Total: $total/ Temp: $temp °C</div>"} getList power:noArg shellies/shellyplug-s-266FC0/relay/power power model shelly1_w_energy_meassuring readingList shellies/shellyplug-s-266FC0/relay/0:.* state shellies/shellyplug-s-266FC0/relay/0:.* relay0 shellies/shellyplug-s-266FC0/input/0:.* input0 shellies/shellyplug-s-266FC0/online:.* online shellies/announce:.* { $EVENT =~ m,..id...shellyplug-s-266FC0...mac.*, ? json2nameValue($EVENT) : undef } shellies/shellyplug-s-266FC0/announce:.* { json2nameValue($EVENT) } shellies/shellyplug-s-266FC0/relay/0/power:.* relay_0_power shellies/shellyplug-s-266FC0/relay/0/power:.* { my $compare = $EVTPART0 < 100 ? "off":"on"; ReadingsVal($NAME,"loadState","off") ne $compare ? { 'loadState' => $compare } : undef } shellies/shellyplug-s-266FC0/temperature:.* temperature shellies/shellyplug-s-266FC0/overtemperature:.* overtemperature shellies/shellyplug-s-266FC0/relay/0/energy:.* relay_0_energy shellies/shellyplug-s-266FC0/relay/0/energy:.* {'relay_0_kWh' => sprintf("%.2f",$EVENT/60/1000)} shellies/shellyplug-s-266FC0/longpush/0:.* longpush_0
shellyplug_s_266FC0:shellies/shellyplug-s-266FC0/temperature_f:.* temperature_f room Favoriten,Garage,MQTT2_DEVICE setList relay0:on,off,toggle shellies/shellyplug-s-266FC0/relay/0/command $EVTPART1 off:noArg shellies/shellyplug-s-266FC0/relay/0/command off on:noArg shellies/shellyplug-s-266FC0/relay/0/command on x_update:noArg shellies/shellyplug-s-266FC0/command update_fw x_mqttcom shellies/shellyplug-s-266FC0/command $EVTPART1 webCmd :
Mit richtiger Anzeige
Code
Internals: CID shellyplug_s_268497 DEF shellyplug_s_268497 DEVICETOPIC Tiefkuehler FUUID 5decf781-f33f-b033-ffe1-e9b5216c82f00302 IODev myBroker LASTInputDev myBroker MSGCNT 743 NAME Tiefkuehler NR 518 STATE on TYPE MQTT2_DEVICE myBroker_MSGCNT 743 myBroker_TIME 2019-12-08 18:39:50 READINGS: 2019-12-08 17:39:43 fw_ver 20191127-095857/v1.5.6@0d769d69 2019-12-08 17:39:43 id shellyplug-s-268497 2019-12-08 17:39:43 ip 10.0.0.86 2019-12-08 18:31:30 loadState off 2019-12-08 17:39:43 mac 2CF432268497 2019-12-08 17:39:43 new_fw false 2019-12-08 17:39:43 online true 2019-12-08 18:39:50 overtemperature 0 2019-12-08 18:39:50 relay0 on 2019-12-08 18:39:50 relay_0_energy 9385 2019-12-08 18:39:50 relay_0_kWh 0.16 2019-12-08 18:39:50 relay_0_power 76.81 2019-12-08 18:39:50 state on 2019-12-08 18:39:50 temperature 20.49 2019-12-08 18:39:50 temperature_f 68.89
Attributes: IODev myBroker comment To get appropriate loadState values: Change the default limit "100" in readingList to your needs. devStateIcon {my $onl = ReadingsVal($name,"online","false") eq "true"?"10px-kreis-gruen":"10px-kreis-rot";; my $light = ReadingsVal($name,"state","off");; my $cons = ReadingsVal($name,"relay_0_power","unknown");; my $total = ReadingsVal($name,"relay_0_kWh","unknown");; my $temp = ReadingsVal($name,"temperature","-100");;"<a href=\"http://".ReadingsVal($name,"ip","none")." \"target=\"_blank\">".FW_makeImage($onl)."</a> <a href=\"/fhem?cmd.dummy=set $name toggle&XHR=1\">".FW_makeImage($light)."</a><div>Verbrauch: $cons / Total: $total/ Temp: $temp °C</div>"} model shelly1_w_energy_meassuring readingList shellies/shellyplug-s-268497/relay/0:.* state shellies/shellyplug-s-268497/relay/0:.* relay0 shellies/shellyplug-s-268497/input/0:.* input0 shellies/shellyplug-s-268497/online:.* online shellies/announce:.* { $EVENT =~ m,..id...shellyplug-s-268497...mac.*, ? json2nameValue($EVENT) : undef } shellies/shellyplug-s-268497/announce:.* { json2nameValue($EVENT) } shellies/shellyplug-s-268497/relay/0/power:.* relay_0_power shellies/shellyplug-s-268497/relay/0/power:.* { my $compare = $EVTPART0 < 100 ? "off":"on"; ReadingsVal($NAME,"loadState","off") ne $compare ? { 'loadState' => $compare } : undef } shellies/shellyplug-s-268497/temperature:.* temperature shellies/shellyplug-s-268497/overtemperature:.* overtemperature shellies/shellyplug-s-268497/relay/0/energy:.* relay_0_energy shellies/shellyplug-s-268497/relay/0/energy:.* {'relay_0_kWh' => sprintf("%.2f",$EVENT/60/1000)} shellies/shellyplug-s-268497/longpush/0:.* longpush_0
shellyplug_s_268497:shellies/shellyplug-s-268497/temperature_f:.* temperature_f room Favoriten,Garage,MQTT2_DEVICE setList relay0:on,off,toggle shellies/shellyplug-s-268497/relay/0/command $EVTPART1 off:noArg shellies/shellyplug-s-268497/relay/0/command off on:noArg shellies/shellyplug-s-268497/relay/0/command on x_update:noArg shellies/shellyplug-s-268497/command update_fw x_mqttcom shellies/shellyplug-s-268497/command $EVTPART1 webCmd :
Schönen Abend
Helmut