Set-Aufrufe mit Werten aus der SetList landen als Attribut im Device

Begonnen von ph0x, 08 März 2025, 20:07:26

Vorheriges Thema - Nächstes Thema

ph0x

Habe bei meinen Rollläden etwas seltsames beobachtet:

Die Rollläden werden mit Shellies gefahren, hier ein beispielhaftes Device:
defmod EG_tr_RL_01 MQTT2_DEVICE shellyswitch25-8CAAB55DAC83
attr EG_tr_RL_01 userattr window_direction min_alt arming_relevant
attr EG_tr_RL_01 alias Flur 1 (links)
attr EG_tr_RL_01 arming_relevant false
attr EG_tr_RL_01 cmdIcon open:fts_shutter_up close:fts_shutter_down stop:fts_shutter_manual half:fts_shutter_50
attr EG_tr_RL_01 comment Shelly 2.5 in Roller-Mode. 100=opened / 0=closed
attr EG_tr_RL_01 devStateIcon .*/opens:fts_shutter_up@red .*/closes:fts_shutter_down@red true:15px-green false:15px-red 0/stop:fts_shutter_100 100/stop:fts_shutter_10 9\d/stop:fts_shutter_10 8\d/stop:fts_shutter_20 7\d/stop:fts_shutter_30 6\d/stop:fts_shutter_40 5\d/stop:fts_shutter_50 4\d/stop:fts_shutter_60 3\d/stop:fts_shutter_70 2\d/stop:fts_shutter_80 1\d/stop:fts_shutter_90 0\d/stop:fts_shutter_100 set_.*:fts_shutter_updown
attr EG_tr_RL_01 devicetopic shellyswitch25-8CAAB55DAC83
attr EG_tr_RL_01 event-on-change-reading .*
attr EG_tr_RL_01 eventMap open:opens close:closes
attr EG_tr_RL_01 group Rollläden
attr EG_tr_RL_01 min_alt 0
attr EG_tr_RL_01 model shelly25_roller_invert_0
attr EG_tr_RL_01 readingList shellies/$DEVICETOPIC/roller/0/pos:.* pct\
  shellies/$DEVICETOPIC/status/0/rollers:.* power\
  shellies/$DEVICETOPIC/online:.* online\
  shellies/$DEVICETOPIC/announce:.* { json2nameValue($EVENT) }\
  shellies/announce:.* { $EVENT =~ m,..id...$DEVICETOPIC...mac.*, ? json2nameValue($EVENT) : return }\
  shellies/$DEVICETOPIC/roller/0:.* current\
  shellies/$DEVICETOPIC/roller/0:open {{'state' => 'opening'}}\
  shellies/$DEVICETOPIC/roller/0:close {{'state' => 'closing'}}\
  shellies/$DEVICETOPIC/roller/0/pos:.* state\
  shellies/$DEVICETOPIC/input/1:.* input1\
  shellies/$DEVICETOPIC/input/0:.* input0\
  shellies/$DEVICETOPIC/relay/power:.* power\
  shellies/$DEVICETOPIC/relay/energy:.* energy\
  shellies/$DEVICETOPIC/temperature:.* temperature\
  shellies/$DEVICETOPIC/overtemperature:.* overtemperature\
  shellies/$DEVICETOPIC/roller/0/power:.* roller_0_power\
  shellies/$DEVICETOPIC/roller/0/energy:.* roller_0_energy\
  shellies/$DEVICETOPIC/temperature_f:.* temperature_f
attr EG_tr_RL_01 room Flur
attr EG_tr_RL_01 setList open:noArg shellies/$DEVICETOPIC/roller/0/command/pos 100\
  close:noArg shellies/$DEVICETOPIC/roller/0/command/pos 0\
  sommer:noArg shellies/$DEVICETOPIC/roller/0/command/pos 100\
  nacht:noArg shellies/$DEVICETOPIC/roller/0/command/pos 0\
  half:noArg shellies/$DEVICETOPIC/roller/0/command/pos 20\
  stop:noArg shellies/$DEVICETOPIC/roller/0/command stop\
  pct:slider,0,1,100 shellies/$DEVICETOPIC/roller/0/command/pos $EVTPART1\
  x_recalibration:noArg shellies/$DEVICETOPIC/roller/0/command rc\
  x_update:noArg shellies/$DEVICETOPIC/command update_fw\
  x_mqttcom shellies/$DEVICETOPIC/command $EVTPART1
attr EG_tr_RL_01 setStateList open close half stop pct
attr EG_tr_RL_01 stateFormat <a href="http://ip" target="_blank">\
online\
</a>\
state/current
attr EG_tr_RL_01 userReadings state_locked
attr EG_tr_RL_01 webCmd open:close:half:stop:pct
attr EG_tr_RL_01 window_direction 33
Dann habe ich mehrere Rollläden in Dummies für einzelne Räume, Stockwerke und das Haus zusammengefasst. Hier wieder ein Beispiel:
defmod EG_tr_DU_01 dummy
attr EG_tr_DU_01 alias Alle Rollläden im Flur
attr EG_tr_DU_01 cmdIcon open:fts_shutter_10 close:fts_shutter_100 sommer:weather_sun nacht:weather_night stop:fts_shutter_manual
attr EG_tr_DU_01 devStateIcon open:fts_shutter_10@gold close:fts_shutter_100@gold sommer:weather_sun@gold nacht:weather_night@gold stop:fts_shutter_manual@gold
attr EG_tr_DU_01 group Rollläden
attr EG_tr_DU_01 room Flur
attr EG_tr_DU_01 webCmd open:close:sommer:nacht:stop
attr EG_tr_DU_01 webCmdLabel Öffnen<br />:Schließen<br />:Sommer<br />:Nacht<br />:Stop<br />
Dazu gibt's dann noch ein Notify, das den Rollläden den gewünschten Wert übermittelt:
EG_tr_DU_01:.* {
 fhem("set EG_tr_RL_.* ".$EVTPART0);
}
So, wenn ich nun das Dummy auf nacht setze, stelle ich mir vor, dass der Wert nacht an die Shellies weitergereicht wird. Das funktioniert auch.

Jedoch taucht dann beim Shelly plötzlich ein Reading nacht und dem Wert set auf. Das ist mir sonst noch nirgendwo untergekommen.

Jemand eine Erklärung dafür?


Gruß Marco

TomLee

Hallo,

das liegt an dem gesetzten setStateList-Attribut:

Zitat von: commandrefsetStateList command command ...
This attribute is used to get more detailed feedback when switching devices. I.e. when the command on is contained in the list, state will be first set to set_on, and after the device reports execution, state will be set to on (probably with the help of stateFormat). Commands not in the list will set a reading named after the command, with the word set and the command parameters as its value.

If this attribute is not defined, then a set command will set the state reading to the name of the command.
If this attribute is set to ignore, then a set command will not affect any reading in the device.

Gruß Thomas

frober

Raspi 3b mit Raspbian Bullseye und relativ aktuellem Fhem,  FS20, LGW, PCA301, Zigbee, MQTT, MySensors mit RS485(CAN-Receiver) und RFM69, etc.,
einiges umgesetzt, vieles in Planung, smile

********************************************
...man wächst mit der Herausforderung...

ph0x

Danke für die schnellen Antworten, werde mir beides ansehen!

Gruß Marco