FHEM Forum

FHEM => English Corner => Thema gestartet von: mgmino am 07 März 2023, 03:46:06

Titel: Dummy Device - update STATE
Beitrag von: mgmino am 07 März 2023, 03:46:06
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?
Titel: Antw:Dummy Device - update STATE
Beitrag von: Otto123 am 07 März 2023, 10:15:56
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
Titel: Antw:Dummy Device - update STATE
Beitrag von: Beta-User am 07 März 2023, 11:03:35
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.
Titel: Antw:Dummy Device - update STATE
Beitrag von: mgmino am 07 März 2023, 22:27:04
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