Page 1 of 1

Custom device UI

PostPosted: Mon Jul 19, 2021 10:16 am
by berkinet
Been a while... finally getting an old project off the shelf.

I am looking to support a digital output device that comes in two flavors:
  1. 0 or 5v, 100% duty cycle (old version)
  2. 0 or 5v, variable duty cycle (new version)
Implementing the device as a dimmer would provide a device UI slider control that can be used to control the duty cycle. This functionality would be meaningless on the device with no duty cycle control - though it wouldn't hurt anything. I would rather not have to create a separate device for each version. So, is there any way to hide the dimmer slider, or otherwise build a custom device UI?

Thanks

Re: Custom device UI

PostPosted: Mon Jul 19, 2021 12:38 pm
by FlyingDiver
Nope, no custom device UI available. So if you don't want to show the dimmer control for both versions, you'll need two device types.

Re: Custom device UI

PostPosted: Mon Jul 19, 2021 2:47 pm
by berkinet
Figured. Thanks for the response.

Re: Custom device UI

PostPosted: Mon Jul 19, 2021 5:52 pm
by DaveL17
Just throwing this out there in case it's an option for your project. With Indigo 2021.1, it's possible to build controls into web content using the Web Server API and pass the controls' value back to Indigo. Then you could use something like:

Code: Select all
<div class="slidecontainer">
  <input type="range" min="1" max="100" value="50" class="slider" id="myRange">
</div>
You could load the custom controls from a device UI.

Re: Custom device UI

PostPosted: Tue Jul 20, 2021 3:19 am
by berkinet
html is interesting. But, in this case, I'd prefer to keep all the controls in the same interface.

However, a different, but related question. In the case of the physical device, the most common use will be as a binary on/off output controlling some external device. Even though duty-cycle control is available, it will only be rarely used, at least for now.

However, for a dimmer device the default displayStateId is brightnessLevel. So, I started to look at forcing that to something else, like onOffState, or just on or off. I can set uiValue to on or off and get the display state I want. But, then the min/max controls on the dimmer slider also display on and off instead of o and 100.

Is there a way to use an on/off value as the display state, and still keep the default slider display?

Re: Custom device UI

PostPosted: Wed Jul 21, 2021 9:21 am
by howartp
uiValue.ui ?

(Like if you’re storing temperature as integer but want it to display as °c?


Sent from my iPhone using Tapatalk Pro