29.12.2021, 16:19
Display time of object
|
29.12.2021, 16:35
This solution consists of two scripts:
1. Event script which saves the time when the load has been turned on 2. Scheduled script that calculates the run time every minute If you say that you get high CPU load then check that the second script is not a resident script with 0 sleep time. This is how the scheduled script should be configured:
i change my event based script (a little), i had the problem, when i again get a off on my event, i got my value twice or more 'Last Run: '..Last_Run..' on'..time
so on my visualization i saw 'Last Run: Last Run: Last Run: 00:06 on Thu, 30-12 on Thu, 30-12 on Thu, 30-12' Code: Laptop_Seat = event.getvalue() --'0 WCD Woonkamer - laptoplader Seat (tm)'
05.04.2022, 13:02
Modified script version that has total and current running time.
1. Add to Common functions: Code: function formattime(output, seconds) 2. Event script mapped to load on/off status: Code: value = event.getvalue() 3. Scheduled script that runs every minute (or a resident script with sleep time > 0 if finer time resolution is needed): Code: key_curr = 'ontime_curr' In both scripts key_curr, out_curr, key_total, out_total variables should be adjusted as needed. Make sure that these variables have the same values in both scripts. |
« Next Oldest | Next Newest »
|