Set Astro binding offset via rule

Id like to be able to set the Astro offset for the range channel via a rule. I believe this can be done via the REST API but I have no clue how to navigate the objects or specifically hoiw to do this.

The thing I want is

{
        "linkedItems": [],
        "uid": "astro:sun:astrooffest:rise#event",
        "id": "rise#event",
        "channelTypeUID": "astro:rangeEvent",
        "kind": "TRIGGER",
        "label": "Range Event",
        "description": "Range event",
        "defaultTags": [],
        "properties": {},
        "configuration": {
          "offset": 30
        }
      }

and I want to change the offset value to something in a rule.

Anyone able to help?

Indeed this should be doable through the REST API. But only if you created this Thing through the REST API (e.g. using PaperUI). If you are using .things files this won’t work.

As for what REST API to call I can’t say. Experiment in the REST API docs until you find the end point that keys you do what you need. Then you will have a curl example you can use to build a sendHttp*Request (probably PUT). Then you will need to figure out how to construct the JSON steering you will need to pass in that command. This will probably be pretty straight forward string concatenation ("some string " + “some string”)

thanks for the reply @rlkoshak, I have played some more and found it is infact a channel config parameter I need to change, not the thing, which I cannot see how to do - desnt seem to be anything channel wise that has a put command

IMHO using the simple GET for things, all needed/existing properties of a all things AND their channels are shown. Although there is no preconfigured PUT for a channel config, you should be able to compose the needed string on your own. Look at the CURL command shown in your GET Things call.
I don’t have ASTRO installed ATM, so I can’t show an example.

I can see the value in the get for the ASTRO thing but i cant do much else

the thing REST http is:

http://192.168.1.25:8080/rest/things/astro%3Asun%3Aastrooffest

the Channel I want is

{
      "linkedItems": [],
      "uid": "astro:sun:astrooffest:rise#event",
      "id": "rise#event",
      "channelTypeUID": "astro:rangeEvent",
      "kind": "TRIGGER",
      "label": "Range Event",
      "description": "Range event",
      "defaultTags": [],
      "properties": {},
      "configuration": {
        "offset": 30
      }

the option I want is to change the offset

any attempt I use in other REST API interface area I get invalid character which I am guessing is the #, event translating this to its HTML safe code

Tried it myself, same disappointing result :thinking:

Hmmmm. There has to be a REST call to allow this or else PaperUI wouldn’t be able to do it either.

I looked in the JSONDB and it shows the “#”. But, looking at my Astro Thing in the JSAONDB I notice that the offset is on the #start, not on the #event. But the JSON looks surprisingly different in the JSONDB than it does with what you have posted.

There has to be a way to do this or else we couldn’t do this through the UIs. Unfortunately I can’t say what’s wrong.

Ignoring changing it via a rule, playing with the offset, you need to have it on the range channel (#event) as well as the #start channel you want to use for it to work.

OK thanks for investigating guys, I might have to go for some proxy items to get the non offset value and a timer to do the offset