How to specify specific times in Rules?

is it possible to specify a specific time (like 10:00PM) or does everything need to reference a ‘reference time’ like midnight, sunrise, etc. all the examples i see on the Sample-Rules all use reference times

Sample-RulesAPI

 {
                        "between": {
                            "value": {
                                "time": {
                                    "reference": "Now"
                                }
                            },
                            "start": {
                                "time": {
                                    "daysOfWeek": [
                                        "Mon",
                                        "Tue",
                                        "Wed",
                                        "Thu",
                                        "Fri"
                                    ],
                                    "reference": "**Midnight**",
                                    "offset": {
                                        "value": {
                                            "integer": -360
                                        },
                                        "unit": "Minute"
                                    }
                                }
                            },
                            "end": {
                                "time": {
                                    "daysOfWeek": [
                                        "Mon",
                                        "Tue",
                                        "Wed",
                                        "Thu",
                                        "Fri"
                                    ],
                                    "reference": "**Midnight**",
                                    "offset": {
                                        "value": {
                                            "integer": -180
                                        },
                                        "unit": "Minute"
                                    }
                                }
                            }
                        }
                    }

Please put topics about the rules API in the rules API section of the forum. I have moved this one for you.

1 Like

thank you @JDRoberts

1 Like

Hi, @AZSteve!
No, we cannot set a specific time, we need to set the time using the references available and the offset.

And the reference times are

  • sunrise
  • sunset
  • midnight
  • noon

Is that correct?

They start with capital letters as shown in the API reference (here):

And, you missed one:

  • Now
  • Midnight
  • Sunrise
  • Noon
  • Sunset

Thank you @nayelyz , you’ve been most helpful, as always.

maybe its me (it probably is) but i cannot find the instance of the reference you copied… i see the samples for Rules, List, Create, Get; but no parameter definitions or references… am i missing something? i hate asking such basic questions and i generally try to take a brute force, try-it-and-fail approach to things, its how i learn better (hopefully i don’t ever brick my hub :face_with_spiral_eyes:)

Don’t worry, @AZSteve, it’s ok.

In the API reference, whenever you see the symbol > next to a text in the diagram of “REQUEST BODY”, it means you can expand its content to get more details about it.

For example, here, the property “name” doesn’t have more elements under it, but “actions” does:
image

If you click on the text or the symbol, it will expand.

1 Like

ahhh… the devil is in the details :)… i didn’t notice the >

thanks again.

1 Like