For use with Home Assistant and Node-RED
[
{
"id": "a1cf78783814db07",
"type": "tab",
"label": "Teams Presence",
"disabled": false,
"info": ""
},
{
"id": "26c61053c2bbd7a1",
"type": "server-state-changed",
"z": "a1cf78783814db07",
"name": "In a call",
"server": "3c34eda7.15dfc2",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "sensor.teams_activity",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "In a call",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"for": 0,
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"x": 490,
"y": 320,
"wires": [
[
"a6b23c7d891f95bb"
],
[
"7474ea4aa1af53e0"
]
]
},
{
"id": "a6b23c7d891f95bb",
"type": "api-call-service",
"z": "a1cf78783814db07",
"name": "Change to red",
"server": "3c34eda7.15dfc2",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.tyeb1c825f16596f7ba6sn1v",
"data": "{\t \"rgb_color\": [255, 0, 0],\t \"brightness\": 255\t}",
"dataType": "jsonata",
"mergecontext": "",
"output_location": "",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 700,
"y": 360,
"wires": [
[]
]
},
{
"id": "ae6e05e2c1331363",
"type": "api-call-service",
"z": "a1cf78783814db07",
"name": "Change Indicator To White",
"server": "3c34eda7.15dfc2",
"version": 1,
"debugenabled": false,
"service_domain": "light",
"service": "turn_on",
"entityId": "light.tyeb1c825f16596f7ba6sn1v",
"data": "{\t \"color_temp\": 400,\t \"brightness\": msg.data.attributes.brightness\t}",
"dataType": "jsonata",
"mergecontext": "",
"output_location": "payload",
"output_location_type": "none",
"mustacheAltTags": false,
"x": 1020,
"y": 340,
"wires": [
[]
]
},
{
"id": "7474ea4aa1af53e0",
"type": "api-current-state",
"z": "a1cf78783814db07",
"name": "Get Office Lights Status",
"server": "3c34eda7.15dfc2",
"version": 1,
"outputs": 1,
"halt_if": "",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "light.office_lights",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 710,
"y": 440,
"wires": [
[
"91a1fd0d354e2479"
]
]
},
{
"id": "91a1fd0d354e2479",
"type": "function",
"z": "a1cf78783814db07",
"name": "Match Office Lights Brightness",
"func": "if (msg.data.state === \"off\") {\n msg.data.attributes.brightness = 0;\n}\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 970,
"y": 440,
"wires": [
[
"ae6e05e2c1331363"
]
]
},
{
"id": "022b3ffee3a59f73",
"type": "server-state-changed",
"z": "a1cf78783814db07",
"name": "Office Lights Changed",
"server": "3c34eda7.15dfc2",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "light.office_lights",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"for": 0,
"forType": "num",
"forUnits": "minutes",
"ignorePrevStateNull": false,
"ignorePrevStateUnknown": false,
"ignorePrevStateUnavailable": false,
"ignoreCurrentStateUnknown": false,
"ignoreCurrentStateUnavailable": false,
"x": 280,
"y": 360,
"wires": [
[
"5da83655f60bdbb7"
],
[
"5da83655f60bdbb7"
]
]
},
{
"id": "5da83655f60bdbb7",
"type": "api-current-state",
"z": "a1cf78783814db07",
"name": "Teams Activity = In a call",
"server": "3c34eda7.15dfc2",
"version": 1,
"outputs": 2,
"halt_if": "In a call",
"halt_if_type": "str",
"halt_if_compare": "is",
"override_topic": false,
"entity_id": "sensor.teams_activity",
"state_type": "str",
"state_location": "payload",
"override_payload": "msg",
"entity_location": "data",
"override_data": "msg",
"blockInputOverrides": false,
"x": 410,
"y": 440,
"wires": [
[
"a6b23c7d891f95bb"
],
[
"7474ea4aa1af53e0"
]
]
},
{
"id": "3c34eda7.15dfc2",
"type": "server",
"name": "Home Assistant",
"legacy": false,
"addon": false,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true,
"cacheJson": true
}
]