Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-17078

[fiware-stackoverflow] Fiware Actuator/Sensor On Off pattern with status

    Details

      Description

      Created question in FIWARE Q/A platform on 05-11-2020 at 00:11
      Please, ANSWER this question AT https://stackoverflow.com/questions/64689177/fiware-actuator-sensor-on-off-pattern-with-status

      Question:
      Fiware Actuator/Sensor On Off pattern with status

      Description:
      My configuration includes orion, IoT Agent JSON, and mongoDB.
      I want to build a Fiware Lamp actuator and I want to have is on/off status (as sensor) as well.
      At the moment I use a PATCH request with body (form ORION) :
      At First with on command:
      {
      "on":

      { "type" : "command", "value" : "" }

      }

      And then with off command:
      {
      "off":

      { "type" : "command", "value" : "" }

      }

      When I receive anything from the above, I respond from the dummy device with 200 OK.
      The above in my configuration makes both the on and off tags as pending:
      {
      "id": "urn:ngsi-ld:Lamp:001",
      "type": "Lamp",
      "TimeInstant": "2020-11-04T22:42:37.00Z",
      "category": [
      "actuator",
      "sensor"
      ],
      "controlledProperty": "lamp",
      "function": [
      "onOff",
      "sensing"
      ],
      "off_info": " ",
      "off_status": "PENDING",
      "on_info": " ",
      "on_status": "PENDING",
      "refStore": "urn:ngsi-ld:Store:001",
      "state": " ",
      "supportedProtocol": [
      "JSON"
      ],
      "supportedUnits": "My Unit 2",
      "on": "",
      "off": ""
      }

      I guess that I miss something in the way, so is there any response that I have to sent back to IoT Agent json to to make one of the two tags to stop be pending? Must I Update State or Info along the way?
      P.S I expected to have a reply like this:
      {
      "id": "urn:ngsi-ld:Lamp:001",
      "type": "Lamp",
      "TimeInstant": "2020-11-04T22:42:37.00Z",
      "category": [
      "actuator",
      "sensor"
      ],
      "controlledProperty": "lamp",
      "function": [
      "onOff",
      "sensing"
      ],
      "off_info": " ",
      "off_status": "PENDING",
      "on_info": " ",
      "on_status": "OFF",
      "refStore": "urn:ngsi-ld:Store:001",
      "state": " ",
      "supportedProtocol": [
      "JSON"
      ],
      "supportedUnits": "My Unit 2",
      "on": "",
      "off": ""
      }

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2020-11-11 12:51|CREATED monitor | # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2020-11-11 12:51|CREATED monitor | # answers= 1, accepted answer= True

          People

          • Assignee:
            jason.fox Jason Fox
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: