Operating time node issue

Hi I am having an issue with this current flow. I am using the flow from this website https://github.com/cflurin/node-red-contrib-dsm/wiki/Operating-time.

As you can see in the image above, The first image shows when I inject "off", the operating time and payload is still the same. But after that when I inject "reset", the operating time and payload becomes different.

Is there a way to continuously update the payload even if I inject the "off" or "reset". Cos I need the payload to continuously be updated to calculate my live OEE. (Cos I wanna calculate machine running %).

Machine Running % = (Machine running Time/ Total Working time) * 100

Hi, Sure you can do it. Please, read the doc and try to modify the configuration.

In the method reset you have to set msg.payload and output = true

hi thanks for creating it in github. i need to use the operating time function in my project but cant understand the code. sorry i an not that expert in programming. Any links or explanation on how to use the function?

Thanks in advance.

There is no magic in the dms, it's just javascript and some basics about state machine.
I'd start learning javascript:

https://developer.mozilla.org/en-US/docs/Web/JavaScript

https://www.w3schools.com/js/default.asp

Hello,

My counter starts with the button.
I want to start by adding extra time depending on the variable at each start.

Sample:

extra_time=variable

button is pressed
00:00:00+extra_time