What Capability do I need to access/update the variable Device.RemainingTime and what type is it?

Hi,

I am currently in the process of adding my Washer and Dryer using the provided Washer and Dryer tile & details templates. All the templates have a binding to “{Binding @Device.RemainingTime}” as one of the key variables that is displayed, but I cannot find the RemainingTime variable listed in any capability. I have tried setting the variable in each device based on it being a date with the remaining hours and minutes, but any attempt to read the variable back reports it is still set to null.

Is there an additional undocumented capability I need to add to my devices to get this to work, or is it something which is still to be implemented in a capability?

Thanks!

RemainingTime is derived from the CompletionTime attribute of the following capabilities:

  • DishwasherOperatingState
  • DryerOperatingState
  • OvenOperatingState
  • WasherOperatingState

Hi,

Thanks - that makes sense now. I’m still not able to get the Remaining Time to show using the default template. This test code I’ve written to try to force it to come up is below. The completion time updates correctly (updating to show the time 1 hour from the time the poll function is called), but the RemainingTime entry remains blank.

Can you see where I am going wrong?

function onPoll() {
	DeviceRefs.forEach(function(deviceref) {
		var device = plugin.Devices[deviceref];

		device.MachineState = "Run";
		if (device.DeviceType == "Washer") {
		    device.WasherJobState = "Rinse";
		}

		const event = new Date(Date.now());
		var hours = event.getHours();
		hours = hours + 1;
		event.setHours(hours);
		device.CompletionTime = event;
});
}

I found the issue. This will be fixed in the next release 4.1.5

Great - thanks very much!

Could I also ask what the intended purpose / use of the SupportedMachineStates array variable is? The Templates appear to just display it as a string on the Details template page, but is it intended that it just lists which of the pre-defined MachineStates that the Device supports, or is it intended for some other use such as additional possible MachineStates?

Thanks again!

The capability was modeled after SmartThings washerOperatingState. It was more or less just a copy & paste from that.

Got it - thanks very much for your help!