74 lines
3.1 KiB
JSON
74 lines
3.1 KiB
JSON
[
|
|
{
|
|
"id": "Wand first-three array values",
|
|
"automation": "- alias: Wand first-three array values\n description: ''\n triggers:\n - entity_id: sensor.wand_history\n trigger: state\n conditions:\n - condition: template\n value_template: \"{%- set arr = states('sensor.wand_history')\\n | default('[]')\\n\\\n \\ | from_json -%}\\n{{ (arr | length) >= 3\\n and (arr[0] | int)\\\n \\ == 3\\n and (arr[1] | int) == 4\\n and (arr[2] | int) == 6\\n and (arr[3]\\\n \\ | int) == 5}}\\n\"\n actions:\n - data:\n name: Wand monitor\n message: \"{%- set arr = states('sensor.wand_history')\\n | default('[]')\\n\\\n \\ | from_json -%}\\nLength = {{ arr | length }}, first = {{ arr[0]\\\n \\ | int(default='NA') }}, second = {{ arr[1] | int(default='NA') }}\\n\"\n action: logbook.log\n - type: turn_on\n device_id: 8eec696046bc8d1477ff5ad793b8bc2b\n entity_id: c1039bbd0f68f51d14f8ea4353d44eeb\n domain: switch\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "wand history sensor",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.wand_history",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "wand monitor switch",
|
|
"room": null,
|
|
"type": "switch",
|
|
"id": {
|
|
"entity_id": "c1039bbd0f68f51d14f8ea4353d44eeb",
|
|
"device_id": "8eec696046bc8d1477ff5ad793b8bc2b"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "wand off",
|
|
"automation": "- alias: wand off\n description: ''\n triggers:\n - trigger: state\n entity_id:\n - sensor.wand_light\n from: '0'\n to: '1'\n conditions: []\n actions:\n - type: turn_off\n device_id: e1e6308d9faf380c83a6898fbf836a8e\n entity_id: cb54a644bf2619e64394c5f54ac32325\n domain: switch\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "wand light sensor",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.wand_light",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "wand off switch",
|
|
"room": null,
|
|
"type": "switch",
|
|
"id": {
|
|
"entity_id": "cb54a644bf2619e64394c5f54ac32325",
|
|
"device_id": "e1e6308d9faf380c83a6898fbf836a8e"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Wand on",
|
|
"automation": "- alias: Wand on\n description: ''\n triggers:\n - trigger: state\n entity_id:\n - sensor.wand_light\n from: '1'\n to: '0'\n conditions: []\n actions:\n - type: turn_on\n device_id: e1e6308d9faf380c83a6898fbf836a8e\n entity_id: cb54a644bf2619e64394c5f54ac32325\n domain: switch\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "wand light sensor",
|
|
"room": null,
|
|
"type": "sensor",
|
|
"id": {
|
|
"entity_id": "sensor.wand_light",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "wand off switch",
|
|
"room": null,
|
|
"type": "switch",
|
|
"id": {
|
|
"entity_id": "cb54a644bf2619e64394c5f54ac32325",
|
|
"device_id": "e1e6308d9faf380c83a6898fbf836a8e"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
] |