I want to change the wait time for a DOIF during the weekend.
The following seems not be working:
(($we ? 18 : 16) * HOURSECONDS)
What is valid syntax to use?
I would try with:
{($we ? 18 : 16) * HOURSECONDS}
Makes sense. :-)
The example in the DOIF#wait command ref (http://fhem.lan/fhem/docs/commandref_DE.html#DOIF_wait) is kind of confusing, since no curly braces are used for Perl expressions.
attr my_doif wait 1:[mydummy:state]*3:rand(600)+100,Attr("mydevice","myattr","")
Maybe this could be clarified?
Zitat von: amenomade am 25 November 2019, 20:06:10
{($we ? 18 : 16) * HOURSECONDS}
Update: this does not work.
I suppose the code needs to put in a function because Perl expressions are not accepted in attr wait if I understand command ref correctly.
Zitat von: Nestor am 26 November 2019, 11:03:26
Update: this does not work.
I suppose the code needs to put in a function because Perl expressions are not accepted in attr wait if I understand command ref correctly.
I'm afraid you're right. That would have been my second proposition.
(($we ? 18 : 16) * HOURSECONDS)
Syntax is ok, but $we is unknown at wait
Would IsWe() work?