Skip to content

Instantly share code, notes, and snippets.

@yottatsa
Created July 2, 2018 22:19
Show Gist options
  • Select an option

  • Save yottatsa/020af208f24c29e18c86aa04495db924 to your computer and use it in GitHub Desktop.

Select an option

Save yottatsa/020af208f24c29e18c86aa04495db924 to your computer and use it in GitHub Desktop.
Switch on the daylight when it's going dark, and switch on the nightlight when the motion is detected in the night. Do not disturb existing scenes.
[
{
"name": "1:me/sunlight-and-dnd",
"status": "enabled",
"conditions": [
{
"address": "/sensors/39/state/status",
"operator": "eq",
"value": "0"
},
{
"address": "/sensors/12/state/dark",
"operator": "eq",
"value": "True"
},
{
"address": "/sensors/12/state/dark",
"operator": "dx"
},
{
"address": "/groups/1/state/any_on",
"operator": "eq",
"value": "false"
}
],
"actions": [
{
"address": "/sensors/39/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
},
{
"name": "2:me/sunlight-and-dnd",
"status": "enabled",
"conditions": [
{
"address": "/sensors/39/state/status",
"operator": "eq",
"value": "0"
},
{
"address": "/sensors/12/state/dark",
"operator": "eq",
"value": "True"
},
{
"address": "/groups/1/state/any_on",
"operator": "eq",
"value": "false"
}
],
"actions": [
{
"address": "/sensors/39/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
},
{
"name": "3:me/sunlight-and-dnd",
"status": "enabled",
"conditions": [
{
"address": "/sensors/39/state/status",
"operator": "eq",
"value": "1"
},
{
"address": "/sensors/39/state/lastupdated",
"operator": "dx"
},
{
"address": "/config/localtime",
"operator": "in",
"value": "T13:00:00/T23:30:00"
}
],
"actions": [
{
"address": "/groups/1/action",
"method": "PUT",
"body": {
"scene": "P4dLCxMYLm4vwtS"
}
}
]
},
{
"name": "4:me/sunlight-and-dnd",
"status": "enabled",
"conditions": [
{
"address": "/sensors/11/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/11/state/presence",
"operator": "ddx",
"value": "PT00:00:00"
},
{
"address": "/groups/1/state/any_on",
"operator": "eq",
"value": "false"
}
],
"actions": [
{
"address": "/sensors/29/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
},
{
"name": "5:me/sunlight-and-dnd",
"status": "enabled",
"conditions": [
{
"address": "/sensors/29/state/status",
"operator": "eq",
"value": "1"
},
{
"address": "/sensors/29/state/lastupdated",
"operator": "dx"
},
{
"address": "/config/localtime",
"operator": "in",
"value": "T23:30:00/T08:00:00"
}
],
"actions": [
{
"address": "/groups/1/action",
"method": "PUT",
"body": {
"scene": "appOoq9qWIP6LoY"
}
}
]
},
{
"name": "6:me/sunlight-and-dnd",
"owner": "1WpB8vbDQAGxBircalr88qQKcOUsAcuwd-Sr89c-",
"status": "enabled",
"conditions": [
{
"address": "/sensors/11/state/presence",
"operator": "eq",
"value": "false"
},
{
"address": "/sensors/11/state/presence",
"operator": "ddx",
"value": "PT00:04:15"
},
{
"address": "/config/localtime",
"operator": "in",
"value": "T23:30:00/T08:00:00"
},
{
"address": "/sensors/29/state/status",
"operator": "eq",
"value": "1"
}
],
"actions": [
{
"address": "/sensors/29/state",
"method": "PUT",
"body": {
"status": 2
}
},
{
"address": "/groups/1/action",
"method": "PUT",
"body": {
"bri_inc": -127,
"transitiontime": 10
}
}
]
},
{
"name": "7:me/sunlight-and-dnd",
"status": "enabled",
"conditions": [
{
"address": "/sensors/29/state/status",
"operator": "eq",
"value": "2"
},
{
"address": "/sensors/29/state/lastupdated",
"operator": "ddx",
"value": "PT00:00:30"
},
{
"address": "/sensors/11/state/presence",
"operator": "eq",
"value": "false"
}
],
"actions": [
{
"address": "/groups/1/action",
"method": "PUT",
"body": {
"on": false
}
},
{
"address": "/sensors/29/state",
"method": "PUT",
"body": {
"status": 0
}
}
]
},
{
"name": "8:me/sunlight-and-dnd",
"status": "enabled",
"conditions": [
{
"address": "/sensors/11/state/presence",
"operator": "eq",
"value": "true"
},
{
"address": "/sensors/11/state/presence",
"operator": "ddx",
"value": "PT00:00:00"
},
{
"address": "/sensors/29/state/status",
"operator": "gt",
"value": "1"
}
],
"actions": [
{
"address": "/groups/1/action",
"method": "PUT",
"body": {
"bri_inc": 127,
"transitiontime": 10
}
},
{
"address": "/sensors/29/state",
"method": "PUT",
"body": {
"status": 1
}
}
]
},
{
"name": "9:me/sunlight-and-dnd",
"status": "enabled",
"conditions": [
{
"address": "/sensors/11/state/presence",
"operator": "eq",
"value": "false"
},
{
"address": "/groups/1/state/any_on",
"operator": "eq",
"value": "false"
}
],
"actions": [
{
"address": "/sensors/29/state",
"method": "PUT",
"body": {
"status": 0
}
}
]
},
{
"name": "10:me/sunlight-and-dnd",
"status": "enabled",
"conditions": [
{
"address": "/sensors/39/state/status",
"operator": "eq",
"value": "1"
},
{
"address": "/config/localtime",
"operator": "in",
"value": "T23:30:00/T13:00:00"
}
],
"actions": [
{
"address": "/sensors/39/state",
"method": "PUT",
"body": {
"status": 0
}
}
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment