From your documentation, it’s not clear to me which actions can fire events, i.e., on which conditions rules can be triggered. I see this documentation:
In the Rules API a trigger acts as a way to start the execution of a rule. When we create a rule with an EqualsCondition that uses a DeviceOperand the device being used will then act as a trigger for the rule.
So, this is clear. But what if I want to run something at a certain time. I can use an every action, which presumably causes a trigger at a specified (specific) time. But where is this documented? Is it equally possible to use an IfAction at a certain time? For example, this Rule below is supposed to trigger at 7:45 in the morning IF this is before sunrise (so, at 7:45 if it’s dark).
It’s not clear to me if this will cause a trigger, or if I have to rewrite it using every instead. I’d like some more explicit documentation on what exactly causes a trigger event, triggering a Rule, and what does not. At least I don’t see it here: API | Developer Documentation | SmartThings or here: Rules | Developer Documentation | SmartThings
[
{
"if": {
"and": [
{
"greaterThanOrEquals": {
"left": {
"time": {
"reference": "Now"
}
},
"right": {
"time": {
"reference": "Midnight",
"offset": {
"value": {
"integer": 27900
},
"unit": "Second"
}
}
}
}
},
{
"lessThan": {
"left": {
"time": {
"reference": "Now"
}
},
"right": {
"time": {
"reference": "Sunrise"
}
}
}
}
],
"then": [
{ ... }
Or should it be changed to something like this for it to work?
[
{
"every": {
"specific": {
"reference": "Midnight",
"offset": {
"value": { "integer": 27900 },
"unit": "Second"
}
},
"actions": [
{
"if": {
"lessThan": {
"left": { "time": { "reference": "Now" } },
"right": { "time": { "reference": "Sunrise" } }
},
"then": [
{ ... }