[
{
"id": "74bde181.c781",
"type": "tab",
"label": "Lighting",
"disabled": false,
"info": ""
},
{
"id": "ba7fdad2.1f14b8",
"type": "server-state-changed",
"z": "74bde181.c781",
"name": "Motion in Office",
"server": "ad7854a1.e84738",
"entityidfilter": "binary_sensor.motion_office",
"entityidfiltertype": "substring",
"outputinitially": false,
"state_type": "str",
"haltifstate": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 1,
"x": 160,
"y": 360,
"wires": [
[
"94f7c3f6.33217"
]
]
},
{
"id": "8efff11b.00bcc",
"type": "api-call-service",
"z": "74bde181.c781",
"name": "Turn on @ 100%",
"server": "ad7854a1.e84738",
"service_domain": "light",
"service": "turn_on",
"data": "{\"entity_id\":\"light.loft_light,light.desk_light\",\"brightness_pct\":\"100\",\"color_name\":\"white\"}",
"render_data": false,
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"x": 1030,
"y": 260,
"wires": [
[]
]
},
{
"id": "94f7c3f6.33217",
"type": "switch",
"z": "74bde181.c781",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "on",
"vt": "str"
},
{
"t": "eq",
"v": "off",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 500,
"y": 480,
"wires": [
[
"fdf0e749.f5d058",
"6dab9f83.edeb"
],
[
"fdf0e749.f5d058"
]
]
},
{
"id": "fdf0e749.f5d058",
"type": "stoptimer",
"z": "74bde181.c781",
"duration": "20",
"units": "Minute",
"payloadtype": "num",
"payloadval": "0",
"name": "",
"x": 830,
"y": 470,
"wires": [
[
"be83c083.e5411"
],
[]
]
},
{
"id": "be83c083.e5411",
"type": "api-call-service",
"z": "74bde181.c781",
"name": "Turn off",
"server": "ad7854a1.e84738",
"service_domain": "light",
"service": "turn_off",
"data": "{\"entity_id\":\"light.desk_light\"}",
"render_data": false,
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"x": 1000,
"y": 360,
"wires": [
[]
]
},
{
"id": "6dab9f83.edeb",
"type": "api-current-state",
"z": "74bde181.c781",
"name": "Already on?",
"server": "ad7854a1.e84738",
"halt_if": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": true,
"override_payload": true,
"override_data": true,
"entity_id": "light.desk_light",
"state_type": "str",
"outputs": 2,
"x": 410,
"y": 80,
"wires": [
[
"a197150.b9ea2e8"
],
[]
]
},
{
"id": "a197150.b9ea2e8",
"type": "time-range-switch",
"z": "74bde181.c781",
"name": "Determine brightness",
"lat": "40.07562",
"lon": "-82.86322",
"startTime": "08:00",
"endTime": "21:00",
"startOffset": "",
"endOffset": "",
"x": 1020,
"y": 100,
"wires": [
[
"8efff11b.00bcc"
],
[
"4992fd03.1aaf14"
]
]
},
{
"id": "4992fd03.1aaf14",
"type": "api-call-service",
"z": "74bde181.c781",
"name": "Turn on @ 5%",
"server": "ad7854a1.e84738",
"service_domain": "light",
"service": "turn_on",
"data": "{\"entity_id\":\"light.desk_light\",\"brightness_pct\":\"5\"}",
"render_data": false,
"mergecontext": "",
"output_location": "payload",
"output_location_type": "msg",
"x": 1020,
"y": 310,
"wires": [
[]
]
},
{
"id": "58917183.08ff4",
"type": "comment",
"z": "74bde181.c781",
"name": "Office Lighting",
"info": "",
"x": 150,
"y": 300,
"wires": []
},
{
"id": "ad7854a1.e84738",
"type": "server",
"z": "",
"name": "Home Assistant",
"legacy": false,
"hassio": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open"
}
]