I’m struggling with simple calculations (Math.floor, modulo or Math.round) inside the rules.

I want to switch on my light at certain times. To change the times I use a VariableInputDevice and two variables (one to store the time [e.g. ‘6’] and one “time-string” [e.g. ‘6:00’] which works fine. Every time the value of the InputDevice changes a rule gets executed: `$time_string_variable := "{inputDevice_variable}:00"`

.

Now I wanted to adjust the time in smaller steps (15 minutes) but I’m having serious problems to split 6.25 into 6 and .25. Maybe I fail to see the obvious solution.

I hope you have some ideas for me to try out

edit: marked code as code

]]>I’m struggling with simple calculations (Math.floor, modulo or Math.round) inside the rules.

I want to switch on my light at certain times. To change the times I use a VariableInputDevice and two variables (one to store the time [e.g. ‘6’] and one “time-string” [e.g. ‘6:00’] which works fine. Every time the value of the InputDevice changes a rule gets executed: `$time_string_variable := "{inputDevice_variable}:00"`

.

Now I wanted to adjust the time in smaller steps (15 minutes) but I’m having serious problems to split 6.25 into 6 and .25. Maybe I fail to see the obvious solution.

I hope you have some ideas for me to try out

edit: marked code as code

]]>timeFormat(6.25) evaluates to 06:15:00, simply perfect. The new rule is now: `$time_string_variable := timeFormat($inputDevice_variable)`

.

Even more nice would be, if the VariableInputDevice would be able to manipulate a variable type like time directly. Unfortunately, I have no idea how to work with git. CoffeeScript shouldnt be that hard to learn, but I’m more familiar with VB.NET or C++.

edit: code markup

]]>the time function for the variablesinput device has been shortly discussed some months ago but not yet implemented due to the update to v0.9 and the codework on this.

feel free to contribute in any direction

]]>Adding the time to the InputDevice shouldnt be a problem since the functions are already in the code and “just” need to be added to the device. Hope it works that easy ^^

Is it possible to install two versions/branches on the same RPi (listening to different ports)? Only one running of course. Just activating the develeopment branch when coding and having a stable version running the other times.

]]>