List of switch IDs and sensor ID

40 views
Skip to first unread message

orct...@gmail.com

unread,
May 22, 2018, 9:51:43 PM5/22/18
to OpenRemote
Is there a files or table maintained in OpenRemote that lists all the switch Ids , sensor IDs , etc for quick look up? I am asking because I want to be able to use them with rest http commands and currently the way I am finding them is inconvenient by searching through the panel xml file.

Richard Turner

unread,
May 23, 2018, 5:11:03 AM5/23/18
to orct...@gmail.com, OpenRemote
You could skip the panel.xml and use the named command REST API (allows you to use the name of the commands as defined in the designer) to call commands rather than messing with volatile IDs.

On 23 May 2018 at 02:51, <orct...@gmail.com> wrote:
Is there a files or table maintained in OpenRemote that lists all the switch Ids , sensor IDs , etc for quick look up? I am asking because I want to be able to use them with rest http commands and currently the way I am finding them is inconvenient by searching through the panel xml file.

--
You received this message because you are subscribed to the Google Groups "OpenRemote" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openremotecommunity+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/openremotecommunity.
To view this discussion on the web visit https://groups.google.com/d/msgid/openremotecommunity/7d305ea7-92ca-43b1-9dc9-c348f7719479%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

orct...@gmail.com

unread,
May 23, 2018, 6:41:28 AM5/23/18
to OpenRemote
Richard thanks! That would be nice
I am sure how to use the rest api for named commands


Currently as an example I use
http://192.168.1.30:8688/controller/rest/status/588158
http://192.168.1.30:8688/controller/rest/control/1087/off

What would be the url for the above with commands
Zooz dimmer a status
Zooz dimmed a off

Richard Turner

unread,
May 23, 2018, 11:46:34 AM5/23/18
to orct...@gmail.com, OpenRemote
It's been a while since I've looked at OR2 but the key file is:


So you will need to:

Make a HTTP Post request to: /rest/devices/{device_name}/commands?name={command_name}
Include a Content-Type header (either set to application/json or application/xml depending on how you want to format the body)

for application/json then the body of the request should be like:

{"parameter": "COMMAND_VALUE_HERE"}

for application/xml then the body of the request should be like:

<parameter>COMMAND_VALUE_HERE</parameter>

Use something like postman or DHC restlet plugin for Chrome to test this out. I'm only basing the above info on a quick read of the source code but hopefully it gets you what you want.



--
You received this message because you are subscribed to the Google Groups "OpenRemote" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openremotecommunity+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/openremotecommunity.

orct...@gmail.com

unread,
May 24, 2018, 12:41:15 PM5/24/18
to OpenRemote
Thanks for the info. However I am not have much luck with this

I tried the following:
http://192.168.1.30:8688/controller/rest/devices/Zooz%20dimmer%20zen22/commands?name=zooz%20dimmer%20a%20status

It comes back with a blank screen on the browser

Any suggestions?

orct...@gmail.com

unread,
May 24, 2018, 12:52:40 PM5/24/18
to OpenRemote
Quick update

Looks like the following are working but I just don’t get any ack back whether it was successfully executed or not. Also with the status command there is no value that is returned - just a blank page. Any suggestions on how to get the status ?

http://192.168.1.30:8688/controller/rest/devices/Zooz%20dimmer%20zen22/commands?name=zooz%20dimmer%20a%20off

http://192.168.1.30:8688/controller/rest/devices/Zooz%20dimmer%20zen22/commands?name=zooz%20dimmer%20a%20on

Richard Turner

unread,
May 27, 2018, 2:59:25 AM5/27/18
to OpenRemote
The acknowledgement is the fact that the HTTP request returns a 200 response. For sensors you need to use:

// [HTTP GET] /rest/devices/{device_name}/status?name={sensor_name}&name={sensor_name}

Add the following header for JSON response:

Accept: application/json

orct...@gmail.com

unread,
May 28, 2018, 10:38:54 AM5/28/18
to OpenRemote
Reply all
Reply to author
Forward
0 new messages