Tracking Washer Cycle Times with Node-RED

I’ve been trying to figure out how to track the duration of my washing machine cycles using Node-RED. The goal is to measure how long each cycle takes from start to finish, specifically from when it switches to ‘Cleaning’ mode and then to ‘Wash Cycle Complete’. I had a working solution in YAML automation before, but after a recent update, it stopped functioning. Now I’m porting it over to Node-RED, but I’m not sure where to begin.

I found this semi-working YAML setup, but transitioning it to Node-RED has been tricky. I’m wondering if anyone has experience with similar automation setups or can provide some guidance on how to structure this in Node-RED. I’m particularly interested in how to calculate the time difference between two states and display it in minutes and seconds.

Any tips or suggestions would be greatly appreciated! I’m excited to get this working and would love to share my final setup once I figure it out. :blush: