Add-on specific html pages to configure things default settings

Is there is any way to give adapter specific configuration screen to configure things.

For example, esp-01 supports 2 gpio pins, If i want to define a behaviour (whether the pin is used for input/output) of each gpios during configuration (after discovery) i need some screen so is there a any way to show custom dialog boxes immediately after discovering things.

We can add configuration page for add-on using JSON schema.

Please add schema field to package.json.

Example.

  "moziot": {
    "api": {
      "min": 2,
      "max": 2
    },
    "enabled": true,
    "schema": {
      "type": "object",
      "properties": {
        "gpio1": {
          "type": "string"
          },
          "gpio2": {
          "type": "string"
          },
        }
      }
    }
1 Like

Thanks Sogaani. I am trying something like below in adapter.

Things configuration includes two steps

Step 1. Setting up Wifi configuration (This step is kind of provisioning things - similar to blynk app wifi setup)
Step 2. Discovery and add to Gateway (This is normal process similar to other adapers)

Step1 includes below items :

  1. ESP will expose Soft AP with default name and credential.
  2. From Gateway i should be able to scan the custom wifi end points and connect with default credential.
  3. After connecting i should be able to configure AP details so that ESP can now act as a client and connect to configured AP.
  4. After AP configuration it should show available pins to configure different options against pin similar to RPi Gpio configuration.
  5. Update the Name of the Thing like Room1, Room2.

Step2 includes below items :

  1. Scan for WIFI
  2. Add it as things in Gateway
  3. Control the things from Gateway.

This is my imaginary idea so just trying to figure out how to add all these configuration pages with new gateway adapter

I write how to provide configurable add-on.
Could you see here?
I think the section ,“Provide device specific information to user.”, supports your case.

1 Like

Thanks sogaani. Let me try.