This object is in archive! 
Help with rule: count how much time a device is ON during each day
Answered
Hello,
I would like to know how much time a certain device is ON during each day. Idea is at the end of the day a message is sent with this information.
My problem is that this device is switching ON and OFF several times during the day. So I need to do additions to a cumulative time variable for the periods it is ON and don't know how.
Any of you have done something similar?
I want to apply this for my heating boiler.
Thanks!!
No connection
Real-time notifications may not work
Quite interesting: I didn´t try it out because I don´t have the pro package and can´s send a variable via mail but I would try it this way: First rule to look every minute if the consumption is above idle and then increase a variable or virtual meter. The second to send a mail every 24h and reset the variable. That won´t work of course if the on-period of the device is only seconds.... but with a boiler I would give it a try.
Quite interesting: I didn´t try it out because I don´t have the pro package and can´s send a variable via mail but I would try it this way: First rule to look every minute if the consumption is above idle and then increase a variable or virtual meter. The second to send a mail every 24h and reset the variable. That won´t work of course if the on-period of the device is only seconds.... but with a boiler I would give it a try.
Indeed this is a good one, specially because there is no way using the puzzles to separate integers from decimals. However after thinking for a while I came up with this solution, I made a test, will let you know how it worked.
Indeed this is a good one, specially because there is no way using the puzzles to separate integers from decimals. However after thinking for a while I came up with this solution, I made a test, will let you know how it worked.
Wow! Thanks guys!
I love the simplicty of Klaus' solution. Do you know if having a rule executing every minute for this purspose, is the optimum from the performance point of view?
I was trying something similar to Alberto's. But I have an error and not able to find it... Anyhow, Alberto, you have to take in account what happens if device was switch ON one day and OFF next day to do properly the operations.
Regarding the virtual meters, I don't understand why you use them instead of variables. Could you explain Alberto? Thanks!
It's a pitty rules don't allow operations with time, don't you think? This feature should be developed in my opinion.
Wow! Thanks guys!
I love the simplicty of Klaus' solution. Do you know if having a rule executing every minute for this purspose, is the optimum from the performance point of view?
I was trying something similar to Alberto's. But I have an error and not able to find it... Anyhow, Alberto, you have to take in account what happens if device was switch ON one day and OFF next day to do properly the operations.
Regarding the virtual meters, I don't understand why you use them instead of variables. Could you explain Alberto? Thanks!
It's a pitty rules don't allow operations with time, don't you think? This feature should be developed in my opinion.
Pablo,
I also thought about doing it like Klaus, the only issue I see is the fact that if your controller reboots you will miss that time. Accuracy I think you will get very similar from both solutions, both resolutions are minutely. Klaus' solution doesn't care about which day you started and finished counting, that is a plus.
Yes indeed, that is a problem I was thinking about it but cannot find a way to solve it that I like, I will keep thinking about it.
Variables reside in the controller and their values get wipped out when you reboot or power off the controller, virtual devices are created in the controller but they are connected to Zipato Server, so, in the event of a reboot, Zipato controller will read values from the server, so technically you won't loose data (unless you experience an internet outage while storing data to virtual meters). If this is important to you I would use virtual meters instead of VAR1 and VAR2 that way if your controller reboots you still would get good calculations, I didn't do it because those are the only placeholders (value5 and value 16) available from the virtual meter I use for these purposes and didn't feel like creating another one.
Yes, I also agree, even though Zipato's rule creator is superior to competitor's there is still room for improvements, like time operations, a way to separate or make operations with integers, integer random numbers, etc. That's were some other controllers use Lua or some other languaje to acomplish those complicated tasks.
Pablo,
I also thought about doing it like Klaus, the only issue I see is the fact that if your controller reboots you will miss that time. Accuracy I think you will get very similar from both solutions, both resolutions are minutely. Klaus' solution doesn't care about which day you started and finished counting, that is a plus.
Yes indeed, that is a problem I was thinking about it but cannot find a way to solve it that I like, I will keep thinking about it.
Variables reside in the controller and their values get wipped out when you reboot or power off the controller, virtual devices are created in the controller but they are connected to Zipato Server, so, in the event of a reboot, Zipato controller will read values from the server, so technically you won't loose data (unless you experience an internet outage while storing data to virtual meters). If this is important to you I would use virtual meters instead of VAR1 and VAR2 that way if your controller reboots you still would get good calculations, I didn't do it because those are the only placeholders (value5 and value 16) available from the virtual meter I use for these purposes and didn't feel like creating another one.
Yes, I also agree, even though Zipato's rule creator is superior to competitor's there is still room for improvements, like time operations, a way to separate or make operations with integers, integer random numbers, etc. That's were some other controllers use Lua or some other languaje to acomplish those complicated tasks.
Alberto, I agree puzzles are great, but expert users should be able to use lua or equivalent.
Alberto, I agree puzzles are great, but expert users should be able to use lua or equivalent.
Thanks to Alberto for the tip with virtual meter, thats really a point as some users complain about many reboots. Perhaps one should really switch to virtual meters in most cases.
The real advantage of a variable is that it is resetted to zero after a reboot so you can use it to monitor reboots ;-)
Thanks to Alberto for the tip with virtual meter, thats really a point as some users complain about many reboots. Perhaps one should really switch to virtual meters in most cases.
The real advantage of a variable is that it is resetted to zero after a reboot so you can use it to monitor reboots ;-)
Replies have been locked on this page!