gelöst: MQTT Befehle für Shelly Plus 1PM

Begonnen von romakrau, 19 November 2021, 18:02:29

Vorheriges Thema - Nächstes Thema

romakrau

Hallo zusammen,
ich versuche meinen Shelly Plus 1PM per MQTT2 ein- und auszuschalten. Leider gelingt mir dies nicht und ich brauche Hilfe.
Anbei das List des Devices:
Internals:
   CFGFN     
   CID        shellyplus1pm_a8032abe179c
   DEF        shellyplus1pm_a8032abe179c
   DEVICETOPIC MQTT2_shellyplus1pm_a8032abe179c
   FUUID      6197d5c8-f33f-e93f-d43c-da313fabf5089409
   IODev      myBroker
   LASTInputDev myBroker
   MSGCNT     14
   NAME       MQTT2_shellyplus1pm_a8032abe179c
   NR         427
   STATE      ???
   TYPE       MQTT2_DEVICE
   myBroker_MSGCNT 14
   myBroker_TIME 2021-11-19 17:53:10
   READINGS:
     2021-11-19 17:50:16   IODev           myBroker
     2021-11-19 17:50:16   mqtt_connected  true
     2021-11-19 17:50:16   online          true
     2021-11-19 17:53:10   rpc_dst         shellyplus1pm-a8032abe179c/events
     2021-11-19 17:53:10   rpc_method      NotifyStatus
     2021-11-19 17:50:16   rpc_params_mqtt_connected true
     2021-11-19 17:53:10   rpc_params_switch_0_aenergy_by_minute_1 0.000
     2021-11-19 17:53:10   rpc_params_switch_0_aenergy_by_minute_2 0.000
     2021-11-19 17:53:10   rpc_params_switch_0_aenergy_by_minute_3 0.000
     2021-11-19 17:53:10   rpc_params_switch_0_aenergy_minute_ts 1637340778
     2021-11-19 17:53:10   rpc_params_switch_0_aenergy_total 271.561
     2021-11-19 17:53:10   rpc_params_switch_0_id 0
     2021-11-19 17:50:16   rpc_params_switch_0_temperature_tC 52.00
     2021-11-19 17:50:16   rpc_params_switch_0_temperature_tF 125.60
     2021-11-19 17:50:16   rpc_params_switch_0_voltage 234.09
     2021-11-19 17:50:26   rpc_params_sys_available_updates_beta_version 0.9.0-beta2
     2021-11-19 17:53:10   rpc_params_ts   1637340780.19
     2021-11-19 17:50:16   rpc_params_wifi_rssi -47
     2021-11-19 17:50:16   rpc_params_wifi_ssid Finger von die Box
     2021-11-19 17:50:16   rpc_params_wifi_sta_ip 192.168.187.246
     2021-11-19 17:50:16   rpc_params_wifi_status got ip
     2021-11-19 17:53:10   rpc_src         shellyplus1pm-a8032abe179c
     2021-11-19 17:52:59   switch_0_aenergy_by_minute_1 0.000
     2021-11-19 17:52:59   switch_0_aenergy_by_minute_2 0.000
     2021-11-19 17:52:59   switch_0_aenergy_by_minute_3 0.000
     2021-11-19 17:52:59   switch_0_aenergy_minute_ts 1637340778
     2021-11-19 17:52:59   switch_0_aenergy_total 271.561
     2021-11-19 17:52:59   switch_0_apower 0.000
     2021-11-19 17:52:59   switch_0_id     0
     2021-11-19 17:52:59   switch_0_output true
     2021-11-19 17:52:59   switch_0_source init
     2021-11-19 17:52:59   switch_0_temperature_tC 52.1
     2021-11-19 17:52:59   switch_0_temperature_tF 125.8
     2021-11-19 17:52:59   switch_0_voltage 233.790
     2021-11-19 17:50:26   sys_available_updates_beta_version 0.9.0-beta2
     2021-11-19 17:50:26   sys_fs_free     258781
     2021-11-19 17:50:26   sys_fs_size     414401
     2021-11-19 17:50:26   sys_mac         A8032ABE179C
     2021-11-19 17:50:26   sys_ram_free    181036
     2021-11-19 17:50:26   sys_ram_size    250040
     2021-11-19 17:50:26   sys_restart_required false
     2021-11-19 17:50:26   sys_time        17:50
     2021-11-19 17:50:26   sys_unixtime    1637340626
     2021-11-19 17:50:26   sys_uptime      15
Attributes:
   alias      Trockner
   readingList shellyplus1pm_a8032abe179c:shellyplus1pm-a8032abe179c/online:.* online
shellyplus1pm_a8032abe179c:shellyplus1pm-a8032abe179c/status/mqtt:.* { json2nameValue($EVENT, 'mqtt_', $JSONMAP) }
shellyplus1pm_a8032abe179c:shellyplus1pm-a8032abe179c/events/rpc:.* { json2nameValue($EVENT, 'rpc_', $JSONMAP) }
shellyplus1pm_a8032abe179c:shellyplus1pm-a8032abe179c/status/sys:.* { json2nameValue($EVENT, 'sys_', $JSONMAP) }
shellyplus1pm_a8032abe179c:shellyplus1pm-a8032abe179c/status/switch_0:.* { json2nameValue($EVENT, 'switch_0_', $JSONMAP) }
   room       MQTT2_DEVICE


Bisher habe ich diese SetList ausprobiert :

on shellies/shellyplus1pm_a8032abe179c/relay/0/command on
off shellies/shellyplus1pm_a8032abe179c/relay/0/command off


auch ein

off shellies/shellyplus1pm_a8032abe179c/rpc {"method":"Switch.Set","params":{"id":0,"on":false}}


hat nicht funktioniert.

Gruß
Roman

EDIT: Falscher Type im Betreff, geändert

Otto123

Hallo Roman,

schon ein Template probiert?

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

romakrau

Hallo Otto,
ja das Shelly1 Template. Es listet mir auch die angezeigten Readings auf. Leider enthält es keine setList's.
Gruß
Roman

Otto123

Das glaube ich nicht, bei mir ist es komplett. Ich sehe bei Dir auch kein Reading attrTemplateVersion  ::)
ist dein attrTemplate aktuell?
{ Svn_GetFile("FHEM/lib/AttrTemplate/mqtt2.template", "FHEM/lib/AttrTemplate/mqtt2.template", sub(){ AttrTemplate_Initialize() }) }
Das steht bei mir im template im setList:
attr DEVICE setList\
  off:noArg shellies/DEVNAME/relay/0/command off\
  on:noArg shellies/DEVNAME/relay/0/command on\
  x_update:noArg shellies/DEVNAME/command update_fw\
  x_mqttcom shellies/DEVNAME/command $EVTPART1
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

romakrau

Hallo Otto,
das scheint es zu sein. Das MQTT-Template ist nicht aktuell. Wie werden denn die Templates aktualisiert. Update all mit nachfolgendem shutdown restart hatte ich gemacht.
Gruß
Roman

Otto123

Zitat von: romakrau am 19 November 2021, 21:38:47
Wie werden denn die Templates aktualisiert.
Hab ich doch geschrieben!? Die erste Codezeile im Post in die FHEM Kommandozeile werfen und ausführen
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

romakrau

Hatte ich durchgeführt aber keine Änderung in der Template Auswahl.
2021.11.19 21:57:12 1: SVN download of FHEM/lib/AttrTemplate/mqtt2.template to FHEM/lib/AttrTemplate/mqtt2.template finished
2021.11.19 21:57:12 2: AttrTemplates: got 232 entries

TomLee

Hast du irgendwie was am Topic-Pfad in den Einstellungen des Shelly geändert ?

Das Template erwartet in ReadingList shellies am Anfang des Topic-Pfad, das bei dir irgendwie nicht der Fall .

Also bspw. so:

shellyplus1pm_a8032abe179c:shellies/shellyplus1pm-a8032abe179c/status/mqtt:.*

und nicht so:

shellyplus1pm_a8032abe179c:shellyplus1pm-a8032abe179c/status/mqtt:.*

Otto123

Es geht vielleicht auch nicht um die Auswahl, Du hast gesagt Du hast shelly1 angewendet - aber aus deinem List geht das nicht hervor - was ist wenn Du das Template shelly1 nochmal anwendest?
Wenn Du shelly1 auswählst bekommst Du den Inhalt des Templates angezeigt, da solltest Du sehen, was das Template macht.
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

romakrau

Tut mir leid, aus irgendeinem Grund werden bei mir nicht die Shelly Templates angezeigt (A_10...,A_11...).
Ich sehe nur das shelly1 template. Dieses generiert gelegentlich ein von dir beschriebenes setlist (shellies...).

TomLee

Schonmal ohne shellies versucht ?

on shellyplus1pm_a8032abe179c/relay/0/command on
off shellyplus1pm_a8032abe179c/relay/0/command off

romakrau

Hallo Tom,
alle Varianten schon versucht. Danke

romakrau

Ich denke das Kernproblem ist das fhem mir nicht die Shelly Templates anbietet. Irgendetwas ist da faul.

TomLee

Nochmal, weil das shellies am Anfang des Topic fehlt:

filter:TYPE=MQTT2_DEVICE:FILTER=readingList=.*shellies.*

aber selbst wenn sie zur Auswahl hast passt doch nach dem anwenden der Topicpfad nicht, das Template erstellt mit shellies und deine ReadingList oben sagt ohne muss es sein.


romakrau

Hi Tom,
hatte ich im ersten Beitrag geschrieben das ich es schon ausprobiert hatte.
Danke