I have a simple rule:
WHEN something THEN log "Woonamer opgewarmd van $OldTemp naar $WoonkamerTemperatuur in $pellet-timer.time"
How can I change this in something like:
WHEN something THEN log "Woonamer opgewarmd van $OldTemp naar $WoonkamerTemperatuur in ($pellet-timer.time / 60) "
-
Doing math with a variable when writing to log?
Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm
-
If this does not work, i wouldt make a variable that contains
$pellet-timer.time / 60
-
You can make a variabel where you put the result of $pellet-timer.time / 60. Like $pellet-timer-calc = ($pellet-timer.time / 60) and then use the $pellet-timer-calc variable in the rule instead.
Ups… already mentioned by Michael…
-
Of course, that’s a workaround. But based on the reactions it looks like it’s not possible?
Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm
-
Seems that is the only way. Tried some variants in this moment but nothing worked…
-
@koffienl said in Doing math with a variable when writing to log?:
How can I change this in something like:
WHEN something THEN log "Woonamer opgewarmd van $OldTemp naar $WoonkamerTemperatuur in ($pellet-timer.time / 60) "Did you try the following?
WHEN something THEN log "Woonamer opgewarmd van $OldTemp naar $WoonkamerTemperatuur in {$pellet-timer.time / 60}"
Works for me, at least. See also docs on string expressions - https://pimatic.teamemo.com/Usage/Functions-for-Variables-and-Rules
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
-
@mwittig said in Doing math with a variable when writing to log?:
@koffienl said in Doing math with a variable when writing to log?:
How can I change this in something like:
WHEN something THEN log "Woonamer opgewarmd van $OldTemp naar $WoonkamerTemperatuur in ($pellet-timer.time / 60) "Did you try the following?
WHEN something THEN log "Woonamer opgewarmd van $OldTemp naar $WoonkamerTemperatuur in {$pellet-timer.time / 60}"
Works for me, at least. See also docs on string expressions - https://pimatic.teamemo.com/Usage/Functions-for-Variables-and-Rules
Thanks!
I tried () and [] but never thought of {}Like my projects and help? Consider donating electroneum etnjwAKGPqF6omQWRmpp9u2BPyVDG9VuyRQjNJ1S8yfBdfR9qeUQ46kRy8KS2CNqbpNLRrsgmNW6F2TMzxmZgPrh6KctrkrYbm