Slider Widget: not the expected behaviour on Input PSON

Hi I have defined an input resource like that:

  thing["tristates"] << [](pson& in) {
    Tasmo1.Relay1Out = in["Relay1.1Out"];
    Tasmo1.Relay2Out = in["Relay1.2Out"];  
    Tasmo1.Relay3Out = in["Relay1.3Out"];
    Tasmo1.Relay4Out = in["Relay1.4Out"];
    Tasmo2.Relay1Out = in["Relay2.1Out"];
    Tasmo2.Relay2Out = in["Relay2.2Out"];  
    Tasmo2.Relay3Out = in["Relay2.3Out"];
    Tasmo2.Relay4Out = in["Relay2.4Out"];
    Tasmo2.Relay1Out = in["Relay3.1Out"];
    Tasmo3.Relay2Out = in["Relay3.2Out"];  
    Tasmo3.Relay3Out = in["Relay3.3Out"];
    Tasmo3.Relay4Out = in["Relay3.4Out"];
    Tasmo4.Relay1Out = in["Relay4.1Out"];
    Tasmo4.Relay2Out = in["Relay4.2Out"]; 
    Tasmo4.Relay3Out = in["Relay4.3Out"];
    Tasmo4.Relay4Out = in["Relay4.4Out"];
  };

(All values are bytes)
I wanted to define sliders to chose between 0 = off, 1 = auto, 2 =on.
Lacking radio buttons in thinger.io :frowning_face:
But upon defining the slider, I got:
image
and no way to get to the individual values.
:frowning_face:
Has anyone got an idea how to come to the values level?

Finally I got a working, but it is quite an awful solution:
Inputs do not seem to be definable as multiple resources.
You must define one resource per switch. :frowning_face:
…and be tricky if you need to define a tri-state switch.
Create a slider from 0 to 2 in steps by one.
Define a description OFF___________Auto___________ON
that is as large as your field.
image

The code behind **each** switch is:
      thing["tris1.1"]  = [](pson & in, pson & out)
    {
      if (in.is_empty())
      {
        in = Tasmo1.Relay1Out;
      } else {
        Tasmo1.Relay1Out = in;
      }
      out = Tasmo1.Relay1Out;
    };

changing the values for the resource and the byte variable.
And -of course- write the logic to override the automatic value, if the tri-state switch is on 0 or 2.
Quite a lot of work for a simple switch…

I believe that the Form Property resource available only for PRODUCTS would help in this case.
I have been studying this same issue.

Define operating states for the device Manual, Automatic… And relay states (off/on).
Apparently, the way is to develop a form linked to a device/Product property. I have already achieved this successfully. It remains to test the consistency of this approach with the command to turn the relays on and off via the device API in a consistent and reliable way.

Products are not included in maker accounts.
So I had to use the slider to define my tri-states as bytes.

But it works reasonably well:
I used bytes instead of booleans.
0= force to off
1= leave as is
2= force to on

And the feed back is
0= off
2= on
(1=error)

  byte Relay1fb;       // Feed-Back
  byte Relay1cmd = 1;  // 0 = 0ff 1 = Auto 2 = On
in setup()
  thing["tris1.1"] = [](pson& in, pson& out) {
    if (in.is_empty()) {
      in = Tasmo1.Relay1cmd;
    } else {
      Tasmo1.Relay1cmd = in;
    }
    out = Tasmo1.Relay1cmd;
  };

in loop()
void processDigitalOutputs() {
  if (Tasmo1.Relay1cmd == 0) {
    mqtt.publish("cmnd/thinger1/Power", "OFF");
  }
  if (Tasmo1.Relay1cmd == 2) {
    mqtt.publish("cmnd/thinger1/Power", "ON");
  }

You may of course replace the “mqtt.publish…” lines with every other way to control the relays.
For me it was important to be able to get the tri-state function, since the controlled devices have a built-in schedule function which I want to keep or override on user choice.

I actually need two (or three) widgets for each relay.
The first one is the feed-back
The second one is the control mode
The optional third one is just a passive text, with a link to the schedule control page as overlay:
image