Dummy Device - update STATE

Begonnen von mgmino, 07 März 2023, 03:46:06

Vorheriges Thema - Nächstes Thema


I have defined a dummy device to represent the status of a MQTT device as follows:

define garEntryDoor dummy
attr garEntryDoor stateFormat [mqttDev:mfd-gar-entryDor]

which sets the state properly but does not update

I tried the following suggested by the documentation:

attr garEntryDoor stateFormat {[mqttDev:mfd-gar-entryDor]}

but received this error message:

Zitatsyntax error at (eval 1185876) line 1, near "mqttDev:"

How do I get the STATE to update automatically?


There is no "update connection" between the dummy and the mqtt Device.
One tricky solution could be :
attr mqttDev userReadings dummy:mfd-gar-entryDor.* {fhem("set garEntryDoor [$name:mfd-gar-entryDor]")}
and simple delete your stateFormat in Dummy
Viele Grüße aus Leipzig
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz


Other option: use a readingsProxy device instead of dummy.

This might also help to configure a "one button" garage door opener, see e.g. https://forum.fhem.de/index.php/topic,124240.msg1190483.html#msg1190483 or https://forum.fhem.de/index.php/topic,127542.0.html.
Server: HP-T620@Debian 11, 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


Beta-User: The readingsProxy device is the correct solution to my application; thank you

Otto123: Thank you for your solution although the readingsProxy device seems like a better match than a dummy device