[gelöst] Shelly Plus 1 - Anbindung

Begonnen von smoudo, 26 Dezember 2021, 15:58:21

Vorheriges Thema - Nächstes Thema

smoudo

Moin,

ich habe mit einem frisch installierten Shelly Plus 1 der mir die Außensteckdose schaltet Anbindungsprobleme. Das Shelly FHEM Modul scheint mit der neuen Generation nicht zu funktionieren. Schalten lässt es sich zwar, aber state ist immer auf Error, Passwortabfrage funktioniert nicht, etc.

Jetzt suche ich nach Alternativen Anbindemöglichkeiten.

-MQTT habe ich noch nicht am laufen, sollte aber aufgrund der Gerätezahl die mittlerweile da ist in betracht gezogen werden. (kostet halt einarbeitungszeit) wie sieht es da mit autocreate bei shelly 1 aus? Wiki ist an der stelle er rudimentär :)

-Andere Firnware flashen, ESPeasy habe ich auf etlichen ESP8266 am laufen. Ob es das für den ESP 32 gibt? Muss ich recharchieren! funktioniert auf vielen Geräten problemlos. (müsste ich das teil aber nochmal aus der Dose bauen) Zulassungstechnisch dürfte das auch eine dunkelgrauzone sein.

Wie habt Ihr das Problem gelöst?

Viele grüße

Matze

reibuehl

Hallo,

autocreate sollte mit dem FHEM internen MQTT2Server funktionieren. Im MQTT2_DEVICE gibt es auch schon ein Template für den Shelly Plus 1.

Gruß,
Reiner
Reiner.

vic

Guten Tag Community.
Ich habe zwei Shelly Plus 1 im Einsatz. Die Anbindung an MQTT2-Server funktionierte problemlos. Nach dem Anlernen an FHEM musste ich lediglich die Shellys kurz vom Netz trennen und wieder anschliessen. Somit zeigt das Shelly den Status Aktiv oder Nicht-Aktiv an (grüner oder roter Punkt). Das Shelly lässt sich schalten.
Einzig die Statusrückmeldung scheint nicht wie gewohnt zu klappen.

Habt ihr ähnliche Erfahrungen getätigt?

Anbei das Listing:


Internals:
   CFGFN      ./FHEM/fhem_020_Erdgeschoss.cfg
   CID        shellyplus1_a8032abcd5e8
   DEF        shellyplus1_a8032abcd5e8
   DEVICETOPIC shellyplus1-a8032abcd5e8
   FUUID      61bf3776-f33f-0f0b-0601-94a5f78e1f0867d0
   IODev      MQTT2
   LASTInputDev MQTT2
   MQTT2_CONN MQTT2_192.168.10.149_56587
   MQTT2_MSGCNT 3
   MQTT2_TIME 2021-12-27 02:01:12
   MSGCNT     3
   NAME       SH_AKT_149_AntiMuecken
   NR         227
   STATE      off
   TYPE       MQTT2_DEVICE
   JSONMAP:
     params_switch_0_aenergy_total aenergy_total
     params_switch_0_apower apower
     params_wifi_sta_ip ip
     temperature_tC temperature
     temperature_tF 0
   READINGS:
     2021-12-27 02:00:28   IODev           MQTT2
     2021-12-20 07:39:26   attrTemplateVersion 20211128
     2021-12-27 02:01:12   dst             shellyplus1-a8032abcd5e8/events
     2021-12-27 01:50:00   id              0
     2021-12-22 15:40:50   ip              192.168.10.149
     2021-12-27 02:01:12   method          NotifyStatus
     2021-12-27 02:01:12   online          true
     2021-12-22 15:39:15   params_events_1_cfg_rev 4
     2021-12-22 15:39:15   params_events_1_component wifi
     2021-12-22 15:39:15   params_events_1_event config_changed
     2021-12-22 15:39:15   params_events_1_restart_required false
     2021-12-22 15:39:15   params_events_1_ts 1640183955.63
     2021-12-27 02:01:12   params_mqtt_connected false
     2021-12-27 01:50:39   params_switch_0_id 0
     2021-12-27 01:00:23   params_switch_0_output false
     2021-12-27 01:00:23   params_switch_0_source MQTT
     2021-12-27 01:50:39   params_switch_0_temperature_tC 52.18
     2021-12-27 01:50:39   params_switch_0_temperature_tF 125.92
     2021-12-26 15:40:53   params_sys_available_updates_beta_version 0.9.2-beta2
     2021-12-27 02:01:12   params_ts       1640566802.86
     2021-12-22 15:40:50   params_wifi_rssi -55
     2021-12-22 15:40:50   params_wifi_ssid Lienta_01
     2021-12-22 15:40:50   params_wifi_status got ip
     2021-12-27 01:50:00   result_was_on   false
     2021-12-27 02:01:12   src             shellyplus1-a8032abcd5e8
     2021-12-27 01:50:00   state           off
Attributes:
   alias      Anti-Mücken 1
   devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = ReadingsVal($name,'switch_0_output','false') =~ m{false|off}?'off':'on';; $light = FW_makeImage($light);; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a>)}
   devicetopic shellyplus1-a8032abcd5e8
   event-on-change-reading .*
   group      Sommer
   icon       message_socket
   jsonMap    params_switch_0_aenergy_total:aenergy_total params_switch_0_apower:apower temperature_tC:temperature temperature_tF:0 params_wifi_sta_ip:ip
   model      shellyPlus_1
   readingList $DEVICETOPIC/online:.* online
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }
shellyplus1_a8032abcd5e8:fhem/rpc:.* { json2nameValue($EVENT) }
   room       MQTT2_DEVICE
   setList    toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}
   webCmd     :


Grüsse
Claudio
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

smoudo

probier mal im attribut devStateIcon
on:rc_GREEN:off off:rc_RED:on absent:rc_BLUE:off Error:rc_YELLOW:off

on, off, geht damit ohne probleme. ob absend oder Error im state angezeigt wird muss ich selber noch testen.
Optisch hab ich das ganze an meine Sonoffs angepasst. Die icons kannst du aber auch ändern.

Viele Grüße

Matze

Ps.: hab jetzt mal mttq2 aufgesetzt.  bislang problemlos.

vic

Vielen Dank für die rasche Antwort matze

Mit deinem devStateIcon-Eintrag funktioniert es. Leider kann wird dadurch jedoch leider der Anbindungszustand (online, offline fw-update) nicht angezeigt (Siehe Bilder).

Ich versuche schon seit einiger Zeit die Geheimnisse der devStateIcon-Parameter zu begreifen, leider ohne Erfolg. Anbei nochmals die Settings des devStateIcon - Dort wird der Anbindungszustand gezeigt, der Status (true|on oder false|off) jedoch leider nicht.


{my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = ReadingsVal($name,'switch_0_output','false') =~ m{false|off}?'off':'on';; $light = FW_makeImage($light);; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a>)}


Danke für eure Hilfe

Claudio
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

enno

{my $onl = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen"; my $light = ReadingsVal($name,"state","off"); my $show = '<a href="';$show .= $onl eq "gelb" ? "/fhem?cmd.dummy=set $name x_update&XHR=1\">" : "http://".ReadingsVal($name,"ip","none").' "target="_blank">'; $show .= FW_makeImage("10px-kreis-".$onl)."</a>"; "<div> $show <a href=\"/fhem?cmd.dummy=set $name toggle&XHR=1\">".FW_makeImage($light)."</a></div>" }

Zeigt das bei meinem Shelly 1 Plus so an.

Gruss
  Enno
Einfacher FHEM Anwender auf Intel®NUC

vic

Super vielen Dank für deine Antwort Enno

So wie ich es erkenne benützt du das Template das Shelly 1. Das funktioniert sehr gut wenn ich set shelly on oder set shelly off betätige.
Wenn ich mit dem Symbol direkt on oder off wähle wechselt das Icon wie im Bild und bleibt so erhalten.

Dabei habe ich festgestellt, dass wenn man set shelly on setzt das Reading params_switch_0_ouput false zurückgibt und umgekehrt. Der Aktor jedoch schaltet korrekt. Dies stört mich jedoch nicht solange das Shelly korrekt schaltet.


Vielen Dank für eure Hilfe
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

smoudo

@enno
wenn ich das so bei devstateicon hinterlege zeigt es bei mir nur "on" an. war das der original template code?
ich versucg das später mit meinen icons nochmal umzubauen. das mit dem zusäzlichen punkt bei softwareupdate finde ich sehr nice!

viele grüße

Matze

vic

Interessant... Bei mir zeigt es toggle an und bleibt so ... (wenn ich auf das icon klicke)
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

87insane

defmod MQTT2_shellyplus1pm_7c87ce657e74 MQTT2_DEVICE shellyplus1pm_7c87ce657e74
attr MQTT2_shellyplus1pm_7c87ce657e74 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = ReadingsVal($name,'output','false') =~ m{false|off}?'off':'on';; $light = FW_makeImage($light);; my $cons = ReadingsNum($name,'apower',0);; my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);; my $temp = ReadingsVal($name,'temperature','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1pm_7c87ce657e74 devicetopic shellyplus1pm-7c87ce657e74
attr MQTT2_shellyplus1pm_7c87ce657e74 event-on-change-reading .*
attr MQTT2_shellyplus1pm_7c87ce657e74 genericDeviceType switch
attr MQTT2_shellyplus1pm_7c87ce657e74 jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1pm_7c87ce657e74 model shellyPlus_1pm
attr MQTT2_shellyplus1pm_7c87ce657e74 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  fhem/rpc:.* { json2nameValue($EVENT,'rpc_',$JSONMAP) }
attr MQTT2_shellyplus1pm_7c87ce657e74 room MQTT2_DEVICE
attr MQTT2_shellyplus1pm_7c87ce657e74 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}

setstate MQTT2_shellyplus1pm_7c87ce657e74 toggle
setstate MQTT2_shellyplus1pm_7c87ce657e74 2021-12-24 11:42:44 aenergy_total 0.000
setstate MQTT2_shellyplus1pm_7c87ce657e74 2021-12-24 11:42:00 apower 0.0
setstate MQTT2_shellyplus1pm_7c87ce657e74 2021-12-24 11:43:38 dst shellyplus1pm-7c87ce657e74/events


Hey zusammen. Ich hab das nur überflogen. Aber so geht alles. Strittig ist noch das fhem/rpc reading. Aber das steht alles in dem Shelly Template Thread. Der von mir grade kopierte shelly ist aktuell nicht am Strom. Also nicht wundern.

Gruß,
87insane

smoudo

Das ist wie oben beschrieben. Das zeigt bei mir zwar die punkte farbig an, beim toggle ändert sich aber das icon nicht. Schaltvorgang wird aber durchgeführt.
kann man das reading "online" irgendwie als wert present oder absent in state bekommen? bzw. ein presence reading erzeugen? Eine Anzeige ob das teil offline oder online ist, währe schon fein.
Diese Details machen mich noch Irre!

Viele Grüße

Matze

vic

Danke für den Beitrag 87insane

Leider funktionieren die Icons, wie bereits von Matze beschrieben, nicht ordnungsgemäss. Sie bleiben immer auf off egal wie man schaltet.
Da kommt der Einsatz des Shelly 1-Templates (Post von Enno) dem gewünschten Ergebnis näher. Einziger Nachteil dort - man kann nicht mittels Klick auf Icon schalten sondern mit den Befehlen set Shelly on und set Shelly off (also kein webCmd :    )

Grüsse
Claudio
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

87insane

Habt ihr auch die jsonmap angepasst ? Bei mir schaltet so alles und wird auch als online angezeigt. Wie sind die mqtt Einstellungen im shelly?

Gruß,
87insane

vic

Die jsonmap wurde angepasst. Leider ohne Erfolg. Ich verwende das Shelly Plus 1 (nicht 1pm).

Es funktioniert ja eigentlich alles. Nur das Icon (devStateIcon) will einfach nicht umschalten  >:(
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

87insane

Also der Punkt ist abhängig vom reading Inhalt. Setz mal bitte noch generic... Im shelly auf on. Das ist normal auch an. Danach sollte es rein laufen. Wenn nicht. Poste bitte nochmal deine readingslist. Es muss ja einen unterschied zu meiner geben.

Oder am besten ein aktuelles RAW. Es ist egal ob pm oder nicht. Der eine kann nur mehr. Aber online/offline kommt bei beiden via mqtt. Ich bin gespannt...

Gruß,
87insane

vic

Danke 87insane für deine Hilfe und Geduld

Ich hatte bereits auf generic gesetzt mit dem Ergebnis dass keine Kommunikation mehr zwischen Shelly und FHEM  erfolgte.

Anbei mein Listing:


   CFGFN      ./FHEM/fhem_020_Erdgeschoss.cfg
   CID        shellyplus1_a8032abcd5e8
   DEF        shellyplus1_a8032abcd5e8
   DEVICETOPIC shellyplus1-a8032abcd5e8
   FUUID      61bf3776-f33f-0f0b-0601-94a5f78e1f0867d0
   IODev      MQTT2
   LASTInputDev MQTT2
   MQTT2_CONN MQTT2_192.168.10.149_59390
   MQTT2_MSGCNT 6
   MQTT2_TIME 2021-12-28 16:33:33
   MSGCNT     6
   NAME       SH_AKT_149_AntiMuecken
   NR         226
   STATE      on
   TYPE       MQTT2_DEVICE
   JSONMAP:
     params_switch_0_aenergy_total aenergy_total
     params_switch_0_apower apower
     params_wifi_sta_ip ip
     temperature_tC temperature
     temperature_tF 0
   READINGS:
     2021-12-28 14:14:15   IODev           MQTT2
     2021-12-24 11:42:44   aenergy_total   0.000
     2021-12-24 11:42:00   apower          0.0
     2021-12-20 07:39:26   attrTemplateVersion 20211128
     2021-12-28 16:33:33   dst             shellyplus1-a8032abcd5e8/events
     2021-12-28 16:06:57   id              0
     2021-12-28 10:59:36   ip              192.168.10.149
     2021-12-28 16:33:33   method          NotifyStatus
     2021-12-28 10:56:52   mqtt_connected  true
     2021-12-28 14:14:48   online          true
     2021-12-28 11:08:49   params_events_1_cfg_rev 10
     2021-12-28 11:08:49   params_events_1_component input:0
     2021-12-28 11:08:49   params_events_1_event config_changed
     2021-12-28 11:08:49   params_events_1_id 0
     2021-12-28 11:08:49   params_events_1_restart_required false
     2021-12-28 11:08:49   params_events_1_ts 1640686130.02
     2021-12-28 14:14:48   params_mqtt_connected false
     2021-12-28 16:33:33   params_switch_0_id 0
     2021-12-28 16:06:57   params_switch_0_output true
     2021-12-28 16:06:57   params_switch_0_source MQTT
     2021-12-28 16:33:33   params_switch_0_temperature_tC 59.06
     2021-12-28 16:33:33   params_switch_0_temperature_tF 138.30
     2021-12-28 10:59:45   params_sys_available_updates_beta_version 0.9.2-beta2
     2021-12-28 10:58:52   params_sys_restart_required true
     2021-12-28 16:33:33   params_ts       1640705613.51
     2021-12-28 10:59:36   params_wifi_rssi -60
     2021-12-28 10:59:36   params_wifi_ssid Lienta_01
     2021-12-28 10:59:36   params_wifi_status got ip
     2021-12-28 16:06:57   result_was_on   false
     2021-12-28 11:00:03   rpc_dst         fhem
     2021-12-28 11:00:03   rpc_id          0
     2021-12-28 11:00:03   rpc_result_was_on true
     2021-12-28 11:00:03   rpc_src         shellyplus1-a8032abcd5e8
     2021-12-28 16:33:33   src             shellyplus1-a8032abcd5e8
     2021-12-28 16:06:55   state           on
     2021-12-28 10:57:29   switch_0_id     0
     2021-12-28 10:57:29   switch_0_output true
     2021-12-28 10:57:29   switch_0_source MQTT
     2021-12-28 10:57:00   sys_available_updates_beta_version 0.9.2-beta2
     2021-12-28 10:57:00   sys_cfg_rev     6
     2021-12-28 10:57:00   sys_fs_free     241664
     2021-12-28 10:57:00   sys_fs_size     458752
     2021-12-28 10:57:00   sys_mac         A8032ABCD5E8
     2021-12-28 10:57:00   sys_ram_free    181236
     2021-12-28 10:57:00   sys_ram_size    249684
     2021-12-28 10:57:00   sys_restart_required false
     2021-12-28 10:57:00   sys_time        10:57
     2021-12-28 10:57:00   sys_unixtime    1640685420
     2021-12-28 10:57:00   sys_uptime      9
     2021-12-28 10:57:29   temperature     53.5
Attributes:
   alias      Anti-Mücken 1
   comment    devStateIcon:

Original:
{my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = ReadingsVal($name,'switch_0_output','false') =~ m{false|off}?'off':'on';; $light = FW_makeImage($light);; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a>)}

Vorschlag:
on:rc_GREEN:off off:rc_RED:on absent:rc_BLUE:off Error:rc_YELLOW:off

Aktuell:
{my $onl = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen";; my $light = ReadingsVal($name,"state","off");; my $show = '<a href="';;$show .= $onl eq "gelb" ? "/fhem?cmd.dummy=set $name x_update&XHR=1\">" : "http://".ReadingsVal($name,"ip","none").' "target="_blank">';;$show .= FW_makeImage("10px-kreis-".$onl)."</a>";; "<div> $show <a href=\"/fhem?cmd.dummy=set $name toggle&XHR=1\">".FW_makeImage($light)."</a></div>" }
   devStateIcon {my $onl = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen";; my $light = ReadingsVal($name,"state","off");; my $show = '<a href="';;$show .= $onl eq "gelb" ? "/fhem?cmd.dummy=set $name x_update&XHR=1\">" : "http://".ReadingsVal($name,"ip","none").' "target="_blank">';;$show .= FW_makeImage("10px-kreis-".$onl)."</a>";; "<div> $show <a href=\"/fhem?cmd.dummy=set $name toggle&XHR=1\">".FW_makeImage($light)."</a></div>" }
   devicetopic shellyplus1-a8032abcd5e8
   event-on-change-reading .*
   group      Sommer
   icon       message_socket
   jsonMap    params_switch_0_aenergy_total:aenergy_total params_switch_0_apower:apower temperature_tC:temperature temperature_tF:0 params_wifi_sta_ip:ip
   model      shellyPlus_1
   readingList $DEVICETOPIC/online:.* online
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }
shellyplus1_a8032abcd5e8:fhem/rpc:.* { json2nameValue($EVENT) }
   room       MQTT2_DEVICE
   setList    toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}
   webCmd     :


Beste Grüsse
Claudio
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

87insane

#16
Hey,

ich versuch es nochmal... Leider ist bei deinem ganzen hin und her kopieren einiges krum geraten aber ich meine noch immer du hast eine falsche JSON MAP.
Ich hab dir oben ein RAW gepostet und du muss einfach nur die Dinge übernehmen. Aber das geht mit den devstateicon usw NUR, wenn es auch in der MAP richtig steht.

Meine Zeile:
params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip

Deine Zeile:
params_switch_0_aenergy_total:aenergy_total params_switch_0_apower:apower temperature_tC:temperature temperature_tF:0 params_wifi_sta_ip:ip

Diese Zeile hier ist ggf nur ein C&P Fehler?
{my $onl = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen";; my $light = ReadingsVal($name,"state","off");; my $show = '<a href="';;$show .= $onl eq "gelb" ? "/fhem?cmd.dummy=set $name x_update&XHR=1\">" : "http://".ReadingsVal($name,"ip","none").' "target="_blank">';;$show .= FW_makeImage("10px-kreis-".$onl)."</a>";; "<div> $show <a href=\"/fhem?cmd.dummy=set $name toggle&XHR=1\">".FW_makeImage($light)."</a></div>" }
   devStateIcon {my $onl = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen";; my $light = ReadingsVal($name,"state","off");; my $show = '<a href="';;$show .= $onl eq "gelb" ? "/fhem?cmd.dummy=set $name x_update&XHR=1\">" : "http://".ReadingsVal($name,"ip","none").' "target="_blank">';;$show .= FW_makeImage("10px-kreis-".$onl)."</a>";; "<div> $show <a href=\"/fhem?cmd.dummy=set $name toggle&XHR=1\">".FW_makeImage($light)."</a></div>" }


Bitte geh die Attribute nochmal genau durch und setze sie, wie in meinem RAW.
Ggf einfach löschen und neu anlegen?

EDIT: Anbei mal der Link und was ich hier auch sage... https://forum.fhem.de/index.php/topic,94060.msg1195493.html#msg1195493

Nochmal EDIT: Dein online steht sogar auf true. Aber ich glaube durch das ganze testen macht es Sinn, einmal löschen und neu anlegen. DANACH nochmal ein komplettes RAW.
Wenn du Ihn neu anlegst, dann am besten auch einmal ein RAW posten wie er bei dir aussieht, nach frischem autocreate. Am besten den Shelly einmal neustarten dafür.

Gruß,
87Insane

87insane

#17
Hey und guten Abend....

bei dem ganzen hin und her hat sich keiner mehr getraut?
Was haltet ihr von einem sauberen Status? Ich würde vorschlagen das EVENT ein wenig auseinander zu nehmen und es dann auch in state zu schreiben. Wer auf die Idee kommt das on/off weg zu nehmen.. Naja egal.

Vorschlag für einen weiteren Eintrag in readingList:
  $DEVICETOPIC/events/rpc:.*  { $EVENT =~ s/true/"on"/g; $EVENT =~ s/false/"off"/g; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }
auf rpc oder ggf besser auf switch_0? (einer von beiden reicht. Ich glaube aber das sich RPC als unsinnig erweisen wird)
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g; $EVENT =~ s/false/"off"/g; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }
schreibt on/off in state. Dann kann man auch einfach das normale devstateicon nehmen....

das könnte so aussehen:
{
my $onl = ReadingsVal($name,'online','false') eq 'false'
?'10px-kreis-rot'
: ReadingsVal($name,'new_fw','false') eq 'true'
? '10px-kreis-gelb'
: '10px-kreis-gruen';
$onl = FW_makeImage($onl);
my $light = ReadingsVal($name,'state','false');
$light = FW_makeImage($light);
my $cons = ReadingsNum($name,'apower',0);
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);
my $temp = ReadingsVal($name,'temperature','-100');
my $ip = ReadingsVal($name,'ip','none');
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)
}


Sieht dann so aus wie im Bild. Die Werte müsst Ihr Euch vorstellen. Ich habe keinen Verbraucher angeschlossen.


Anbei noch das zu bearbeitende EVENT (JSON), der Vollständigkeit halber:
{
  "src": "shellyplus1pm-7c87ce658380",
  "dst": "shellyplus1pm-7c87ce658380/events",
  "method": "NotifyStatus",
  "params": {
    "ts": 1640880331.21,
    "switch:0": {
      "id": 0,
      "output": true,
      "source": "MQTT"
    }
  }
}

vic

Vielen Dank für deine Hartnäckigkeit 87insane

Wenn du auf das Icon klickst wechselt auch die Darstellung (von Lampe light_light_dim_100 auf light_light)?
Bei mir schaltet der Aktor (licht geht an oder aus) das Icon wechselt jedoch von z.B. FS20.off auf toggle und bleibt dann egal wie ich schalte. Wenn ich jedoch mit dem Befehl set Shelly on (oder off) schalte erscheint das korrekte Icon (FS20.off oder FS20.on).


Internals:
   CFGFN      ./FHEM/fhem_020_Erdgeschoss.cfg
   CID        shellyplus1_a8032abcd5e8
   DEF        shellyplus1_a8032abcd5e8
   DEVICETOPIC shellyplus1-a8032abcd5e8
   FUUID      61bf3776-f33f-0f0b-0601-94a5f78e1f0867d0
   IODev      MQTT2
   LASTInputDev MQTT2
   MQTT2_CONN MQTT2_192.168.10.149_59434
   MQTT2_MSGCNT 32
   MQTT2_TIME 2021-12-31 09:06:37
   MSGCNT     32
   NAME       SH_AKT_149_AntiMuecken
   NR         226
   STATE      off
   TYPE       MQTT2_DEVICE
   JSONMAP:
     params_switch_0_aenergy_total aenergy_total
     params_switch_0_apower apower
     params_wifi_sta_ip ip
     temperature_tC temperature
     temperature_tF 0
   READINGS:
     2021-12-30 14:36:40   IODev           MQTT2
     2021-12-24 11:42:44   aenergy_total   0.000
     2021-12-24 11:42:00   apower          0.0
     2021-12-20 07:39:26   attrTemplateVersion 20211128
     2021-12-31 09:06:37   dst             shellyplus1-a8032abcd5e8/events
     2021-12-31 08:55:54   id              0
     2021-12-28 10:59:36   ip              192.168.10.149
     2021-12-31 09:06:37   method          NotifyStatus
     2021-12-28 10:56:52   mqtt_connected  true
     2021-12-30 14:37:14   online          true
     2021-12-29 12:06:22   params_events_1_cfg_rev 11
     2021-12-29 12:06:22   params_events_1_component input:0
     2021-12-29 12:06:22   params_events_1_event config_changed
     2021-12-29 12:06:22   params_events_1_id 0
     2021-12-29 12:06:22   params_events_1_restart_required false
     2021-12-29 12:06:22   params_events_1_ts 1640775982.68
     2021-12-30 14:37:14   params_mqtt_connected false
     2021-12-31 09:06:37   params_switch_0_id 0
     2021-12-31 09:06:37   params_switch_0_output false
     2021-12-31 09:06:37   params_switch_0_source MQTT
     2021-12-31 02:10:10   params_switch_0_temperature_tC 54.00
     2021-12-31 02:10:10   params_switch_0_temperature_tF 129.20
     2021-12-30 10:59:41   params_sys_available_updates_beta_version 0.9.2-beta2
     2021-12-28 10:58:52   params_sys_restart_required true
     2021-12-31 09:06:37   params_ts       1640937997.76
     2021-12-28 10:59:36   params_wifi_rssi -60
     2021-12-28 10:59:36   params_wifi_ssid Lienta_01
     2021-12-28 10:59:36   params_wifi_status got ip
     2021-12-31 08:55:54   result_was_on   false
     2021-12-29 19:34:22   rpc_dst         fhem
     2021-12-29 19:34:22   rpc_id          0
     2021-12-29 19:34:22   rpc_result_was_on false
     2021-12-29 19:34:22   rpc_src         shellyplus1-a8032abcd5e8
     2021-12-31 09:06:37   src             shellyplus1-a8032abcd5e8
     2021-12-31 09:06:36   state           off
     2021-12-28 10:57:29   switch_0_id     0
     2021-12-28 10:57:29   switch_0_output true
     2021-12-28 10:57:29   switch_0_source MQTT
     2021-12-28 10:57:00   sys_available_updates_beta_version 0.9.2-beta2
     2021-12-28 10:57:00   sys_cfg_rev     6
     2021-12-28 10:57:00   sys_fs_free     241664
     2021-12-28 10:57:00   sys_fs_size     458752
     2021-12-28 10:57:00   sys_mac         A8032ABCD5E8
     2021-12-28 10:57:00   sys_ram_free    181236
     2021-12-28 10:57:00   sys_ram_size    249684
     2021-12-28 10:57:00   sys_restart_required false
     2021-12-28 10:57:00   sys_time        10:57
     2021-12-28 10:57:00   sys_unixtime    1640685420
     2021-12-28 10:57:00   sys_uptime      9
     2021-12-28 10:57:29   temperature     53.5
Attributes:
   alias      Anti-Mücken 1
   comment    devStateIcon:

Original:
{my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = ReadingsVal($name,'switch_0_output','false') =~ m{false|off}?'off':'on';; $light = FW_makeImage($light);; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a>)}

Vorschlag:
on:rc_GREEN:off off:rc_RED:on absent:rc_BLUE:off Error:rc_YELLOW:off

Aktuell:
{my $onl = ReadingsVal($name,"online","false") eq "false" ? "rot" : ReadingsVal($name,"new_fw","false") eq "true" ? "gelb" : "gruen";; my $light = ReadingsVal($name,"state","off");; my $show = '<a href="';;$show .= $onl eq "gelb" ? "/fhem?cmd.dummy=set $name x_update&XHR=1\">" : "http://".ReadingsVal($name,"ip","none").' "target="_blank">';;$show .= FW_makeImage("10px-kreis-".$onl)."</a>";; "<div> $show <a href=\"/fhem?cmd.dummy=set $name toggle&XHR=1\">".FW_makeImage($light)."</a></div>" }
   devStateIcon {
my $onl = ReadingsVal($name,'online','false') eq 'false'
?'10px-kreis-rot'
: ReadingsVal($name,'new_fw','false') eq 'true'
? '10px-kreis-gelb'
: '10px-kreis-gruen';
$onl = FW_makeImage($onl);
my $light = ReadingsVal($name,'state','false');
$light = FW_makeImage($light);
my $cons = ReadingsNum($name,'apower',0);
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);
my $temp = ReadingsVal($name,'temperature','-100');
my $ip = ReadingsVal($name,'ip','none');
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)
}
   devicetopic shellyplus1-a8032abcd5e8
   event-on-change-reading .*
   group      Sommer
   icon       message_socket
   jsonMap    params_switch_0_aenergy_total:aenergy_total params_switch_0_apower:apower temperature_tC:temperature temperature_tF:0 params_wifi_sta_ip:ip
   model      shellyPlus_1
   readingList $DEVICETOPIC/online:.* online
$DEVICETOPIC/events/switch_0:.* { json2nameValue($EVENT,'',$JSONMAP) }
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g; $EVENT =~ s/false/"off"/g; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/events/rpc:.* { json2nameValue($EVENT) }
   room       MQTT2_DEVICE
   setList    toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}
   webCmd     :


Wohin darf ich den folgenden Code platzieren?

{
  "src": "shellyplus1pm-7c87ce658380",
  "dst": "shellyplus1pm-7c87ce658380/events",
  "method": "NotifyStatus",
  "params": {
    "ts": 1640880331.21,
    "switch:0": {
      "id": 0,
      "output": true,
      "source": "MQTT"
    }
  }
}


Danke für eure Hilfe
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

OdfFhem

@vic

Der Code ist kein Code, sondern stellt das Event-Ergebnis dar, das verarbeitet werden soll ...

87insane

Bitte übernimm die Attribute aus meinem. Raw (entspricht fast dem aktuellen Template). Dann fügst du der readingList eines der "neuen" readings aus meinem Beitrag hinzu.
Und als devstateicon, das aus meinem letzten Post. Ich sehe keinen Grund warum das nicht gehen sollte. Solange du das auch richtig eingefügt hast.

Der readingList Eintrag schreibt einfach sauber on oder off in state. Somit kann devstateicon auch auf diesen zurückgreifen. Aktuell ist in meinen Augen keine setstatelist notwendig. Solltest du dieses Attribut drin haben, bitte löschen.

Es ist auch wichtig das du alles sauber machst...daher - entweder kennst du die Befehle um das Gerät auf zu räumen oder du löscht es und lässt es durch autocreate neu anlegen, und kopierst, wie oben beschrieben, alles rein. Natürlich muss du bei devstatetopic, die ID deines shellys eintragen.

Bin gespannt,
87insane

Und sende - wenn es nicht geht, bitte einfach ein unbearbeites RAW.

vic

Hallo 87insane

Nun habe ich alles mögliche probiert. Bin einfach zu blöde um das zu realisieren.

Anbei ein raw nach dem autocreate:
define MQTT2_shellyplus1_a8032abcd5e8 MQTT2_DEVICE shellyplus1_a8032abcd5e8
setuuid MQTT2_shellyplus1_a8032abcd5e8 61cf1165-f33f-0f0b-eff8-dd8f99d7cd957472
attr MQTT2_shellyplus1_a8032abcd5e8 readingList shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/online:.* online\
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/events/rpc:.* { json2nameValue($EVENT) }
attr MQTT2_shellyplus1_a8032abcd5e8 room MQTT2_DEVICE
define FileLog_MQTT2_shellyplus1_a8032abcd5e8 FileLog ./log/MQTT2_shellyplus1_a8032abcd5e8-%Y.log MQTT2_shellyplus1_a8032abcd5e8
setuuid FileLog_MQTT2_shellyplus1_a8032abcd5e8 61cf1165-f33f-0f0b-066a-53d6290c6ea9473c
attr FileLog_MQTT2_shellyplus1_a8032abcd5e8 logtype text
attr FileLog_MQTT2_shellyplus1_a8032abcd5e8 room MQTT2_DEVICE



Nach dem Anwenden des Template shellyPlus_1:
defmod MQTT2_shellyplus1_a8032abcd5e8 MQTT2_DEVICE shellyplus1_a8032abcd5e8
attr MQTT2_shellyplus1_a8032abcd5e8 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';;;; $onl = FW_makeImage($onl);;;; my $light = ReadingsVal($name,'switch_0_output','false') =~ m{false|off}?'off':'on';;;; $light = FW_makeImage($light);;;; my $ip = ReadingsVal($name,'ip','none');;;; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a>)}
attr MQTT2_shellyplus1_a8032abcd5e8 devicetopic shellyplus1-a8032abcd5e8
attr MQTT2_shellyplus1_a8032abcd5e8 icon message_socket
attr MQTT2_shellyplus1_a8032abcd5e8 jsonMap params_switch_0_aenergy_total:aenergy_total params_switch_0_apower:apower temperature_tC:temperature temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1_a8032abcd5e8 model shellyPlus_1
attr MQTT2_shellyplus1_a8032abcd5e8 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }
attr MQTT2_shellyplus1_a8032abcd5e8 room MQTT2_DEVICE
attr MQTT2_shellyplus1_a8032abcd5e8 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}

setstate MQTT2_shellyplus1_a8032abcd5e8 2021-12-31 15:20:12 IODev MQTT2
setstate MQTT2_shellyplus1_a8032abcd5e8 2021-12-31 15:23:02 attrTemplateVersion 20211128



Das Icon bleibt auf FS20.off (auch wenn ich mit on oder off steuere)
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

Helmi55

Hallo 87insane

ich versuche mich gerade am selben Problem

Ich hab deine RAW aus #9 verwendet und an meinen shelly angepasst
Beim RAW Import habe ich die Fehlermeldung "genericDeviceType" nicht vorhanden erhalten.
Wenn ich in den attr nachsehe, ist dieses auch nicht vorhanden? - Hat du deinen in HomeKit eingebunden?

Ich kann den Shelly in FHEM nicht schalten, aber wenn ich den Shelly auf der WebOberfläache schalte - sehe ich das Ergebnis in FHEM

Hier meine RAW
defmod MQTT2_shellyplus1pm_44179394cab4 MQTT2_DEVICE shellyplus1pm_44179394cab4
attr MQTT2_shellyplus1pm_44179394cab4 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = ReadingsVal($name,'output','false') =~ m{false|off}?'off':'on';; $light = FW_makeImage($light);; my $cons = ReadingsNum($name,'apower',0);; my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);; my $temp = ReadingsVal($name,'temperature','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1pm_44179394cab4 devicetopic shellyplus1pm-7c87ce657e74
attr MQTT2_shellyplus1pm_44179394cab4 event-on-change-reading .*
attr MQTT2_shellyplus1pm_44179394cab4 jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1pm_44179394cab4 model shellyPlus_1pm
attr MQTT2_shellyplus1pm_44179394cab4 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  fhem/rpc:.* { json2nameValue($EVENT,'rpc_',$JSONMAP) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/events/rpc:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/switch_0:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/online:.* online\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/mqtt:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/sys:.* { json2nameValue($EVENT) }
attr MQTT2_shellyplus1pm_44179394cab4 room MQTT2_DEVICE
attr MQTT2_shellyplus1pm_44179394cab4 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}

setstate MQTT2_shellyplus1pm_44179394cab4 on
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 15:55:27 IODev myBroker
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 aenergy_by_minute_1 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 aenergy_by_minute_2 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 aenergy_by_minute_3 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 aenergy_minute_ts 1640963589
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 aenergy_total 654.021
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 apower 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 available_updates_beta_version 0.9.2-beta2
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 cfg_rev 2
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:40 connected true
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 current 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 dst shellyplus1pm-44179394cab4/events
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 fs_free 233472
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 fs_size 458752
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 id 0
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 mac 44179394CAB4
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 method NotifyStatus
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:40 online true
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 output true
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:36 params_events_1_cfg_rev 2
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:36 params_events_1_component mqtt
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:36 params_events_1_event config_changed
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:36 params_events_1_restart_required true
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:36 params_events_1_ts 1640962897.35
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:40 params_mqtt_connected true
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:00 params_switch_0_aenergy_by_minute_1 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:00 params_switch_0_aenergy_by_minute_2 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:00 params_switch_0_aenergy_by_minute_3 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:00 params_switch_0_aenergy_minute_ts 1640963579
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:00 params_switch_0_aenergy_total 654.021
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:09:27 params_switch_0_apower 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 params_switch_0_current 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 params_switch_0_id 0
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 15:59:18 params_switch_0_output true
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 15:59:18 params_switch_0_source WS_in
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:41 params_switch_0_voltage 218.4
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 params_sys_available_updates_beta_version 0.9.2-beta2
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:36 params_sys_restart_required true
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 params_ts 1640963591.42
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:40 params_wifi_rssi -54
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:40 params_wifi_ssid Dahoam
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:40 params_wifi_sta_ip 10.0.0.161
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:40 params_wifi_status got ip
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 ram_free 180508
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 ram_size 249608
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 restart_required false
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 source init
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 src shellyplus1pm-44179394cab4
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:02:56 state on
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 temperature_tC 46.2
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 temperature_tF 115.2
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 time 16:01
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 unixtime 1640962911
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:01:51 uptime 12
setstate MQTT2_shellyplus1pm_44179394cab4 2021-12-31 16:13:10 voltage 217.7


Gruß
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

87insane

#23
Jeder für sich will mich auf den arm nehmen.

Die erste antwort: das tenplate geht so nicht. Du muss es anpassen wie und nun kommen wir zu Antwort 2. Du muss das devicetopic in den Attributen anpassen. Du kannst meinen shelly nicht schalten. Das alles beschrieb ich oben :)

Antwort 2 hat es nach der anpassung geschafft.
Edit: Antwort 2 (Helmut) du muss auch den Eintrag in der readingList anpassen. Kopiere 1 zu 1 meine, nachdem du das topic angepasst hast. Und füge den Eintrag hinzu, aus meinem Post.

So sieht ein laufendes raw aus:
defmod MQTT2_shellyplus1pm_7c87ce658380 MQTT2_DEVICE shellyplus1pm_7c87ce658380
attr MQTT2_shellyplus1pm_7c87ce658380 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'\
?'10px-kreis-rot'\
: ReadingsVal($name,'new_fw','false') eq 'true' \
? '10px-kreis-gelb' \
: '10px-kreis-gruen';; \
$onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','false');;\
$light = FW_makeImage($light);; \
my $cons = ReadingsNum($name,'apower',0);; \
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;\
my $temp = ReadingsVal($name,'temperature','-100');; \
my $ip = ReadingsVal($name,'ip','none');; \
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1pm_7c87ce658380 devicetopic shellyplus1pm-7c87ce658380
attr MQTT2_shellyplus1pm_7c87ce658380 event-on-change-reading .*
attr MQTT2_shellyplus1pm_7c87ce658380 jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1pm_7c87ce658380 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }\
  fhem/rpc:.* { json2nameValue($EVENT,'rpc_',$JSONMAP) }
attr MQTT2_shellyplus1pm_7c87ce658380 room MQTT2_DEVICE
attr MQTT2_shellyplus1pm_7c87ce658380 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}
attr MQTT2_shellyplus1pm_7c87ce658380 webCmd :


Gruß,
87insane

Helmi55

Servus
ich will dich sicher nicht auf den Arm nehmen - sorry - du hast mir schon soviel geholfen :) :) :)
Das mit dem Topic war ein Fehler von mir. Der wurde anscheinen bei search and replace nicht mitgenommen  :-\

Es klappt trotzdem noch nicht.
Punkt für heute - nächstes Jahr ist auch noch Zeit und dann werde ich das in Ruhe nochmals angehen

Danke für deinen tollen Support

Alles Gute für 2022 und vor allem gesund bleiben
Gruß
helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

smoudo

Ich werde das auch die Tage nochmal testen. Das es noch nicht 100% funktioniert fuxxt mich!

Vielen Dank für Deine ausdauernde Mühe!

Guten Rutsch in 2022!


Viele Grüße

Matze

87insane

Okay... Sendet dann bitte aber ein RAW. Es ist für mich nicht erkennbar warum etwas nicht gehen soll, ohne zu sehen was eingestellt ist.

Das was ich oben gepostet hab, sollte bis auf die PM eigenschaften (Strom messen) passen. Wenn ihr die Attribute einzeln durch geht und jedes einfach so anpasst. Gibt es nach wie vor keinen Grund warum das nicht gehen soll. In den RAWs bisher, waren leider immer Fehler.... Ich weiß nicht wie ich es quasi noch besser ausdrücken kann.

Warte mal auf Feedback,
87insane

Helmi55

Guten Abend und prosit 2022

ich habe das Device aus FHEM gelöscht. Habe den Shelly rebootet und ihn in FHEM empfangen.
Ich habe KEIN Template ausgewählt, sondern nur wie von dir beschrieben die einzelnen attr in FHEM eingetragen.
Ich konnte kein genericeDevice attr anlegen. Fehlermeldung attr nicht vorhanden???
Ichhabe einen Neustart von FHEM durchführt und danach habe ich bei den readingList diese 5 Zeilen mehr gefunden?
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/events/rpc:.* { json2nameValue($EVENT) }
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/switch_0:.* { json2nameValue($EVENT) }
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/online:.* online
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/mqtt:.* { json2nameValue($EVENT) }
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/sys:.* { json2nameValue($EVENT) }


Hier ein RAW vom Shelly in FHEM

defmod MQTT2_shellyplus1pm_44179394cab4 MQTT2_DEVICE shellyplus1pm_44179394cab4
attr MQTT2_shellyplus1pm_44179394cab4 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';;;; $onl = FW_makeImage($onl);;;; my $light = ReadingsVal($name,'output','false') =~ m{false|off}?'off':'on';;;; $light = FW_makeImage($light);;;; my $cons = ReadingsNum($name,'apower',0);;;; my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;;; my $temp = ReadingsVal($name,'temperature','-100');;;; my $ip = ReadingsVal($name,'ip','none');;;; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1pm_44179394cab4 devicetopic shellyplus1pm_44179394cab4
attr MQTT2_shellyplus1pm_44179394cab4 event-on-change-reading .*
attr MQTT2_shellyplus1pm_44179394cab4 jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1pm_44179394cab4 model shellyPlus_1pm
attr MQTT2_shellyplus1pm_44179394cab4 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  fhem/rpc:.* { json2nameValue($EVENT,'rpc_',$JSONMAP) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/events/rpc:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/switch_0:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/online:.* online\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/mqtt:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/sys:.* { json2nameValue($EVENT) }
attr MQTT2_shellyplus1pm_44179394cab4 room MQTT2_DEVICE
attr MQTT2_shellyplus1pm_44179394cab4 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}

setstate MQTT2_shellyplus1pm_44179394cab4 off
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:48:53 IODev myBroker
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 aenergy_by_minute_1 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 aenergy_by_minute_2 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 aenergy_by_minute_3 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 aenergy_minute_ts 1641056038
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 aenergy_total 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 apower 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 available_updates_beta_version 0.9.2-beta2
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 cfg_rev 2
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:48:58 connected true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 current 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 dst shellyplus1pm-44179394cab4/events
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 fs_free 233472
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 fs_size 458752
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 id 0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 mac 44179394CAB4
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 method NotifyStatus
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:48:58 online true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 output true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:48:58 params_mqtt_connected false
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 params_switch_0_aenergy_by_minute_1 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 params_switch_0_aenergy_by_minute_2 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 params_switch_0_aenergy_by_minute_3 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 params_switch_0_aenergy_minute_ts 1641056038
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 params_switch_0_aenergy_total 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:50:26 params_switch_0_apower 0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:52:14 params_switch_0_current 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 params_switch_0_id 0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:50:30 params_switch_0_output true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:50:30 params_switch_0_source WS_in
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:08 params_switch_0_voltage 216.9
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 params_sys_available_updates_beta_version 0.9.2-beta2
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 params_ts 1641056040.94
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:07 params_wifi_rssi -53
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:07 params_wifi_ssid Dahoam
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:07 params_wifi_sta_ip 10.0.0.161
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:07 params_wifi_status got ip
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 ram_free 180504
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 ram_size 249600
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 restart_required false
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 source WS_in
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 src shellyplus1pm-44179394cab4
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:50:33 state off
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 temperature_tC 45.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 temperature_tF 113.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 time 17:47
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 unixtime 1641055637
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:47:16 uptime 10
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-01 17:54:00 voltage 216.7




wie gesagt ich sehe in FHEM wenn ich den Shelly auf der Weboberfläche schalte, aber ich kann in FHEM nicht schalten?
Ich blicke da nicht durch? Sorry....

Danke für deine Zeit und Hilfe
Gruß
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

TomLee

Zitatich habe das Device aus FHEM gelöscht. Habe den Shelly rebootet und ihn in FHEM empfangen.
Ich habe KEIN Template ausgewählt, sondern nur wie von dir beschrieben die einzelnen attr in FHEM eingetragen.
Ich konnte kein genericeDevice attr anlegen. Fehlermeldung attr nicht vorhanden???
Ichhabe einen Neustart von FHEM durchführt und danach habe ich bei den readingList diese 5 Zeilen mehr gefunden?

Hallo Helmut,

wie man an deinem List sieht ging während deinem geschilderten Ablauf irgendwas schief.

Ich bin der Meinung wenn du das hier in einem Raw-Editor (über das + oben links oder unter jedem Device) eingibst und mit Execute bestätigst, das schalten mit dem Icon in der DeviceOverview möglich sein wird, aber erst nachdem der Shelly einmal noch zuvor seinen Status per MQTT übertragen hat:

attr MQTT2_shellyplus1pm_44179394cab4 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'\
?'10px-kreis-rot'\
: ReadingsVal($name,'new_fw','false') eq 'true' \
? '10px-kreis-gelb' \
: '10px-kreis-gruen';; \
$onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','false');;\
$light = FW_makeImage($light);; \
my $cons = ReadingsNum($name,'apower',0);; \
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;\
my $temp = ReadingsVal($name,'temperature','-100');; \
my $ip = ReadingsVal($name,'ip','none');; \
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1pm_44179394cab4 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }


Gruß

Thomas

Helmi55

Servus Thomas

anscheinend bin ich für die plus Serie zu blöd.....
Habe das Device aus FHEM gelöscht und danach deinen Code im RAW Editor eingegeben und es kam keine Fehlermeldung nach "execute"
Habe den Shelly aus und eingeschaltet und auch einen erbot von FHEM durchgeführt aber anscheinend ohne Erfolg.
Ich habe zwar nun einen grünen Punkt aber daneben steht "false".
Die Readingswerte werden alle aktualisiert.
Die FW vom Shelly ist 0.9.1

Hier nochmals ein RAW
defmod MQTT2_shellyplus1pm_44179394cab4 MQTT2_DEVICE shellyplus1pm_44179394cab4
attr MQTT2_shellyplus1pm_44179394cab4 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'\
?'10px-kreis-rot'\
: ReadingsVal($name,'new_fw','false') eq 'true' \
? '10px-kreis-gelb' \
: '10px-kreis-gruen';; \
$onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','false');;\
$light = FW_makeImage($light);; \
my $cons = ReadingsNum($name,'apower',0);; \
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;\
my $temp = ReadingsVal($name,'temperature','-100');; \
my $ip = ReadingsVal($name,'ip','none');; \
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1pm_44179394cab4 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/events/rpc:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/switch_0:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/online:.* online\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/mqtt:.* { json2nameValue($EVENT) }
attr MQTT2_shellyplus1pm_44179394cab4 room MQTT2_DEVICE

setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 09:56:42 IODev myBroker
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 aenergy_by_minute_1 1850.434
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 aenergy_by_minute_2 1933.446
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 aenergy_by_minute_3 1924.849
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 aenergy_minute_ts 1641114059
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 aenergy_total 106.367
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 apower 108.6
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 09:56:48 connected true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 current 0.5
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 dst shellyplus1pm-44179394cab4/events
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 id 0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 method NotifyStatus
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 09:56:48 online true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 output true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 09:56:48 params_mqtt_connected false
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 params_switch_0_aenergy_by_minute_1 1850.434
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 params_switch_0_aenergy_by_minute_2 1933.446
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 params_switch_0_aenergy_by_minute_3 1924.849
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 params_switch_0_aenergy_minute_ts 1641114059
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 params_switch_0_aenergy_total 106.367
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:00:56 params_switch_0_apower 108.6
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 09:58:37 params_switch_0_current 0.5
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 params_switch_0_id 0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 params_ts 1641114061.78
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 source WS_in
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:11 src shellyplus1pm-44179394cab4
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 temperature_tC 39.1
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 temperature_tF 102.4
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:01:01 voltage 223.6



Was ich mir nicht erklären kann, woher kommen plötzlich wieder diese 4 Zeilen?
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/events/rpc:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/switch_0:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/online:.* online\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/mqtt:.* { json2nameValue($EVENT) }


Danke für deine Zeit
Gruß
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

pflock_y

Guten morgen zusammen,
ich bin durch Zufall auf diesen Beitrag gestoßen, hab daraufhin viel probiert.
Bei mir gehen meine Plus1PM´er nun auch.
Aufgefallen ist mir das man beim
attr devicetopic das gleiche reinschreiben muss wie in den MQTT Einstellungen des Shellys.
Danach hat alles funktioniert.

vg
pflock_y

TomLee

#31
Du hättest nix löschen müssen, der Vorschlag hätte die Attribute des bestehenden Devices angepasst/überschrieben.

Das + gibts nur im f18-Style.

In jedem anderen Style gibts aber auch den "Raw-Editor", ganz unten in der Detailansicht eines Devices.

Gehe in die Detailansicht des MQTT2_shellyplus1pm_44179394cab4-Device, scrolle ganz nach unten, entferne bzw. ersetze alles in dem Fenster durch diese Definition und tippe Execute command:

defmod MQTT2_shellyplus1pm_44179394cab4 MQTT2_DEVICE shellyplus1pm_7c87ce658380
attr MQTT2_shellyplus1pm_44179394cab4 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'\
?'10px-kreis-rot'\
: ReadingsVal($name,'new_fw','false') eq 'true' \
? '10px-kreis-gelb' \
: '10px-kreis-gruen';; \
$onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','false');;\
$light = FW_makeImage($light);; \
my $cons = ReadingsNum($name,'apower',0);; \
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;\
my $temp = ReadingsVal($name,'temperature','-100');; \
my $ip = ReadingsVal($name,'ip','none');; \
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1pm_44179394cab4 devicetopic shellyplus1pm-44179394cab4
attr MQTT2_shellyplus1pm_44179394cab4 event-on-change-reading .*
attr MQTT2_shellyplus1pm_44179394cab4 jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1pm_44179394cab4 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }\
  fhem/rpc:.* { json2nameValue($EVENT,'rpc_',$JSONMAP) }
attr MQTT2_shellyplus1pm_44179394cab4 room MQTT2_DEVICE
attr MQTT2_shellyplus1pm_44179394cab4 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}
attr MQTT2_shellyplus1pm_44179394cab4 webCmd :


Nix löschen, nicht restarten nur einmal bspw. ein set MQTT2_shellyplus1pm_44179394cab4 on ausführen.

Helmi55

Hallo Zusammen
habe da anscheinend von Thomas falsch verstanden
SO funktioniert es jetzt

defmod MQTT2_shellyplus1pm_44179394cab4 MQTT2_DEVICE shellyplus1pm_44179394cab4
attr MQTT2_shellyplus1pm_44179394cab4 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'\
?'10px-kreis-rot'\
: ReadingsVal($name,'new_fw','false') eq 'true' \
? '10px-kreis-gelb' \
: '10px-kreis-gruen';; \
$onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','false');;\
$light = FW_makeImage($light);; \
my $cons = ReadingsNum($name,'apower',0);; \
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;\
my $temp = ReadingsVal($name,'temperature','-100');; \
my $ip = ReadingsVal($name,'ip','none');; \
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1pm_44179394cab4 devicetopic shellyplus1pm-44179394cab4
attr MQTT2_shellyplus1pm_44179394cab4 event-on-change-reading .*
attr MQTT2_shellyplus1pm_44179394cab4 jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1pm_44179394cab4 model shellyPlus_1pm
attr MQTT2_shellyplus1pm_44179394cab4 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/events/rpc:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/switch_0:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/online:.* online\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/mqtt:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/cloud:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/sys:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:fhem/rpc:.* { json2nameValue($EVENT) }
attr MQTT2_shellyplus1pm_44179394cab4 room MQTT2_DEVICE
attr MQTT2_shellyplus1pm_44179394cab4 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}

setstate MQTT2_shellyplus1pm_44179394cab4 on
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 09:56:42 IODev myBroker
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 aenergy_by_minute_1 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 aenergy_by_minute_2 2037.045
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 aenergy_by_minute_3 2384.606
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 aenergy_minute_ts 1641119181
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 aenergy_total 275.891
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 apower 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 available_updates_beta_version 0.9.2-beta2
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 cfg_rev 9
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:33:20 connected true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 current 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 dst shellyplus1pm-44179394cab4/events
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 fs_free 233472
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 fs_size 458752
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 id 0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 mac 44179394CAB4
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 method NotifyStatus
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:28:49 online true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 output true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:33:20 params_cloud_connected true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:33:19 params_events_1_cfg_rev 9
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:33:19 params_events_1_component cloud
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:33:19 params_events_1_event config_changed
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:33:19 params_events_1_restart_required false
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:33:19 params_events_1_ts 1641115999.31
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:28:49 params_mqtt_connected true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:01 params_switch_0_aenergy_by_minute_1 2037.045
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:01 params_switch_0_aenergy_by_minute_2 2384.606
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:01 params_switch_0_aenergy_by_minute_3 2110.045
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:01 params_switch_0_aenergy_minute_ts 1641119159
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:01 params_switch_0_aenergy_total 275.891
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:16 params_switch_0_apower 0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 params_switch_0_current 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 params_switch_0_id 0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:20 params_switch_0_output true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:20 params_switch_0_source MQTT
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:28:49 params_switch_0_voltage 224.5
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 params_sys_available_updates_beta_version 0.9.2-beta2
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 params_ts 1641119183.89
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:28:49 params_wifi_rssi -53
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:28:49 params_wifi_ssid Dahoam
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:28:49 params_wifi_sta_ip 10.0.0.161
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:28:49 params_wifi_status got ip
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 ram_free 170500
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 ram_size 249228
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 restart_required false
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:20 result_was_on false
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 source MQTT
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 src shellyplus1pm-44179394cab4
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 state on
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_aenergy_by_minute_1 0.000
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_aenergy_by_minute_2 2037.045
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_aenergy_by_minute_3 2384.606
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_aenergy_minute_ts 1641119181
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_aenergy_total 275.891
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:24:03 switch_0_apower 142.2
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_current 0.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_id 0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_output true
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_source MQTT
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:24:03 switch_0_temperature_tC 39.5
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:24:03 switch_0_temperature_tF 103.1
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 switch_0_voltage 221.3
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 temperature 39.4
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 temperature_tC 39.4
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 temperature_tF 103.0
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 time 10:34
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 unixtime 1641116073
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 10:34:33 uptime 345
setstate MQTT2_shellyplus1pm_44179394cab4 2022-01-02 11:26:23 voltage 221.3



Schönen Tag noch

PS: die Angaben sind jetzt in der neuen Generation in Watt Stunden und nicht mehr Minuten - sehe ich das richtig?

Gruß
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

Helmi55

Servus haben uns soeben überschnitten
Hatte schon an mir selbst gezweifelt........
Habe jetzt noch das WebCmd auf ":" ergänzt.
Jetzt klappt alles.

Einzig das von 87insane angeführte genericDeviceType gibts nicht (hast du ja auch nicht drinnen!)
Scheint eine Verknüpfung mit HomeKit zu sein?

Schönen Sonntag helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

vic

@Helmi55

Bitte stelle mir dein RAW rein. Bei mir klappt es ganz und gar nicht. Das Symbol wechselt beim Anklicken auf toggle und ändert sich nicht mehr. Der Aktor Schaltet jedoch.

Ich habe versucht alle eure Vorschläge umzusetzen. Leider ohne Erfolg.

Anbei mein RAW:
defmod MQTT2_shellyplus1_a8032abcd5e8 MQTT2_DEVICE shellyplus1_a8032abcd5e8
attr MQTT2_shellyplus1_a8032abcd5e8 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'\
?'10px-kreis-rot'\
: ReadingsVal($name,'new_fw','false') eq 'true' \
? '10px-kreis-gelb' \
: '10px-kreis-gruen';; \
$onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','false');;\
$light = FW_makeImage($light);; \
my $cons = ReadingsNum($name,'apower',0);; \
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;\
my $temp = ReadingsVal($name,'temperature','-100');; \
my $ip = ReadingsVal($name,'ip','none');; \
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1_a8032abcd5e8 devicetopic shellyplus1-a8032abcd5e8
attr MQTT2_shellyplus1_a8032abcd5e8 event-on-change-reading .*
attr MQTT2_shellyplus1_a8032abcd5e8 group Sommer
attr MQTT2_shellyplus1_a8032abcd5e8 icon message_socket
attr MQTT2_shellyplus1_a8032abcd5e8 jsonMap params_switch_0_aenergy_total:aenergy_total params_switch_0_apower:apower temperature_tC:temperature temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1_a8032abcd5e8 model shellyPlus_1
attr MQTT2_shellyplus1_a8032abcd5e8 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpt:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }\
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/events/rpc:.* { json2nameValue($EVENT) }
attr MQTT2_shellyplus1_a8032abcd5e8 room MQTT2_DEVICE
attr MQTT2_shellyplus1_a8032abcd5e8 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}

setstate MQTT2_shellyplus1_a8032abcd5e8 off
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:17:23 IODev MQTT2
setstate MQTT2_shellyplus1_a8032abcd5e8 2021-12-31 15:23:02 attrTemplateVersion 20211128
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:23:09 dst shellyplus1-a8032abcd5e8/events
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 10:43:19 ip 192.168.10.149
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:23:09 method NotifyStatus
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:18:05 online true
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 10:41:10 params_events_1_cfg_rev 12
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 10:43:13 params_events_1_component sys
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 10:43:13 params_events_1_event ota_success
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 10:43:13 params_events_1_msg Update applied, rebooting
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 10:43:11 params_events_1_progress_percent 98
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 10:41:10 params_events_1_restart_required false
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 10:43:13 params_events_1_ts 1641116592.89
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:18:05 params_mqtt_connected false
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:23:09 params_switch_0_id 0
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:20:12 params_switch_0_output false
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:20:12 params_switch_0_source MQTT
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:23:09 params_switch_0_temperature_tC 47.69
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:23:09 params_switch_0_temperature_tF 117.84
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 10:42:20 params_sys_available_updates_beta_version 0.9.2-beta2
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:09:29 params_sys_available_updates_stable_version 0.9.1
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:23:09 params_ts 1641136989.69
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:09:18 params_wifi_rssi -62
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:09:18 params_wifi_ssid Lienta_01
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:09:18 params_wifi_sta_ip 192.168.10.149
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:09:18 params_wifi_status got ip
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:23:09 src shellyplus1-a8032abcd5e8
setstate MQTT2_shellyplus1_a8032abcd5e8 2022-01-02 16:20:12 state off



Danke
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

87insane

Puh hier geräd ja alles außer Rand und Band....


Also wie ich schon 3, 4 mal schrieb: aber urgendwie liest das keiner... Ihr müsst auch device topic richtig setzen. Ich hab am ende doch sogar ein kompettes RAW gepostet.

Alles was shelly- und shelly_ ist muss eben durch euren shelly ersetzt werden. Dann geht alles. Die Umrechnung des Verbrauchs hab ich nicht gegengeprüft. Vermutlich im shelly style, sollte die bereits aus den alten templates bekannte angewandt werden.

Ich würde von einem von euch aber gern mal erklärt bekommen, wo das Problem ist, das 1zu1 zu übernehmen. Denn, immer war in den RAWs irgendwas nicht mit übernommen usw. Also mein ich nicht böse aber copy&search+replace&paste, sollte doch laufen. Ansonsten gäbe es gewaltige Unterschiede bei allen von uns. Da das aber alles generisch gehalten wird, glaube ich das nicht.

genericDeviceType ist für Sprach Assistenten zb. Genaueres im Wiki.

Wenn hier wirklich einer die RAW Datei von mir übernimmt, angepasst auf sich, bitte RAW zurück und zeigen was nicht geht.

Gruß,
sorry wegen der "Energie" - 87insane

Helmi55

Hallo vic
gerne hier das aktuelle letzte RAW (Werte im Moment nicht aktuell da PVBalkonAnlage und finster
Hat aber den ganzen Nachmittag funktioniert

defmod PVAnlage MQTT2_DEVICE shellyplus1pm_44179394cab4
attr PVAnlage devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'\
?'10px-kreis-rot'\
: ReadingsVal($name,'new_fw','false') eq 'true' \
? '10px-kreis-gelb' \
: '10px-kreis-gruen';; \
$onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','false');;\
$light = FW_makeImage($light);; \
my $cons = ReadingsNum($name,'apower',0);; \
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;\
my $temp = ReadingsVal($name,'temperature','-100');; \
my $ip = ReadingsVal($name,'ip','none');; \
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr PVAnlage devicetopic shellyplus1pm-44179394cab4
attr PVAnlage event-on-change-reading .*
attr PVAnlage jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr PVAnlage model shellyPlus_1pm
attr PVAnlage readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/events/rpc:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/switch_0:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/online:.* online\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/mqtt:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/cloud:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:shellyplus1pm-44179394cab4/status/sys:.* { json2nameValue($EVENT) }\
shellyplus1pm_44179394cab4:fhem/rpc:.* { json2nameValue($EVENT) }
attr PVAnlage room PV Anlage,MQTT2_DEVICE
attr PVAnlage setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}
attr PVAnlage userReadings relay_0_energy_kWh:params_switch_0_aenergy_total.* monotonic {ReadingsVal($NAME,"params_switch_0_aenergy_total",0)/1000.0}, Ertrag:relay_0_energy_kWh.* { sprintf("%.2f",(ReadingsVal($NAME,"relay_0_energy_kWh",0) - 0.01)*.2);;;;}
attr PVAnlage webCmd :

setstate PVAnlage on
setstate PVAnlage 2022-01-02 16:04:00 Ertrag 0.12
setstate PVAnlage 2022-01-02 13:27:31 IODev myBroker
setstate PVAnlage 2022-01-02 17:27:59 aenergy_by_minute_1 0.000
setstate PVAnlage 2022-01-02 17:27:59 aenergy_by_minute_2 0.000
setstate PVAnlage 2022-01-02 17:27:59 aenergy_by_minute_3 0.000
setstate PVAnlage 2022-01-02 17:27:59 aenergy_minute_ts 1641140878
setstate PVAnlage 2022-01-02 17:28:17 aenergy_total 0.000
setstate PVAnlage 2022-01-02 17:27:59 apower 0.0
setstate PVAnlage 2022-01-02 16:50:39 available_updates_beta_version 0.9.2-beta2
setstate PVAnlage 2022-01-02 16:50:39 cfg_rev 10
setstate PVAnlage 2022-01-02 16:50:28 connected true
setstate PVAnlage 2022-01-02 17:27:59 current 0.0
setstate PVAnlage 2022-01-02 17:28:17 dst shellyplus1pm-44179394cab4/events
setstate PVAnlage 2022-01-02 16:50:39 fs_free 233472
setstate PVAnlage 2022-01-02 16:50:39 fs_size 458752
setstate PVAnlage 2022-01-02 17:27:59 id 0
setstate PVAnlage 2022-01-02 16:50:28 ip 10.0.0.161
setstate PVAnlage 2022-01-02 16:50:39 mac 44179394CAB4
setstate PVAnlage 2022-01-02 17:28:17 method NotifyStatus
setstate PVAnlage 2022-01-02 16:50:28 mqtt_connected true
setstate PVAnlage 2022-01-02 16:50:28 online true
setstate PVAnlage 2022-01-02 17:27:59 output true
setstate PVAnlage 2022-01-02 12:46:30 params_cloud_connected false
setstate PVAnlage 2022-01-02 17:01:37 params_events_1_cfg_rev 11
setstate PVAnlage 2022-01-02 17:01:37 params_events_1_component switch:0
setstate PVAnlage 2022-01-02 17:01:37 params_events_1_event config_changed
setstate PVAnlage 2022-01-02 17:01:37 params_events_1_id 0
setstate PVAnlage 2022-01-02 17:01:37 params_events_1_restart_required false
setstate PVAnlage 2022-01-02 17:01:37 params_events_1_ts 1641139298.02
setstate PVAnlage 2022-01-02 16:50:28 params_mqtt_connected true
setstate PVAnlage 2022-01-02 17:28:17 params_switch_0_aenergy_by_minute_1 0.000
setstate PVAnlage 2022-01-02 17:28:17 params_switch_0_aenergy_by_minute_2 0.000
setstate PVAnlage 2022-01-02 17:28:17 params_switch_0_aenergy_by_minute_3 0.000
setstate PVAnlage 2022-01-02 17:28:17 params_switch_0_aenergy_minute_ts 1641140878
setstate PVAnlage 2022-01-02 17:28:17 params_switch_0_aenergy_total 0.000
setstate PVAnlage 2022-01-02 17:01:51 params_switch_0_apower 0
setstate PVAnlage 2022-01-02 17:27:08 params_switch_0_current 0.0
setstate PVAnlage 2022-01-02 17:28:17 params_switch_0_id 0
setstate PVAnlage 2022-01-02 17:02:21 params_switch_0_output true
setstate PVAnlage 2022-01-02 17:02:21 params_switch_0_source timer
setstate PVAnlage 2022-01-02 17:01:51 params_switch_0_timer_duration 30.00
setstate PVAnlage 2022-01-02 17:01:51 params_switch_0_timer_started_at 1641139311.56
setstate PVAnlage 2022-01-02 16:50:30 params_switch_0_voltage 217.6
setstate PVAnlage 2022-01-02 16:50:39 params_sys_available_updates_beta_version 0.9.2-beta2
setstate PVAnlage 2022-01-02 17:28:17 params_ts 1641140880.20
setstate PVAnlage 2022-01-02 16:50:28 params_wifi_rssi -54
setstate PVAnlage 2022-01-02 16:50:28 params_wifi_ssid Dahoam
setstate PVAnlage 2022-01-02 16:50:28 params_wifi_sta_ip 10.0.0.161
setstate PVAnlage 2022-01-02 16:50:28 params_wifi_status got ip
setstate PVAnlage 2022-01-02 16:50:39 ram_free 176824
setstate PVAnlage 2022-01-02 16:50:39 ram_size 249588
setstate PVAnlage 2022-01-02 16:50:59 relay_0_energy_kWh 0.631858
setstate PVAnlage 2022-01-02 16:50:39 restart_required false
setstate PVAnlage 2022-01-02 17:01:51 result_was_on true
setstate PVAnlage 2022-01-02 17:27:59 source timer
setstate PVAnlage 2022-01-02 17:28:17 src shellyplus1pm-44179394cab4
setstate PVAnlage 2022-01-02 17:27:59 state on
setstate PVAnlage 2022-01-02 17:27:59 switch_0_aenergy_by_minute_1 0.000
setstate PVAnlage 2022-01-02 17:27:59 switch_0_aenergy_by_minute_2 0.000
setstate PVAnlage 2022-01-02 17:27:59 switch_0_aenergy_by_minute_3 0.000
setstate PVAnlage 2022-01-02 17:27:59 switch_0_aenergy_minute_ts 1641140878
setstate PVAnlage 2022-01-02 17:27:59 switch_0_aenergy_total 0.000
setstate PVAnlage 2022-01-02 11:24:03 switch_0_apower 142.2
setstate PVAnlage 2022-01-02 17:27:59 switch_0_current 0.0
setstate PVAnlage 2022-01-02 17:27:59 switch_0_id 0
setstate PVAnlage 2022-01-02 17:27:59 switch_0_output true
setstate PVAnlage 2022-01-02 17:27:59 switch_0_source timer
setstate PVAnlage 2022-01-02 11:24:03 switch_0_temperature_tC 39.5
setstate PVAnlage 2022-01-02 11:24:03 switch_0_temperature_tF 103.1
setstate PVAnlage 2022-01-02 17:01:59 switch_0_timer_duration 30.00
setstate PVAnlage 2022-01-02 17:01:59 switch_0_timer_started_at 1641139311.56
setstate PVAnlage 2022-01-02 17:27:59 switch_0_voltage 216.1
setstate PVAnlage 2022-01-02 16:50:39 sys_available_updates_beta_version 0.9.2-beta2
setstate PVAnlage 2022-01-02 16:50:39 sys_cfg_rev 10
setstate PVAnlage 2022-01-02 16:50:39 sys_fs_free 233472
setstate PVAnlage 2022-01-02 16:50:39 sys_fs_size 458752
setstate PVAnlage 2022-01-02 16:50:39 sys_mac 44179394CAB4
setstate PVAnlage 2022-01-02 16:50:39 sys_ram_free 176824
setstate PVAnlage 2022-01-02 16:50:39 sys_ram_size 249588
setstate PVAnlage 2022-01-02 16:50:39 sys_restart_required false
setstate PVAnlage 2022-01-02 16:50:39 sys_time 16:50
setstate PVAnlage 2022-01-02 16:50:39 sys_unixtime 1641138639
setstate PVAnlage 2022-01-02 16:50:39 sys_uptime 11
setstate PVAnlage 2022-01-02 17:27:59 temperature 40.7
setstate PVAnlage 2022-01-02 17:27:59 temperature_tC 40.7
setstate PVAnlage 2022-01-02 17:27:59 temperature_tF 105.3
setstate PVAnlage 2022-01-02 16:50:39 time 16:50
setstate PVAnlage 2022-01-02 17:01:59 timer_duration 30.00
setstate PVAnlage 2022-01-02 17:01:59 timer_started_at 1641139311.56
setstate PVAnlage 2022-01-02 16:50:39 unixtime 1641138639
setstate PVAnlage 2022-01-02 16:50:39 uptime 11
setstate PVAnlage 2022-01-02 17:27:59 voltage 216.1




@87insane
Danke keine Ahnung was da beim c&p passiert ist
Aber es funkt jetzt wie es soll und ich hab auch die Kosten/Ertragsrechnung angepasst da ja jetzt schon WattStunden und nicht mehr Minuten angegeben werden
Danke für deine Arbeit mit und meine "patschertkeit = österr. Ausdruck für ungeschickt
Nice Eve
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

87insane

Hey das ist gut.

Also seid ihr vermutlich auch für diese Lösung oder hat jemand einwände?

Grundsätzlich muss halt jemand bestätigen das es so auch geht. Sonst wird das Template von FHEM nicht angepasst.

Ich weiß das meine devstateicon variante "übertrieben" ist aber ich mag sie. Anders geht natürlich immer.

Gruß,
87insane

vic

Danke für eure Antworten und vor allem die RAWs.

Bei mir klappt es immer noch nicht.
Als Letztes hatte ich Helmi55s RAW 1:1 übernommen und nur die folgenden Parameter angepasst:
shellyplus1pm_44179394cab4  ->  shellyplus1_a8032abcd5e8
shellyplus1pm-44179394cab4  ->  shellyplus1-a8032abcd5e8

Der Aktor reagiert genau wie immer. Auch ein weiteres Shelly lieferte das gleiche Ergebnis.

Ich blicke da nicht mehr durch.
Es kann doch nicht daran liegen dass ich einen shellyplus1 anstatt ein shellyplus1pm einsetze oder?

Danke für eure Hilfe
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

Helmi55

Hallo Vic
Zeig uns mal dein RAW. Ich bin kein Spezialist aber vielleicht sehe ich auch was
Ich hab leider mein umbenanntes RAW gepostet aber du musst ja nur PVAnlage mit deinen Shelly Daten austauschen

@87insane mMn ist das Template perfekt

Grüße
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

smoudo

#40
So ich kam jetzt auch zum testen. Bei mir ist es das gleiche.
Ich habe jetzt im Webcmd noch ein on:off zusätzlich mit eingebaut. Damit wird der state auf on oder off gesetzt. Sobald ich das Icon betätige wird im state toggle gesetzt und das icon springt auch auf toggle.
Anbei mein RAW. Testweise als shellyPlus_1pm und mit dem zusätzlichen webcmd eintrag. ergebnis bei beiden settings das gleiche.
Wo könnte man denn das icon generell ändern? habe überall die rc_RED oder rc_Green bei den Steckdosen.
Die setstate Einträge habe ich nicht abgeändert. Ich gehe davon aus diese werden vom device gesetzt. Falls das relevant sein sollte bitte um kurzen Fingerzeig :)


defmod Strom_Strasse MQTT2_DEVICE shellyplus1_a8032abcdffc
attr Strom_Strasse devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'\
?'10px-kreis-rot'\
: ReadingsVal($name,'new_fw','false') eq 'true' \
? '10px-kreis-gelb' \
: '10px-kreis-gruen';; \
$onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','false');;\
$light = FW_makeImage($light);; \
my $cons = ReadingsNum($name,'apower',0);; \
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;\
my $temp = ReadingsVal($name,'temperature','-100');; \
my $ip = ReadingsVal($name,'ip','none');; \
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr Strom_Strasse devicetopic shellyplus1-a8032abcdffc
attr Strom_Strasse event-on-change-reading .*
attr Strom_Strasse group Aussensteckdosen
attr Strom_Strasse icon message_socket
attr Strom_Strasse jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr Strom_Strasse model shellyPlus_1pm
attr Strom_Strasse readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }\
shellyplus1_a8032abcdffc:shellyplus1_a8032abcdffc/events/rpc:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcdffc:shellyplus1_a8032abcdffc/status/switch_0:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcdffc:shellyplus1_a8032abcdffc/online:.* online\
shellyplus1_a8032abcdffc:shellyplus1_a8032abcdffc/status/mqtt:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcdffc:shellyplus1_a8032abcdffc/status/cloud:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcdffc:shellyplus1_a8032abcdffc/status/sys:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcdffc:fhem/rpc:.* { json2nameValue($EVENT) }
attr Strom_Strasse room Outdoor
attr Strom_Strasse setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}
attr Strom_Strasse userReadings relay_0_energy_kWh:params_switch_0_aenergy_total.* monotonic {ReadingsVal($NAME,"params_switch_0_aenergy_total",0)/1000.0}, Ertrag:relay_0_energy_kWh.* { sprintf("%.2f",(ReadingsVal($NAME,"relay_0_energy_kWh",0) - 0.01)*.2);;;;}
attr Strom_Strasse webCmd : on:off

setstate Strom_Strasse off
setstate Strom_Strasse 2022-01-03 23:52:55 IODev MQTT2_FHEM_Server
setstate Strom_Strasse 2021-12-27 11:58:43 attrTemplateVersion 20211224
setstate Strom_Strasse 2022-01-03 23:55:24 dst fhem
setstate Strom_Strasse 2022-01-03 23:55:24 id 0
setstate Strom_Strasse 2022-01-01 10:22:20 ip 192.168.1.50
setstate Strom_Strasse 2022-01-03 23:55:21 method NotifyStatus
setstate Strom_Strasse 2022-01-03 16:48:45 online true
setstate Strom_Strasse 2021-12-27 12:11:28 params_events_1_cfg_rev 36
setstate Strom_Strasse 2021-12-27 12:11:28 params_events_1_component sys
setstate Strom_Strasse 2021-12-27 12:11:28 params_events_1_event config_changed
setstate Strom_Strasse 2021-12-27 12:11:28 params_events_1_restart_required false
setstate Strom_Strasse 2021-12-27 12:11:28 params_events_1_ts 1640603488.46
setstate Strom_Strasse 2022-01-03 16:48:45 params_mqtt_connected true
setstate Strom_Strasse 2022-01-03 23:55:21 params_switch_0_id 0
setstate Strom_Strasse 2022-01-03 23:55:21 params_switch_0_output false
setstate Strom_Strasse 2022-01-03 23:55:21 params_switch_0_source MQTT
setstate Strom_Strasse 2021-12-31 21:28:32 params_switch_0_temperature_tC 48.48
setstate Strom_Strasse 2021-12-31 21:28:32 params_switch_0_temperature_tF 119.26
setstate Strom_Strasse 2022-01-03 00:51:58 params_sys_available_updates_beta_version 0.9.2-beta2
setstate Strom_Strasse 2022-01-03 23:55:21 params_ts 1641250521.69
setstate Strom_Strasse 2022-01-01 10:22:20 params_wifi_rssi -56
setstate Strom_Strasse 2022-01-01 10:22:20 params_wifi_ssid homenet 24
setstate Strom_Strasse 2022-01-01 10:22:20 params_wifi_status got ip
setstate Strom_Strasse 2022-01-03 23:55:24 result_was_on false
setstate Strom_Strasse 2022-01-03 23:55:24 src shellyplus1-a8032abcdffc
setstate Strom_Strasse 2022-01-03 23:55:24 state off


Plus zum besseren Verständnis ein Bild von dem ganzen.

Viele Grüße und vielen Dank für Eure Mühen!!

Matze

OdfFhem

@smoudo

***

Das Attribut icon legt das Icon vor dem Namen in der Übersichtszeile fest.

Das Attribut devStateIcon legt das "Icon" hinter dem Namen in der Übersichtszeile fest.
Für dieses "Icon" gibt es zwei Möglichkeiten; in Deinem Fall wird die freie Gestaltung mit Perl unterstützt. Die Variable "$onl" legt das erste Icon fest (basiert auf dem Reading "online" und dem noch fehlenden Reading "new_fw"), die Variable "$light" legt das zweite Icon fest (basiert auf dem Reading "state"; besser wäre hier vermutlich das output-Reading, da ansonsten zu viele Zustände entstehen).

***

Dein Attribut readingList ist unnötig groß. Da Du das Attribut "devicetopic" definiert hast, sollten hier nur Einträge mit $DEVICETOPIC hinterlegt werden; alle anderen sollten gelöscht werden. Taucht "irgendwann" ein Eintrag ohne $DEVICETOPIC auf, dann ist ein bislang noch nicht unterstützer Eintrag dazugekommen (momentan wäre ein möglicher Verursacher der fehlende Eintrag für $DEVICETOPIC/rpc ... quasi identisch zu $DEVICETOPIC/events/rpc).

Frage ist noch, welches topic bei Deinem Shelly in der MQTT-Konfiguration hinterlegt ist (mit - oder mit _). Dieser Wert sollte im devicetopic-Attribut hinterlegt werden.

***

Beim Attribut setList "stören" die doppelten Backslash am Ende jeder Zeile.

***

Zeilen mit setstate sollten auf jeden Fall ignoriert und nicht übernommen werden.

vic

@Helmi55: Anbei sende ich dir mein RAW

defmod PVAnlage MQTT2_DEVICE shellyplus1_a8032abcd5e8
attr PVAnlage devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'\
?'10px-kreis-rot'\
: ReadingsVal($name,'new_fw','false') eq 'true' \
? '10px-kreis-gelb' \
: '10px-kreis-gruen';; \
$onl = FW_makeImage($onl);; \
my $light = ReadingsVal($name,'state','false');;\
$light = FW_makeImage($light);; \
my $cons = ReadingsNum($name,'apower',0);; \
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;\
my $temp = ReadingsVal($name,'temperature','-100');; \
my $ip = ReadingsVal($name,'ip','none');; \
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr PVAnlage devicetopic shellyplus1-a8032abcd5e8
attr PVAnlage event-on-change-reading .*
attr PVAnlage jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr PVAnlage model shellyPlus_1pm
attr PVAnlage readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/true/"on"/g;; $EVENT =~ s/false/"off"/g;; $EVENT =~ m,(on|off),g ? { state => $1 } : undef }\
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/events/rpc:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/status/switch_0:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/online:.* online\
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/status/mqtt:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/status/cloud:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/status/sys:.* { json2nameValue($EVENT) }\
shellyplus1_a8032abcd5e8:fhem/rpc:.* { json2nameValue($EVENT) }
attr PVAnlage room PV Anlage,MQTT2_DEVICE
attr PVAnlage setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}
attr PVAnlage userReadings relay_0_energy_kWh:params_switch_0_aenergy_total.* monotonic {ReadingsVal($NAME,"params_switch_0_aenergy_total",0)/1000.0}, Ertrag:relay_0_energy_kWh.* { sprintf("%.2f",(ReadingsVal($NAME,"relay_0_energy_kWh",0) - 0.01)*.2);;;;}
attr PVAnlage webCmd :

setstate PVAnlage toggle
setstate PVAnlage 2022-01-04 08:25:02 IODev MQTT2
setstate PVAnlage 2022-01-04 08:26:35 dst shellyplus1-a8032abcd5e8/events
setstate PVAnlage 2022-01-04 08:26:35 id 0
setstate PVAnlage 2022-01-04 08:26:35 method NotifyStatus
setstate PVAnlage 2022-01-04 08:25:31 online true
setstate PVAnlage 2022-01-04 08:25:31 params_mqtt_connected false
setstate PVAnlage 2022-01-04 08:26:35 params_switch_0_id 0
setstate PVAnlage 2022-01-04 08:26:35 params_switch_0_output true
setstate PVAnlage 2022-01-04 08:26:35 params_switch_0_source MQTT
setstate PVAnlage 2022-01-04 08:26:35 params_ts 1641281195.62
setstate PVAnlage 2022-01-04 08:26:35 result_was_on false
setstate PVAnlage 2022-01-04 08:26:35 src shellyplus1-a8032abcd5e8
setstate PVAnlage 2022-01-04 08:26:34 state toggle


Was mir aufgefallen ist.. wenn ich nicht on oder off schalte sondern zu beginn direkt auf dem Icon so bleibt der STATE-parameter auf ???. Wenn ich z.B. auf on schalte so ist dann STATE auf on. Mit Klick auf Icon bleibt er auf on. Der state-Parameter auf Readings hingegen wechselt auf toggle.

Vielleich hilft das was.
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

Helmi55

Servus vic

Ich habe meine pluspm mit obiger RAW zum Laufen bekommen.
ich kann leider nicht sagen wie sich ein shelly plus ohne pm verhält? Ich habe keinen und weiß leider auch nicht ob es da unterschiede (außer pm) gibt.

Gruß
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

vic

Guten Tag Helmut

Du kannst somit den Shelly mittels Klicken auf dem Icon schalten (das funktioniert bei mir ebenfalls) .und. das Icon wechselt die Darstellung (das funktioniert bei mir nicht  >:( :().

Grüsse
Claudio
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

Helmi55

Servus Claudio

ja das funktioniert ohne Probleme. Es erscheint lediglich beim Drücken rechts der kleine grüne, runde Pfeil (toggle).
Aber das ist keine Sekunde.
Ich kann vom Shelly aus schalten und auch aus FHEM heraus.

@87insane Was mir auffällt, bei den "alten" Shellies kam man beim Klick auf den grünen Punkt direkt auf die Website des Shellies.       
                 Das funkt hier leider nicht. Ist aber kein muss, war nur ein nice to have

Gruß
Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

vic

Hallo Helmut

In dem Fall kann es nur am unterschied Shellyplus1 und Shellyplus1pm liegen. Etwas anderes kann ich mir nicht erklären. Werde bei nächster Gelegenheit ein pm kaufen.

Danke für eure Hilfe

Beste Grüsse
Claudio
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

87insane

Shelly ganz am Ende neu gestartet? Bei mir geht das klicken auf die Webseite. Also da bei mir alles geht, bin ich noch immer verwundert. Raw Editor auf und einfach übernehmen + eben Namen des shelly anpassen. (An allen stellen).

Was genau passiert denn wenn du auf den Grünen Punkt klickst?

Helmi55

#48
Servus
Wenn ich auf den grünen Punkt klicke erscheint
,,Safari kann die Seite nicht öffnen da Server nicht gefunden"
Obwohl sonst alles schalttechnisch funktioniert
Gruß Helmut
System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

87insane

Ich glaube das Thema Gerät anlegen, können wir hier in großer "Lernrunde" mal angehen.


devStateIcon mal ein wenig erklärt:
Vorwort: Es gibt natürlich immer verschiedene Wege !
In diesem Fall ist es so:

1. Damit der grüne Punkt grün/rot werden kann, braucht er das Reading "online". Für gelb wird das Reading "new_fw" abgefragt.
{my $onl = ReadingsVal($name,'online','false') eq 'false'
?'10px-kreis-rot'
: ReadingsVal($name,'new_fw','false') eq 'true'
? '10px-kreis-gelb'
: '10px-kreis-gruen';
$onl = FW_makeImage($onl);


2. Im nächsten Schritt wird hier alles gesammelt, was man so haben will. In dem Fall Watt, IP usw.
Wie man hier sieht, werden die Werte der verschiedenen Readings einfach in eine Variable geschrieben.
Damit irgendwas in eine Variable geschrieben werden kann, muss es natürlich auch da sein. Nehmen wir mal an ich habe im Shelly nicht
alles korrekt eingestellt oder den Shelly nicht neu gestartet, dann hab ich z.B. kein IP Reading und somit auch keine IP.
Wie man hier gut sehen kann, hat "ReadingsVal" eine Art "Fallback". Wenn das Reading "ip" nicht existiert, nimmt er "none", was
dann natürlich in deinem Safari/Chrome usw nicht aufgelöst werden kann.
my $light = ReadingsVal($name,'state','false');
$light = FW_makeImage($light);
my $cons = ReadingsNum($name,'apower',0);
my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);
my $temp = ReadingsVal($name,'temperature','-100');
my $ip = ReadingsVal($name,'ip','none');


3. In diesem Schritt, wird alles angezeigt. Hier werden mit Hilfe von z.B. HTML einfach die verschiedenen Bauteile zusammen gesteckt.
Hier sieht man z.B. aber auch den Link, der hinter dem grünen Punkt steckt.
qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}

Ich bitte wirklich noch einmal darum, Fehler mit der Meldung: "geht nicht" etwas besser zu beschreiben oder eben mit RAW oder oder oder. Aber keiner von Euch, fährt in die
Autowerkstatt und sagt, geht nicht und geht wieder. Ich bin weder in Eurem Kopf noch stehe ich daneben ;)

Hinweis: Es sollte ein neues Template im SVN sein ;) In dem wurde dann erstmal so übernommen. Auch da stecken noch Fehler drin. Deswegen bitte nochmal aufmerksam hier mit testen und dann läuft das schon. Ich möchte an der Stelle darauf hinweisen, bei mir geht das alles ;) Also ich erfinde das nicht neu oder so....

Weitere Fragen dazu, bitte gern. Ggf. bekommen wir ja die Fehlenden Puzzelteile in Euren/meinen Kopf :)

vic

Danke 87insane für die ausführlichen Rückmeldungen. Dachte dass ich die Beschreibungen so genau wie möglich erstellt hatte.

Unterdessen habe ich folgendes versucht:
Komplett neues ShellyPlus_1 angeschlossen.
Unter dem WebGui des Shelly die Parameter WIFI (Bild 1) und MQTT (Bild 2) angepasst.
Anschliessend unter FHEM
Dem angelernten Device die CID wegkopiert (shellyplus1_a8032abcd684)
Im Editor deine RAW eingefügt.

defmod MQTT2_shellyplus1pm_7c87ce657e74 MQTT2_DEVICE shellyplus1pm_7c87ce657e74
attr MQTT2_shellyplus1pm_7c87ce657e74 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = ReadingsVal($name,'output','false') =~ m{false|off}?'off':'on';; $light = FW_makeImage($light);; my $cons = ReadingsNum($name,'apower',0);; my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);; my $temp = ReadingsVal($name,'temperature','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1pm_7c87ce657e74 devicetopic shellyplus1pm-7c87ce657e74
attr MQTT2_shellyplus1pm_7c87ce657e74 event-on-change-reading .*
attr MQTT2_shellyplus1pm_7c87ce657e74 genericDeviceType switch
attr MQTT2_shellyplus1pm_7c87ce657e74 jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1pm_7c87ce657e74 model shellyPlus_1pm
attr MQTT2_shellyplus1pm_7c87ce657e74 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  fhem/rpc:.* { json2nameValue($EVENT,'rpc_',$JSONMAP) }
attr MQTT2_shellyplus1pm_7c87ce657e74 room MQTT2_DEVICE
attr MQTT2_shellyplus1pm_7c87ce657e74 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}

setstate MQTT2_shellyplus1pm_7c87ce657e74 toggle
setstate MQTT2_shellyplus1pm_7c87ce657e74 2021-12-24 11:42:44 aenergy_total 0.000
setstate MQTT2_shellyplus1pm_7c87ce657e74 2021-12-24 11:42:00 apower 0.0
setstate MQTT2_shellyplus1pm_7c87ce657e74 2021-12-24 11:43:38 dst shellyplus1pm-7c87ce657e74/events


die CID angepasst shellyplus1pm_7c87ce657e74 --> shellyplus1_a8032abcd684  und   shellyplus1pm-7c87ce657e74 --> shellyplus1-a8032abcd684

Shelly neu gestartet
FHEM neu gestartet nach dem Neustart erschien die Meldung unknown attribute genericDeviceType (Bild 3). Attribut entfernt

Das Shelly reagierte nicht --> attribut model von shellyPluspm auf shellyPlus geändert

Nun reagiert das Shelly bei Klick auf dem Lampen-Symbol und bei Klick auf on oder off.
Das Lampensymbol jedoch bleibt erhalten FS20.off (Bild 4)
Die Modi online (Bild 5) oder offline (Bild 6) reagieren wie gewünscht.
Wenn ich auf den grünen Kreis klicke erscheint die Website des Shelly (wie gewünscht)

Hier noch mein RAW
defmod MQTT2_shellyplus1_a8032abcd684 MQTT2_DEVICE shellyplus1_a8032abcd684
attr MQTT2_shellyplus1_a8032abcd684 devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = ReadingsVal($name,'output','false') =~ m{false|off}?'off':'on';; $light = FW_makeImage($light);; my $cons = ReadingsNum($name,'apower',0);; my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);; my $temp = ReadingsVal($name,'temperature','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr MQTT2_shellyplus1_a8032abcd684 devicetopic shellyplus1-a8032abcd684
attr MQTT2_shellyplus1_a8032abcd684 event-on-change-reading .*
attr MQTT2_shellyplus1_a8032abcd684 jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr MQTT2_shellyplus1_a8032abcd684 model shellyPlus_1
attr MQTT2_shellyplus1_a8032abcd684 readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  fhem/rpc:.* { json2nameValue($EVENT,'rpc_',$JSONMAP) }\
shellyplus1_a8032abcd684:shellyplus1-a8032abcd684/online:.* online
attr MQTT2_shellyplus1_a8032abcd684 room MQTT2_DEVICE
attr MQTT2_shellyplus1_a8032abcd684 setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}

setstate MQTT2_shellyplus1_a8032abcd684 off
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:03:52 IODev MQTT2
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:06 dst shellyplus1-a8032abcd684/events
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:00 ip 192.168.10.168
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:06 method NotifyStatus
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:26:59 online true
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:00 params_mqtt_connected true
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:00 params_switch_0_id 0
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:16:41 params_switch_0_output false
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:16:41 params_switch_0_source MQTT
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:00 params_switch_0_temperature_tC 42.45
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:00 params_switch_0_temperature_tF 108.41
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:06 params_sys_available_updates_beta_version 0.9.2-beta2
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:06 params_sys_available_updates_stable_version 0.9.1
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:06 params_ts 1641454026.53
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:00 params_wifi_rssi -52
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:00 params_wifi_ssid Lienta_01
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:00 params_wifi_status got ip
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:16:41 rpc_dst fhem
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:16:41 rpc_id 0
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:16:41 rpc_result_was_on true
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:16:41 rpc_src shellyplus1-a8032abcd684
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:27:06 src shellyplus1-a8032abcd684
setstate MQTT2_shellyplus1_a8032abcd684 2022-01-06 08:16:41 state off



Ich weiss nun wirklich nicht wo der Schuh drückt.

Grüsse
Claudio
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

OdfFhem

@vic

zunächst einmal zum MQTT-Screenshot: Welche "Firmware version" hast Du ?
Ich selbst nutze keinen ShellyPLUS1, sondern einen ShellyPLUS1PM mit "Firmware version" 0.9.1 und der MQTT-Screenshot sieht deutlich erweitert aus ...

Bzgl. Lampensymbol: Im Attribut devStateIcon basiert der Lampenstatus auf ReadingsVal($name,'output','false'). Laut Deinem RAW hast Du kein solches Reading, sondern heisst bei Dir (noch) params_switch_0_output

Helmi55

Hallo 87insane

Danke für das neue Template!
Habe soeben ein update in FHEM gemacht und nun sieht es super aus
Hier ein aktuelles RAW von meinem plus1pm
defmod PVAnlage MQTT2_DEVICE shellyplus1pm_44179394cab4
attr PVAnlage devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = FW_makeImage(ReadingsVal($name,'state','off'));; my $cons = ReadingsNum($name,'apower',0);; my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);; my $temp = ReadingsVal($name,'temperature','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr PVAnlage devicetopic shellyplus1pm-44179394cab4
attr PVAnlage event-on-change-reading .*
attr PVAnlage icon message_socket
attr PVAnlage jsonMap switch_state:state params_switch_0_aenergy_total:aenergy_total switch_apower:apower switch_temperature_tC:temperature switch_temperature_tF:0 params_wifi_sta_ip:ip
attr PVAnlage model shellyPlus_1pm
attr PVAnlage readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT, 'switch_', $JSONMAP) }\
  fhem2shelly/rpc:.* {}
attr PVAnlage room PV Anlage,MQTT2_DEVICE
attr PVAnlage setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Reboot"}
attr PVAnlage setStateList on off toggle
attr PVAnlage userReadings relay_0_energy_kWh:params_switch_0_aenergy_total.* monotonic {ReadingsVal($NAME,"params_switch_0_aenergy_total",0)/1000.0}, Ertrag:relay_0_energy_kWh.* { sprintf("%.2f",(ReadingsVal($NAME,"relay_0_energy_kWh",0) - 0.00)*.2);;;;}
attr PVAnlage webCmd :


Es erscheint auch die Weboberfläche des Shellies beim Klick auf den grünen Punkt

Danke für deine Zeit und Hilfe - vor allem Geduld mit den Unwissenden

Helmut

System1 fhem 6.1 auf RPi 4B mit 4GB, HMUSBConfig, DS9490R-1Wire, Busware USB 868, Pool-Solarsteuerung mit FHEM. System2 fhem 6.1 auf RPi 4B mit 4GB (Bullseye) mit Busware USB 868 und 433 und HMUARTLGW für Haussteuerung

https://www.flickr.com/photos/canonhelmi/

smoudo

jetzt bin ich vollends verwirrt  ;D

Ich habe fhem geupdated und das neue template eingespielt.
Sowohl als shellyPlus_1 als auch shellyPlus_1pm probiert.
In beiden fällen bekomme ich jetzt im state wenn ich on:off als webcmd betätige den Wert "set_off" oder "set_on" und bei betätigung des icon "set_toggle"
Was noch nie ging ist die Temperatur Anzeige. Das reading war auch nach neuanlegen erstmal nicht da. Habe ich manuell hinzugefügt um die funktion zu sehen.

Anbei mein RAW:
efmod Strom_Strasse MQTT2_DEVICE shellyplus1_a8032abcdffc
attr Strom_Strasse devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = FW_makeImage(ReadingsVal($name,'state','off'));; my $cons = ReadingsNum($name,'apower',0);; my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);; my $temp = ReadingsVal($name,'temperature','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr Strom_Strasse devicetopic shellyplus1-a8032abcdffc
attr Strom_Strasse event-on-change-reading .*
attr Strom_Strasse group Aussensteckdosen
attr Strom_Strasse icon message_socket
attr Strom_Strasse jsonMap switch_state:state params_switch_0_aenergy_total:aenergy_total switch_apower:apower switch_temperature_tC:temperature switch_temperature_tF:0 params_wifi_sta_ip:ip
attr Strom_Strasse model shellyPlus_1pm
attr Strom_Strasse readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT, 'switch_', $JSONMAP) }\
  fhem2shelly/rpc:.* {}
attr Strom_Strasse room Outdoor
attr Strom_Strasse setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Reboot"}
attr Strom_Strasse setStateList on off toggle
attr Strom_Strasse userReadings relay_0_energy_kWh:params_switch_0_aenergy_total.* monotonic {ReadingsVal($NAME,"params_switch_0_aenergy_total",0)/1000.0}, Ertrag:relay_0_energy_kWh.* { sprintf("%.2f",(ReadingsVal($NAME,"relay_0_energy_kWh",0) - 0.01)*.2);;;;}
attr Strom_Strasse webCmd : on:off

setstate Strom_Strasse set_toggle
setstate Strom_Strasse 2022-01-07 01:24:35 IODev MQTT2_FHEM_Server
setstate Strom_Strasse 2022-01-07 01:21:59 attrTemplateVersion 20220104
setstate Strom_Strasse 2022-01-07 01:29:01 dst shellyplus1-a8032abcdffc/events
setstate Strom_Strasse 2022-01-07 01:22:11 ip 192.168.1.50
setstate Strom_Strasse 2022-01-07 01:29:01 method NotifyStatus
setstate Strom_Strasse 2022-01-07 01:22:11 online true
setstate Strom_Strasse 2022-01-07 01:22:11 params_mqtt_connected true
setstate Strom_Strasse 2022-01-07 01:29:01 params_switch_0_id 0
setstate Strom_Strasse 2022-01-07 01:29:01 params_switch_0_output true
setstate Strom_Strasse 2022-01-07 01:29:01 params_switch_0_source MQTT
setstate Strom_Strasse 2021-12-31 21:28:32 params_switch_0_temperature_tC 48.48
setstate Strom_Strasse 2021-12-31 21:28:32 params_switch_0_temperature_tF 119.26
setstate Strom_Strasse 2022-01-07 01:22:20 params_sys_available_updates_beta_version 0.9.2-beta2
setstate Strom_Strasse 2022-01-07 01:29:01 params_ts 1641515341.55
setstate Strom_Strasse 2022-01-07 01:22:11 params_wifi_rssi -57
setstate Strom_Strasse 2022-01-07 01:22:11 params_wifi_ssid homenet 24
setstate Strom_Strasse 2022-01-07 01:22:11 params_wifi_status got ip
setstate Strom_Strasse 2022-01-07 01:29:01 src shellyplus1-a8032abcdffc
setstate Strom_Strasse 2022-01-07 01:29:01 state set_toggle


Ich hänge noch ein paar screenshots an zum verdeutlichen des problems.

Nochmals vielen Dank für Eure Geduld und Hilfe!!

Viele Grüße

Matze



OdfFhem

@smoudo

set_on, set_off und set_toggle hängen mit dem Attribut setStateList zusammen.
devStateIcon geht für die $light-Variable auf das state-Reading und findet zumindest für toggle anschließend kein verwenbares Icon.

Beim Attribut jsonMap geht man meist davon aus, dass man die "neuen" Werte über das switch_0-Subtopic bekommt. Dafür müsste man aber  "Generic status update over MQTT" aktiviert haben, ansonsten bekommt man über diesen Weg keine Info. Ich würde den aber ausser für Testzwecke auch nicht einschalten, da ich mit den weiter oben gezeigten Einstellungen beim bisherigen Firmware-Entwicklungsstand auf dem aktuellen Stand gehalten werde.
Ob es den Generic-Schalter beim plus1 überhaupt gibt, kann ich nicht sagen, da ich nur plus1pm einsetze.

vic

#55
@OdfFhem
Die Firmware-Version ist 0.9.1.     VIELEN DANK!!!! Das war das fehlende Puzzleteil. Ich habe im devStateIcon folgende Anpassung vorgenommen:
von
ReadingsVal($name,'output','false')

auf
ReadingsVal($name,'params_switch_0_output','false')

Jetzt funktioniert alles so wie ich es gerne hätte

Anbei noch mein RAW für interessierte:
defmod SH_AKT_149_AntiMuecken MQTT2_DEVICE shellyplus1_a8032abcd5e8
attr SH_AKT_149_AntiMuecken alias Anti-Mücken
attr SH_AKT_149_AntiMuecken devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';;;; $onl = FW_makeImage($onl);;;; my $light = ReadingsVal($name,'params_switch_0_output','false') =~ m{false|off}?'off':'on';;;; $light = FW_makeImage($light);;;; my $cons = ReadingsNum($name,'apower',0);;;; my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);;;; my $temp = ReadingsVal($name,'temperature','-100');;;; my $ip = ReadingsVal($name,'ip','none');;;; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div></div>)}
attr SH_AKT_149_AntiMuecken devicetopic shellyplus1-a8032abcd5e8
attr SH_AKT_149_AntiMuecken event-on-change-reading .*
attr SH_AKT_149_AntiMuecken group Sommer
attr SH_AKT_149_AntiMuecken icon message_socket
attr SH_AKT_149_AntiMuecken jsonMap params_switch_0_aenergy_total:aenergy_total switch_0_apower:apower switch_0_temperature_tC:temperature switch_0_temperature_tF:0 params_wifi_sta_ip:ip
attr SH_AKT_149_AntiMuecken model shellyPlus_1
attr SH_AKT_149_AntiMuecken readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }\
  fhem/rpc:.* { json2nameValue($EVENT,'rpc_',$JSONMAP) }\
shellyplus1_a8032abcd5e8:shellyplus1-a8032abcd5e8/online:.* online
attr SH_AKT_149_AntiMuecken room MQTT2_DEVICE
attr SH_AKT_149_AntiMuecken setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem","method":"Shelly.Reboot"}
attr SH_AKT_149_AntiMuecken webCmd :

setstate SH_AKT_149_AntiMuecken toggle
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:37:26 IODev MQTT2
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 dst shellyplus1-a8032abcd5e8/events
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:41:31 ip 192.168.10.149
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 method NotifyStatus
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:41:31 online true
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:41:31 params_mqtt_connected true
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 params_switch_0_id 0
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 params_switch_0_output false
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 params_switch_0_source MQTT
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:41:31 params_switch_0_temperature_tC 49.57
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:41:31 params_switch_0_temperature_tF 121.22
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:41:39 params_sys_available_updates_stable_version 0.9.1
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 params_ts 1641555921.75
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:41:31 params_wifi_rssi -66
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:41:31 params_wifi_ssid Lienta_01
setstate SH_AKT_149_AntiMuecken 2022-01-04 16:44:54 params_wifi_sta_ip 192.168.10.149
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:41:31 params_wifi_status got ip
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 rpc_dst fhem
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 rpc_id 0
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 rpc_result_was_on true
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 rpc_src shellyplus1-a8032abcd5e8
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 src shellyplus1-a8032abcd5e8
setstate SH_AKT_149_AntiMuecken 2022-01-07 12:45:21 state toggle



Vielen Dank euch allen... besonders für eure Hartnäckigkeit

@Matze
Bin gespannt auf deine Rückmeldung
Raspberry Pi 4
RFXTRX 868MHz und 433MHz
FS20, Intertechno, Homematic, Shelly
MAX!-Cube, Philips HUE-Bridge

Beta-User

...jetzt schreibe ich doch noch was direkt un diesen Thread im falschen Forenbereich...
ZitatAnbei noch mein RAW für interessierte
Das ist nicht gut! Gründe siehe Shelly-attrTemplate-Thread.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

smoudo

Hallo @Beta-User,

schön mal wieder was von Dir zu lesen.
Mittlerweile gehört der Thread wirklich in den MQTT Bereich. Anfangs war es eher ein ,,Findungsthread" wie man mit den neuen Shellytierchen am besten umgeht  ;)
Währe klasse wenn es ein mod verschieben könnte. Ein separater Shelly Bereich währe auch nice. Man sieht ja an dem Thread das es wohl generell Bedarf gibt. Obwohl ich hier schon einige Zeit mit anderen Systemen hantiere, hab ich mir bei Shelly das passende zu finden, schwer getan. Eigenes Modul, mqtt, ...? Irgendwie war das ganze mit den sonoffs +espeasy einfacher. Ich freue mich aber tierisch das uns hier so toll geholfen wird.

Viele Grüße

Matze

@vic

Ich werde es nachher testen wenn ich wieder am Rechner bin! Danke!!

smoudo

@vic funktioniert jetzt alles top mit den ícons.
Einzig die Systemtemperaturen werden nicht mehr übertragen. Damit kann ich aber leben. Das habe ich auf anderen Geräten auch nicht.
Ich hab mir jetzt testweise noch 2 ShellyPlus_1pm bestellt zum testen. Habe zwar generell nicht den Meteringbedarf, bei den 50ct. aufpreis aber grad wurscht  :D

Viele Grüße

Matze

Beta-User

Zitat von: smoudo am 07 Januar 2022, 13:14:27
Mittlerweile gehört der Thread wirklich in den MQTT Bereich. Anfangs war es eher ein ,,Findungsthread" wie man mit den neuen Shellytierchen am besten umgeht  ;)
Währe klasse wenn es ein mod verschieben könnte.
In der Findungsphase war es ja ok, aber jetzt ist es nur noch MQTT... Eigene Threads verschieben kann jeder User selbst (unter dem Thread links ist ein Knopf).

Zitat
Ein separater Shelly Bereich währe auch nice.
MAn. wäre das kontraproduktiv. Die hier beschrieben Probleme sind nicht wirklich Shelly-spezifisch, und mehr Forenbereiche bringen nicht mehr Übersicht.

ZitatIrgendwie war das ganze mit den sonoffs +espeasy einfacher.
Jein. Es war halt jeweils einheitlich. Ist es hier bei den Shelly im Prinzip auch, der Rest sind MQTT2-Bordmittel, die Bausteinchen für eine gute Lösung sind schon lange vorhanden.

Zitat von: smoudo am 07 Januar 2022, 19:23:39
@vic funktioniert jetzt alles top mit den ícons.
Nochmal: Diese "Lösung" ist "nicht gut"! Gesendet wird "A", es wird aber nicht auf "A" zurückgemappt, was als Antwort kommt => UNTAUGLICH! Problem kaschiert, aber nicht effektiv gelöst!

Just m2*2 ct.
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

87insane

Bevor alle im dunklen tappen....

Sinnig ist es eben die Werte auch sauber in FHEM zu haben. Ein gutes Beispiel ist z.B. ein Heizkörper Thermostat. Natürlich kann ich die vom Hersteller gesendeten Werte xyz darin belassen. Aber wenn diese für die gewünschte Temperatur nicht desired-temp oder desiredTemperature sind, würde ich diese entsprechend biegen. Dahinter steht noch eine ganze Latte die sonst wieder angepasst werden müsste. Allterco geht hier leider wieder einen (in meinen Augen) komplett eigenen Weg, der in einigen Szenarien echt nervt!

Ich denke Beta-User will hier nochmal aufzeigen das es mehr Sinn macht, die Werte direkt sauber zu machen und nicht einfach nur das devStateIcon an zu passen. Natürlich geht das aber ich glaubte das in meinen Beispielen seie das klar rüber gekommen. Die Probleme die hier alle hatten waren reine copy&paste Themen. Gebündelt mit nicht klaren attributen (RAW/nicht RAW).

Wenn wir alle nochmal ein paar Schritte zurück gehen und an die jsonmap denken, da wird das ganze doch ein wenig besser :) Auch die readingsList ist ggf zu überdenken.

ak323

#61
Zitat von: Helmi55 am 06 Januar 2022, 13:38:40
Hallo 87insane

Danke für das neue Template!
Habe soeben ein update in FHEM gemacht und nun sieht es super aus
Hier ein aktuelles RAW von meinem plus1pm
defmod PVAnlage MQTT2_DEVICE shellyplus1pm_44179394cab4
attr PVAnlage devStateIcon {my $onl = ReadingsVal($name,'online','false') eq 'false'?'10px-kreis-rot': ReadingsVal($name,'new_fw','false') eq 'true' ? '10px-kreis-gelb' : '10px-kreis-gruen';; $onl = FW_makeImage($onl);; my $light = FW_makeImage(ReadingsVal($name,'state','off'));; my $cons = ReadingsNum($name,'apower',0);; my $total = round(ReadingsNum($name,'aenergy_total',0)/1000,1);; my $temp = ReadingsVal($name,'temperature','-100');; my $ip = ReadingsVal($name,'ip','none');; qq(<a href="http://$ip"target="_blank">${onl}</a><a href="/fhem?cmd.dummy=set $name toggle&XHR=1">${light}</a><div>Verbrauch: $cons W / Total: $total kwh / Temp: $temp °C</div>)}
attr PVAnlage devicetopic shellyplus1pm-44179394cab4
attr PVAnlage event-on-change-reading .*
attr PVAnlage icon message_socket
attr PVAnlage jsonMap switch_state:state params_switch_0_aenergy_total:aenergy_total switch_apower:apower switch_temperature_tC:temperature switch_temperature_tF:0 params_wifi_sta_ip:ip
attr PVAnlage model shellyPlus_1pm
attr PVAnlage readingList $DEVICETOPIC/online:.* online\
  $DEVICETOPIC/events/rpc:.* { json2nameValue($EVENT,'',$JSONMAP) }\
  $DEVICETOPIC/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }\
  $DEVICETOPIC/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }\
  $DEVICETOPIC/status/switch_0:.* { $EVENT =~ s/"output":true/"state":"on"/g;; $EVENT =~ s/"output":false/"state":"off"/g;; json2nameValue($EVENT, 'switch_', $JSONMAP) }\
  fhem2shelly/rpc:.* {}
attr PVAnlage room PV Anlage,MQTT2_DEVICE
attr PVAnlage setList toggle:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Toggle","params": {"id":0}}\
  off:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":false}}\
  on:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true}}\
  on-for-timer $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Switch.Set","params": {"id":0,"on":true,"toggle_after":$EVTPART1}}\
  x_update:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Update","params": {"stage":"stable"}}\
  x_reboot:noArg $DEVICETOPIC/rpc {"id":0,"src":"fhem2shelly","method":"Shelly.Reboot"}
attr PVAnlage setStateList on off toggle
attr PVAnlage userReadings relay_0_energy_kWh:params_switch_0_aenergy_total.* monotonic {ReadingsVal($NAME,"params_switch_0_aenergy_total",0)/1000.0}, Ertrag:relay_0_energy_kWh.* { sprintf("%.2f",(ReadingsVal($NAME,"relay_0_energy_kWh",0) - 0.00)*.2);;;;}
attr PVAnlage webCmd :


Es erscheint auch die Weboberfläche des Shellies beim Klick auf den grünen Punkt

Danke für deine Zeit und Hilfe - vor allem Geduld mit den Unwissenden

Helmut

Hallo Helmut,
Dein RAW hat mir mit meinem 1pm weitergeholfen. Ich kann den Switch setzen (an/aus), jedoch bekomme ich scheinbar keine Readings. Auf meinem Mosquitto Server kommen die aber schön regelmäßig an ...

shellyplus1pm-3c1111111111111/status/switch:0 {"id":0, "source":"MQTT", "output":true, "apower":23.2, "voltage":227.3, "current":0.270, "aenergy":{"total":803.459,"by_minute":[385.636,393.934,403.697],"minute_ts":1664088419},"temperature":{"tC":46.0, "tF":114.8}}

Mir ist auch aufgefallen, daß mein ShellyPlus1pm das Topic "switch:0" sendet ... in der Definition aber "switch_0" definiert ist ...das passt auch irgendwie nicht.
Shelly hat die Firmware 0.11.1

Hat vielleicht jemand eine Idee ?
RaspberryPi 2 im 19" Rack mit 16x2 i2c LCD, FHEM, diverse HomeMatic, 1-Wire (8x DS18B20, 3x DS2408, 2x DS2413, 5x DS2401, DS2423 ATTiny) über DS9490R#, Waterkotte Ai1QE (WWPR) Wärmepumpe über Modbus, WH1080 über Signalduino, 433MHz Funksteckdosen, WiFi RGBWW via Tasmota, ...

Beta-User

Zitat von: ak323 am 25 September 2022, 07:51:04
Mir ist auch aufgefallen, daß mein ShellyPlus1pm das Topic "switch:0" sendet ... in der Definition aber "switch_0" definiert ist ...das passt auch irgendwie nicht.
Jedenfalls bei MQTT2_SERVER  ist das nicht das Problem; MQTT2_DEVICE nutzt den Doppelpunkt, um CID, Topic und Payload zu trennen, daher werden Doppelpunkte im Topic vor dem Vergleichen mit den readingList-Einträgen ersetzt.
Und wenn MQTT2_CLIENT nicht speziell konfiguriert wurde, abonniert der auch "alles", so dass das ggf. nicht das Problem sein sollte...

Zitat
Hat vielleicht jemand eine Idee ?
Ja.
1. https://forum.fhem.de/index.php/topic,112327.0.html
2. Es gibt eine neuere Fassung des attrTemplate (das ist hier aber nicht das Problem). Also bei Fragen zu  sowas bitte nicht hergehen, und hier copy/paste irgendwas übernehmen, sondern schauen, was es neues gibt und ob das hilft...
(Sobald mal ein Device konfiguriert ist, müßte es auch mit attrTemplate bzw. dem Auflösen der diversen Variablen klappen, wenn MQTT2_CLIENT im Einsatz ist. Man muss nur aufpassen, dass das Device nicht vorher komplett kaputt war und derselbe Fehler wieder weiterkopiert wird).
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

ak323

Zitat von: Beta-User am 25 September 2022, 09:14:08
Jedenfalls bei MQTT2_SERVER  ist das nicht das Problem;

Darum geht es bei meiner Frage ja nicht ... sondern um Mosquitto ...
RaspberryPi 2 im 19" Rack mit 16x2 i2c LCD, FHEM, diverse HomeMatic, 1-Wire (8x DS18B20, 3x DS2408, 2x DS2413, 5x DS2401, DS2423 ATTiny) über DS9490R#, Waterkotte Ai1QE (WWPR) Wärmepumpe über Modbus, WH1080 über Signalduino, 433MHz Funksteckdosen, WiFi RGBWW via Tasmota, ...

Beta-User

Zitat von: ak323 am 25 September 2022, 09:20:33
Darum geht es bei meiner Frage ja nicht ... sondern um Mosquitto ...
Das ist eine sehr aufschlussreiche Antwort auf die hinter dieser Aussage stehenden Frage:
Zitat von: Beta-User am 25 September 2022, 09:14:08
Und wenn MQTT2_CLIENT nicht speziell konfiguriert wurde, abonniert der auch "alles", so dass das ggf. nicht das Problem sein sollte...
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

ak323

ich sehe hier nix Spezielles ...

define meinMQTT2Client MQTT2_CLIENT 192.168.1.1:1883
RaspberryPi 2 im 19" Rack mit 16x2 i2c LCD, FHEM, diverse HomeMatic, 1-Wire (8x DS18B20, 3x DS2408, 2x DS2413, 5x DS2401, DS2423 ATTiny) über DS9490R#, Waterkotte Ai1QE (WWPR) Wärmepumpe über Modbus, WH1080 über Signalduino, 433MHz Funksteckdosen, WiFi RGBWW via Tasmota, ...

Beta-User

a) Ersetze bitte den Unterstrich im Topic mit einem Punkt und
b) beobachte den MQTT-Verkehr an "meinMQTT2Client" ("Show MQTT traffic", das kannst du ggf. mit Filter-Argumenten beschränken auf das, was dieses MQTT2_DEVICE benötigt).

Es muss in b) was passendes reinkommen, und wenn das dann mit dem Punkt (beliebiges Zeichen) aus a) im Device sauber aufgelöst wird, muss ich mir mal den Code von CLIENT näher ansehen...

c) [OT] Code-Tags wären v.a. für längere Schnippsel hilfreich ;)
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

ak323

Ich kann den ShellyPlus1pm per MQTT schalten

zu a) Geändert auf . aber es passiert nix
zu b) Da sehe ich nichts
RaspberryPi 2 im 19" Rack mit 16x2 i2c LCD, FHEM, diverse HomeMatic, 1-Wire (8x DS18B20, 3x DS2408, 2x DS2413, 5x DS2401, DS2423 ATTiny) über DS9490R#, Waterkotte Ai1QE (WWPR) Wärmepumpe über Modbus, WH1080 über Signalduino, 433MHz Funksteckdosen, WiFi RGBWW via Tasmota, ...

Beta-User

Zitat von: ak323 am 25 September 2022, 10:48:41
Ich kann den ShellyPlus1pm per MQTT schalten

zu a) Geändert auf . aber es passiert nix
zu b) Da sehe ich nichts
Klar ist, wenn b) nicht klappt, ist irgendwas faul, es kommt nichts zurück, dann bringt a) auch keine Verbesserung. Komisch ist dabei nur, dass das Schalten klappt, von daher _müßte_ die IODev-Zuweisung eigentlich passen.

Ansonsten ist meine Glaskugel blind...
Zitat von: Beta-User am 25 September 2022, 09:14:08
1. https://forum.fhem.de/index.php/topic,112327.0.html
Server: HP-elitedesk@Debian 12, aktuelles FHEM@ConfigDB | CUL_HM (VCCU) | MQTT2: MiLight@ESP-GW, BT@OpenMQTTGw | MySensors: seriell, v.a. 2.3.1@RS485 | ZWave | ZigBee@deCONZ | SIGNALduino | MapleCUN | RHASSPY
svn: u.a MySensors, Weekday-&RandomTimer, Twilight,  div. attrTemplate-files

maddhin

bei mir kommt als state beim Shelly Plus 1 immer "OK" und nicht on/off und das Glühbirnensymbol. Kann man das irgendwie ändern?

TomLee

Zitat von: maddhin am 02 Oktober 2022, 21:55:54
bei mir kommt als state beim Shelly Plus 1 immer "OK" und nicht on/off und das Glühbirnensymbol. Kann man das irgendwie ändern?

siehe vorheriges, letztes Zitat und die Bemerkung dazu ...