MultiLevelSensor

Quick Question:

How do I create a MultiLevelSensor without the level set tool (the device is read only).

For example, this is what I see in the gateway GUI:

Admittedly, it doesn’t hurt anything, just looks like I should be able to change the temperature/humidity with a slider :wink:

This is my Thing JSON, currently:

{
  "@context": "https://iot.mozilla.org/schemas/",
  "@type": ["MultiLevelSensor"],
  "name": "Olimex ESP32 (w Temp Sensor)",
  "description": "POE Temperature / Humidity Sensor",
  "href": "/",
  "properties": {
    "temperature": {
      "@type": "LevelProperty",
      "label": "Temperature",
      "type": "number",
      "unit": "celsius",
      "href": "/properties/temp"
    },
    "humidity": {
      "@type": "LevelProperty",
      "label": "Humidity",
      "type": "number",
      "unit": "percent",
      "href": "/properties/humid"
   }
  }
}

Hoping you can tell me what I am doing wrong… Thank you!

While I am here, I thought I’d report a few other things I am seeing with 0.5.x. Aside from the first one, most are minor, but I thought I’d report them in case helpful:

  1. Most seriously, after I add a WebThing, it works great for several minutes. After a while, it stops showing updates in the GUI (even though the device continues to see the polls every 5 seconds or so). They just don’t get displayed. Rebooting the WebThing doesn’t fix it. Rebooting the gateway does.

  2. When I add a device, it sometimes shows 2 of them (I delete/add often as I am testing).

  3. When I delete a WebThing, it will still poll it every 5 seconds. If I add it again, it gets double the polls. Do it again, and it triples. This repeats until gateway reboot. This one has been there since at least 0.4.0.

  4. If I logout of the gateway, it doesn’t take me to a login screen. It acts as if nothing happened, but then things get strange (thing pages don’t work, etc.). Need to reboot the gateway.

  5. Sometimes for my MultiLevelSensor, in “unexpanded” mode, the circle shows humidity, other times temperature. I’d like to be able to control which is primary, if possible.

Thanks!

Mike

This looks like a UI bug may relate to:

I can try to update this PR and if you want to test…

@mikebb You haven’t done anything wrong. We’re waiting on the W3C to finalize a term (readOnly or writable). We have a couple open issues that will take care of this:

  1. Gateway
  2. Spec

As for your other issues:

  1. Like @rzr said, I think this relates to the issue he pointed to.
  2. This should have been taken care of by this PR. As noted in that issue, the delay for things to be removed can sometimes be long if it does not properly emit a service-down event.
  3. That may be related to either this or this.
  4. This is strange. Can you file an issue on the gateway with some exact step to reproduce if you continue seeing it?
  5. Same issue as #1.