Neuigkeiten:

Am Sonntag den 8.12.2024 kann es ab ca. 8:00 Uhr zu kurzzeitigen Einschränkungen / Ausfällen bei den Diensten des FHEM Vereines kommen.
Die Server müssen mal gewartet und dabei neu gestartet werden ;)

Hauptmenü

Assigning a value to a dummy device

Begonnen von mgmino, 19 Dezember 2023, 04:01:48

Vorheriges Thema - Nächstes Thema

mgmino

Why doesn't the following work as expected?
define count dummy
set count 1
set count {Value("count") +1}

The following works as expected but is less clear.
{ fhem "set count " .(Value("count") +1)}

Is there a better way to implement a counter?

binford6000

help set
has some examples for the set command like: {(perlExpression)} with the result of perlExpression. 
Please note the round brackets around the PERL-code:
set count {(Value("count") +1)}
Cheers,
Sebastian

mgmino

Thank you for the prompt reply -- it works great. I scanned the help three times before I saw the documentation -- need better glasses  8)