I have been trying to convert the time remaining using the .msg.duration in Big Timer so I can display the hours and minutes in HA. Disclaimer. I am not a programmer, so I am behind the 8 ball. I have watched numerous videos and hours of researching, but to no avail. What I want is what is displayed under BigTimer. It will display “On for 8 hours 10 minutes”.
I know this is not a game changer but I would like to have it display so it looks nice in HA.
Actually, I would like to eventually use a switch node (monitoring the duration) to format the text so if duration is < 1minute, display"minute" but if it is > 1, display “Hours” and “Minutes”.
Below is a couple of screenshots of the AC control for my shop Mini Split AC. The bottom line is the BigTimer Control.
All advice and suggestions appreciated.
Thank you, sir for the quick reply. I copied your code into the function node, and this is what I get. “On for 1 minute”. Actually, Big Timer is on for another 37 minutes, and the resulting msg. isn’t changing.
Have you tried using a status node? You can connect it to the Big Timer node, and then every time the big timer’s status changes, you can get it and do something with the status. An example of how to do this is here.