openhab-core icon indicating copy to clipboard operation
openhab-core copied to clipboard

[rest] Allow invoking ThingActions via API

Open J-N-K opened this issue 3 years ago • 3 comments
trafficstars

Closes #926

May I ask for guidance for the correct endpoint? Originally I thought that /things/{thingUid}/action would be a good idea but it turned out that having two classes providing endpoints under /things results in strange effects (like 404s even if the bundle is loaded). It is not possible to integrate this resource in the resource that provides /things without adding a dependency to the automation bundle.

J-N-K avatar Feb 28 '22 15:02 J-N-K

Test fails unrelated.

J-N-K avatar Feb 28 '22 18:02 J-N-K

May I ask for guidance for the correct endpoint?

I see your issue with the /things endpoint and don't have a solution for it. If I see it correctly, you've now chosen a /actions/<thingUID>/<actionUID> path. I'd say that is a sensible choice, given the situation.

kaikreuzer avatar May 25 '22 19:05 kaikreuzer

May I ask for guidance for the correct endpoint?

I see your issue with the /things endpoint and don't have a solution for it. If I see it correctly, you've now chosen a /actions/<thingUID>/<actionUID> path. I'd say that is a sensible choice, given the situation.

kaikreuzer avatar May 25 '22 19:05 kaikreuzer

@kaikreuzer - browsing through some old PR's I found this one. 🙂 With your latest comment, does it mean this PR is actually in a condition where it could be reviewed and potentially merged?

jlaur avatar Jan 01 '23 12:01 jlaur

Thanks for the ping @jlaur, seems this got lost from my radar.

kaikreuzer avatar Jan 01 '23 20:01 kaikreuzer

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/openhab-4-0-wishlist/142388/292

openhab-bot avatar Jan 20 '23 12:01 openhab-bot

I am currently looking at the actions of a DMX bridge. What does the tag and reference do?

[
  {
    "actionUid": "dmx.sendFade",
    "label": "immediately fade channels",
    "description": "Immediately performs fade on selected DMX channels.",
    "inputs": [
      {
        "name": "channels",
        "type": "java.lang.String",
        "label": "",
        "description": "",
        "required": false,
        "tags": [],
        "reference": "",
        "defaultValue": ""
      },
      {
        "name": "fade",
        "type": "java.lang.String",
        "label": "",
        "description": "",
        "required": false,
        "tags": [],
        "reference": "",
        "defaultValue": ""
      },
      {
        "name": "resumeAfter",
        "type": "java.lang.Boolean",
        "label": "",
        "description": "",
        "required": false,
        "tags": [],
        "reference": "",
        "defaultValue": ""
      }
    ],
    "outputs": []
  }
]

spacemanspiff2007 avatar Apr 17 '23 07:04 spacemanspiff2007

This pull request has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/philips-hue-clip-2-api-v2-discussion-thread/142111/121

openhab-bot avatar Apr 23 '23 12:04 openhab-bot

@J-N-K : Since you create the PR: What does the tag and reference do?

spacemanspiff2007 avatar May 02 '23 07:05 spacemanspiff2007

@J-N-K (or anyone else) What does the tag and reference do in the response?

      {
        "name": "resumeAfter",
        "type": "java.lang.Boolean",
        "label": "",
        "description": "",
        "required": false,
        "tags": [],
        "reference": "",
        "defaultValue": ""
      }

spacemanspiff2007 avatar Jun 13 '23 07:06 spacemanspiff2007

@spacemanspiff2007 I have no idea. TBH I don't even know how you an assign tags to actions. The "reference" seems to be related to the (up to now) not implemented chaining of modules for passing output to other modules or getting input from other modules.

J-N-K avatar Jun 13 '23 15:06 J-N-K

Thank you for your quick response. I'll ignore these fields for the HABApp users then.

spacemanspiff2007 avatar Jun 13 '23 16:06 spacemanspiff2007