Building A Custom Alexa Skill – Part 7 - A Brand New approach (NO AWS / LAMBDA!) (Part 4)

Part 3: https://community.home-assistant.io/t/building-a-custom-alexa-skill-part-7-a-brand-new-approach-no-aws-lambda-part-3/730816

Helper Flow:

[{"id":"b90f8906d88132b6","type":"tab","label":"Get current device Attributes","disabled":false,"info":"","env":[]},{"id":"3ca8d4f123eb461f","type":"function","z":"b90f8906d88132b6","name":"function 29","func":"//var entity = flow.get('entity');\n//var action = flow.get('action');\nvar entity = 'kitchen';\nvar action = 'turn on';\n\nvar initialJSON = '{\"description\": \"This document contains data around the house.  I am using HomeAssistant, and it will be abbreviated to HA. Top level nodes wil have a child node called descrition (EX:DeviceMappings.description). based upon the path you should understand the context for each item, please use the top level mapping node to understand the capabilites of each entity.  An entity is a generic term items in HA. if you see a friendly name that contains battery, such as \\'Bathroom Motion Sensor Battery\\', this represents the amount of power left in the battery.   Consume the rest of this document in order to use the data.\",  \"Address\": \"xxxxxxxxxxxx, 4xxxxx\",  \"integrations\":{    \"description\": \"these are 3rd party systems that HomeAssistant leverages for automation\",        \"integration\":{            \"Ford Pass\": \"Provides programatic access to Andys ford bronco.  Offers many sensors including things like: door lock status, turning lights on, GPS location, oil quality, etc.\",            \"HACS\": \"3rd pary repository of integrations for HA.  Not officially supported by HA.\",            \"Honeywell Total Connect Comfort\" : \"Provides integration with the single zone HVAC system.\",            \"Sense\":\"Provides the homes energy consumption by device. Values for sense integrations (contining words such as \\'voltage\\' or \\'usage\\' in the friendly name), are represented in kilo watt hours.\",\"sun\":\"Provides access sun events based upon latitude and longitude.  Events such as sunrise, sunset, dawn, dusk, etc.\",           \"Zigbee Home Automation\": \"All items in the house are Zigbee, unless otherwise called out.  Ford Pass, HACS, Honewell and Sense integrations are via API and are external connections.  Zigbee is local.\"        }  },  \"mappings\": {    \"description\": \"A mapping that provides a way to understand the full programatic name and capabilites of an entity in the house. the key is the human word and the value is the HA word.  You will respond using the human word, but you will also include the the programatic name in your response.\",    \"HALevel\": {      \"on\": \"turn_on\",      \"off\": \"turn_off\",      \"toggle\": \"toggle\",      \"Set HVAC Mode\": \"set_hvac_mode\",      \"Set Temperature\": \"set_temperature\"    },    \"possible_values_based_on_ha_names\": {      \"turn_on\": \"turn_on\",      \"off\": \"turn_off\",      \"toggle\": \"toggle\",      \"set_hvac_mode\": [        \"heat\",        \"cool\",        \"off\"      ],      \"set_temperature\": \"any number that meets this equation: 64 <=current temperature <=74\"    }  },  \"DeviceTypes\": {    \"switch\": {      \"description\": \"An HA entity which has two states:  On and off.\",      \"programValue\": \"switch.\",      \"actions\": {        \"can_perform\": [          \"turn_on\",         \"turn_off\",          \"toggle\"        ],        \"definitions\": {          \"turn_on\": \"command to turn a light on\",          \"turn_off\": \"command to turn a light off\",          \"toggle\": \"Change the state from one to another.  Example if the switch is on, sending the toggle command would turn the switch off and vice versa.\"        }      }    },    \"light\": {      \"description\": \"An entity in HA which is a zigbee powered phillips hue light bulb.  All lights are White / Warm White standard US lightbulbs.  The two lamps in the Bedroom are also color capable.  There are 2 phillips hue light strips under the bed, and there is a Govee light strip called \\'bathroom vanity\\'.  There are also 2 Govee light strips in the kitchen and they contain the words \\'right\\' and \\'left\\'.  The Govee lights are accessed by HA automations.\",      \"programValue\": \"light.\",      \"actions\": {        \"can_perform\": [          \"turn_on\",         \"turn_off\",          \"toggle\",          \"brightness\",          \"brightness_pct\",          \"xy_color\"        ],        \"definitions\": {          \"turn_on\": \"command to turn a light on\",          \"turn_off\": \"command to turn a light off\",          \"toggle\": \"Change the state from one to another.  Example if the light is on, sending the toggle command would turn the switch off and vice versa.\",          \"brightness\": \"Represents the brightness of a light on a scale of 0 to 254 with 0 being no light and 254 being as bright as a light will go\",          \"brightness_pct\": \"Represents the brightness of a light on a scale of 0 to 100% with 0 being no light and 100% being as bright as a light will go\",          \"xy_color\": \"Represents the color that the lamp is.  This representation is utilizing the x and y color space.\"        }      }    },    \"sensor\": {      \"programValue\": \"sensor.\",      \"description\": \"Any entity which provides a value.  An example would be a thermostat.  The current temperature would be presented to HA as a sensor.\",      \"actions\": {        \"can_perform\": [        ],        \"definitions\": {}      }    },    \"binary_sensor\": {      \"programValue\": \"binary_sensor.\",      \"description\": \"An entity in HA which has two states: on and off.  If a binary sensor is of type motion, then on means there is motion detected.  If the entity is an open and close, or window sensor, then on means that the window is open.\",      \"actions\": {        \"can_perform\": [        ],       \"definitions\": {}      }    },    \"input_boolean\": {      \"programValue\": \"binary_sensor.\",      \"description\": \"A helper entity, created by Andy.  It has 2 states, on and off.\",      \"actions\": {        \"can_perform\": [          \"turn_on\",          \"turn_off\",          \"toggle\"        ],        \"definitions\": {            \"turn_on\": \"turn input boolean on, or set to \\'true\\'\",            \"turn_off\": \"turn input boolean off, or set to \\'false\\'\",            \"toggle\": \"Change the state from one to another.  Example if the input boolean is on, sending the toggle command would turn the input boolean off and vice versa.\"          }        }    },    \"input_select\": {      \"programValue\": \"input_select.\",      \"description\": \"A helper entity.  Presents data on a webpage in a <select> element.  The value of the selected item is reported via HA.\",      \"actions\": {        \"can_perform\": [          \"random\", \"reload\",\"select_first\",\"select_last\", \"select_next\",\"select_previous\", \"select_first\",\"select_last\",\"select_option\"],        \"definitions\": {            \"random\":\"Selects a random item from the select list\",             \"reload\":\"Reloads the select list items.  used if you have programatically added a value to the list\",            \"select_first\":\"Selects the first item in the select list\",           \"select_last\":\"Selects the last item in the select list\",            \"select_next\" :\"Selects the next item in the list based upon the selected value\",            \"select_previous\":\"Selects the previous item in the list based upon the selected value\",          \"select_option\":\"Used to programatically select a specific value in an input_select list.\"                }            }        },    \"automation\": {      \"programValue\": \"automation.\",      \"description\": \"An entity in HA that represents a yaml file which HA can automatically trigger.  These YAML files are created by Andy.\",      \"actions\": {        \"can_perform\": [          \"toggle\",          \"trigger\",          \"turn_on\",        \"turn_off\"        ],        \"definitions\": {          \"toggle\": \"change an automation from on to off, or vice versa depending on the state of the automation currently\",          \"trigger\": \"causes an existing automation to run regardless of any triggers\",          \"turn_on\": \"Enables an automation\",          \"turn_off\": \"diables an automation\"        }      }    },    \"button\":{        \"programValue\":\"button:\",        \"description\": \"An entity in HA that is a \\'momentary switch\\'.  Buttons are used as a \\'push button\\' and have two states null and pressed\",        \"actions\": {            \"can_perform\": [\"press\"            ],            \"definitions\": {                \"press\":\"Used to programatically \\'push\\' the button\"            }          }        },    \"media_player\":{        \"programValue\":\"media_player.\",        \"description\":\" An entity in HA that is capable of playing audio.  Alexa Echos and any connected speakers will be of type media_player.  Alexa\\'s can and are used to speak your responses. the \\'custom\\' command can be used to speak to alex for anything that does not have an HA integration, but does integrate with Alex.  Right now, I am only using Govee lights through amazon.  If you want to send a custom command to alexa, it must be in the format: \\'Alexa, tell ...\\' replace \\'...\\' with your suggestion.\",        \"actions\": {            \"can_perform\": [\"play\",\"pause\",\"stop\",\"custom\"],            \"definitions\": {                \"play\":\"media_play\",                \"pause\":\"media_pause\",                \"stop\":\"media_stop\",                \"custom\":\"custom\"            }          }        }    ,\"response_document_format\": \"{entity_id: eid, action: act, history: hist, response: resp}\",\"response_document_reference\": \"use the valUE of the node response_document_format to format your response.  Replace eid with the full entity name, act with the action to be performed, hist with any historical information, resp with your response.\"}}';\nvar toPrompt = initialJSON.replace(\"<0>\", global.get(\"houseJSON\")).replace(\"<1>\", flow.get(\"lightMap\"));\ntoPrompt += toPrompt.replace(\"<2>\", entity).replace(\"<3>\", action);\ntoPrompt += \"using the above data.  Please respond that the requested action on the friendly name for the entity occured.  Also, use the node \\'current_house_state'\\ in the above document to reference the current state of the house (sensor, lights, switches, etc).  Use \\'house_entity_mapping_by_room\\' node so that you understand what entities are in what rooms.  Use the address in the JSON document for any Geolocation needs.  You will respond in a conversational tone.  You will use phrases such as \\'I suggest\\' and \\'I recommend\\'. Your JSON response will be well formed.\";\nmsg.payload = JSON.parse(toPrompt);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":290,"y":140,"wires":[[]]},{"id":"bb0b9f2a186b7ce2","type":"inject","z":"b90f8906d88132b6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":303,"y":62,"wires":[["bf9df0246991ba29"]]},{"id":"bf9df0246991ba29","type":"function","z":"b90f8906d88132b6","name":"Build Light Map","func":"var lights = '{\"master bedroom\":\"\",\"masterbedroom\":\"\",\"master bedroom lamps\":\"light.bedroom_lamps\",\"bedroom lamps\":\"light.bedroom_lamps\",\"bedroom lamp\":\"light.bedroom_lamps\",\"master bedrom lamps\":\"light.bedroom_lamps\",\"master\":\"\",\"hallway\":\"\",\"hall\":\"\",\"bedroom\":\"\",\"sunroom\":\"switch.sunroom_rope_lights_switch\",\"sun room\":\"switch.sunroom_rope_lights_switch\",\"livingroom\":\"light.living_room_all\",\"living room\":\"light.living_room_all\",\"kitchen\":\"light.kitchen\",\"bathroom\":\"light.bathroom\",\"bed\":\"light.bed\",\"dining room\":\"light.dining_room\",\"diningroom\":\"light.dining_room\",\"kitchen sink light\":\"light.kitchen_sink_light\",\"kitchen sink\":\"light.kitchen_sink_light\",\"living room lamps\":\"light.living_room_lamps\"}';\nflow.set(\"lightMap\", lights);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":493,"y":62,"wires":[[]]},{"id":"e52510cf5c82b241","type":"inject","z":"b90f8906d88132b6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1400,"y":360,"wires":[["5594edbf.473a34"]]},{"id":"5594edbf.473a34","type":"ha-api","z":"b90f8906d88132b6","name":"Bedroom","server":"4afbd465.07e87c","version":1,"debugenabled":false,"protocol":"websocket","method":"get","path":"","data":"{\t   \"type\":\"search/related\",\t   \"item_type\":\"area\",\t   \"item_id\":\"bedroom\"\t}","dataType":"jsonata","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":280,"y":400,"wires":[["5672d793e689ef9e","91431a6115709d9a"]]},{"id":"9743cfa15eee6cb1","type":"function","z":"b90f8906d88132b6","name":"Filter Resutls","func":"\nvar i =0;\nvar entities = msg.payload.entity;\nvar items= [];\nwhile(i < entities.length)\n{\n    var holder = entities[i];\n    if(holder.includes(\"light.\") || \n    holder.includes(\"binary_sensor.\") || \n    holder.includes(\"sensor.\"))\n    {\n        if(!holder.includes(\"battery\"))\n        {\n            items.push(holder); \n        }   \n    }\n        i++; \n}\nvar area = msg.area;\nmsg = {};\nmsg.payload ={};\nmsg.payload = items;\nmsg.area = area;\n\nreturn msg; ","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":440,"wires":[["a62c720bc7230586","6ef9d4432ab2c85d"]]},{"id":"9e0363dd06cb74de","type":"ha-api","z":"b90f8906d88132b6","name":"Kitchen","server":"4afbd465.07e87c","version":1,"debugenabled":false,"protocol":"websocket","method":"get","path":"","data":"{\t   \"type\":\"search/related\",\t   \"item_type\":\"area\",\t   \"item_id\":\"kitchen\"\t}","dataType":"jsonata","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":280,"y":460,"wires":[["d4cc69f2dd139ce1","bf6d527b2e689c09"]]},{"id":"9a49af5c98c095b7","type":"ha-api","z":"b90f8906d88132b6","name":"Dining Room","server":"4afbd465.07e87c","version":1,"debugenabled":false,"protocol":"websocket","method":"get","path":"","data":"{\t   \"type\":\"search/related\",\t   \"item_type\":\"area\",\t   \"item_id\":\"dining_room\"\t}","dataType":"jsonata","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":290,"y":520,"wires":[["a28607739e840ad5","6e1a9fc89a931fe5"]]},{"id":"5889ee928e66df3d","type":"ha-api","z":"b90f8906d88132b6","name":"Living Room","server":"4afbd465.07e87c","version":1,"debugenabled":false,"protocol":"websocket","method":"get","path":"","data":"{\t   \"type\":\"search/related\",\t   \"item_type\":\"area\",\t   \"item_id\":\"living_room\"\t}","dataType":"jsonata","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":290,"y":580,"wires":[["cec5a43018644027","dfaca2dea45684fa"]]},{"id":"63a75e69816acba3","type":"ha-api","z":"b90f8906d88132b6","name":"Bathroom","server":"4afbd465.07e87c","version":1,"debugenabled":false,"protocol":"websocket","method":"get","path":"","data":"{\t   \"type\":\"search/related\",\t   \"item_type\":\"area\",\t   \"item_id\":\"bathroom_3\"\t}","dataType":"jsonata","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":280,"y":640,"wires":[["cc05e5323541f6b3","b466d267b08b4388"]]},{"id":"a62c720bc7230586","type":"array-splitter","z":"b90f8906d88132b6","name":"","topic":"","index":0,"x":940,"y":440,"wires":[["f01389b2138f7150"]]},{"id":"a5d402a0bb640096","type":"ha-get-entities","z":"b90f8906d88132b6","name":"","server":"4afbd465.07e87c","version":1,"rules":[],"outputType":"array","outputEmptyResults":false,"outputLocationType":"msg","outputLocation":"payload","outputResultsCount":1,"x":1250,"y":440,"wires":[["6f47818c6aff6825"]]},{"id":"f01389b2138f7150","type":"function","z":"b90f8906d88132b6","name":"function 34","func":"/*\nbinary_sensor.left_master_window_opening_2*/\nmsg.payload.rules=new Array(1);\nvar msgg = {};\nmsgg.payload = {};\nmsgg.payload.rules = {};\n\nvar x = [];\nx.push({\"property\":\"entity_id\", \"logic\":\"is\", \"value\":msg.payload})\n\nmsgg.payload.rules =x;\n\nreturn msgg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1090,"y":440,"wires":[["a5d402a0bb640096"]]},{"id":"6f47818c6aff6825","type":"function","z":"b90f8906d88132b6","name":"function 35","func":"var entity = msg.payload[0].entity_id.split(\".\")[1];\n//node.warn(entity);\n//node.warn(msg);\nglobal.set(entity, msg.payload[0]);\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1410,"y":440,"wires":[["ef95d9dd2e25d0fa"]]},{"id":"d4ac0b2e1594a526","type":"ha-get-entities","z":"b90f8906d88132b6","name":"","server":"4afbd465.07e87c","version":1,"rules":[{"property":"","logic":"is","value":"","valueType":"str"}],"outputType":"array","outputEmptyResults":false,"outputLocationType":"msg","outputLocation":"payload","outputResultsCount":1,"x":270,"y":980,"wires":[["68cf28a27d032bd3"]]},{"id":"f6842d472725585e","type":"inject","z":"b90f8906d88132b6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":80,"y":980,"wires":[["d4ac0b2e1594a526"]]},{"id":"68cf28a27d032bd3","type":"debug","z":"b90f8906d88132b6","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":490,"y":980,"wires":[]},{"id":"fd0646c3115e809b","type":"inject","z":"b90f8906d88132b6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":520,"wires":[["9a49af5c98c095b7","63a75e69816acba3","5889ee928e66df3d","9e0363dd06cb74de","5594edbf.473a34"]]},{"id":"91431a6115709d9a","type":"function","z":"b90f8906d88132b6","name":"function 47","func":"global.set(\"bedroom\", msg.payload.entity);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":500,"wires":[["6bf4aefb38621223"]]},{"id":"d4cc69f2dd139ce1","type":"function","z":"b90f8906d88132b6","name":"function 48","func":"global.set(\"kitchen\", msg.payload.entity);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":540,"wires":[["ed18a685fa1bdf75"]]},{"id":"a28607739e840ad5","type":"function","z":"b90f8906d88132b6","name":"function 49","func":"global.set(\"dining_room\", msg.payload.entity);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":580,"wires":[["992c4201e5d6b81a"]]},{"id":"cec5a43018644027","type":"function","z":"b90f8906d88132b6","name":"function 50","func":"global.set(\"living_room\", msg.payload.entity);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":620,"wires":[["ce1f12852308b469"]]},{"id":"cc05e5323541f6b3","type":"function","z":"b90f8906d88132b6","name":"function 51","func":"global.set(\"bathroom\", msg.payload.entity);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":790,"y":660,"wires":[["b919d5a6b15d5ddc"]]},{"id":"6bf4aefb38621223","type":"function","z":"b90f8906d88132b6","name":"function 53","func":"var entitieslist = global.get(\"bedroom\");\n//node.warn(entitieslist);\nvar holder = [];\nvar i =0\nwhile (i<entitieslist.length)\n{\n    //node.warn(entitieslist[i].split(\".\")[1]);\n    var x = global.get(entitieslist[i].split(\".\")[1]);\n    if(x){\n    holder.push(x);\n    }\n        i++;\n}\nglobal.set(\"Jarvis_bedroom\", holder);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":500,"wires":[[]]},{"id":"ed18a685fa1bdf75","type":"function","z":"b90f8906d88132b6","name":"function 54","func":"var entitieslist = global.get(\"kitchen\");\n//node.warn(entitieslist);\nvar holder = [];\nvar i =0\nwhile (i<entitieslist.length)\n{\n    //node.warn(entitieslist[i].split(\".\")[1]);\n    var x = global.get(entitieslist[i].split(\".\")[1]);\n    if(x){\n    holder.push(x);\n    }\n        i++;\n}\nglobal.set(\"Jarvis_kitchen\", holder);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":540,"wires":[[]]},{"id":"992c4201e5d6b81a","type":"function","z":"b90f8906d88132b6","name":"function 55","func":"var entitieslist = global.get(\"dining_room\");\n//node.warn(entitieslist);\nvar holder = [];\nvar i =0\nwhile (i<entitieslist.length)\n{\n    //node.warn(entitieslist[i].split(\".\")[1]);\n    var x = global.get(entitieslist[i].split(\".\")[1]);\n    if(x){\n    holder.push(x);\n    }\n        i++;\n}\nglobal.set(\"Jarvis_dining_room\", holder);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":580,"wires":[[]]},{"id":"ce1f12852308b469","type":"function","z":"b90f8906d88132b6","name":"function 56","func":"var entitieslist = global.get(\"living_room\");\n//node.warn(entitieslist);\nvar holder = [];\nvar i =0\nwhile (i<entitieslist.length)\n{\n    //node.warn(entitieslist[i].split(\".\")[1]);\n    var x = global.get(entitieslist[i].split(\".\")[1]);\n    if(x){\n    holder.push(x);\n    }\n        i++;\n}\nglobal.set(\"Jarvis_living_room\", holder);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":620,"wires":[[]]},{"id":"b919d5a6b15d5ddc","type":"function","z":"b90f8906d88132b6","name":"function 57","func":"var entitieslist = global.get(\"bathroom\");\n//node.warn(entitieslist);\nvar holder = [];\nvar i =0\nwhile (i<entitieslist.length)\n{\n    //node.warn(entitieslist[i].split(\".\")[1]);\n    var x = global.get(entitieslist[i].split(\".\")[1]);\n    if(x){\n    holder.push(x);\n    }\n        i++;\n}\nglobal.set(\"Jarvis_bathroom\", holder);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":660,"wires":[[]]},{"id":"5672d793e689ef9e","type":"function","z":"b90f8906d88132b6","name":"function 58","func":"msg.area = \"bedroom\";\nflow.set('area', msg.area)\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":240,"wires":[["9743cfa15eee6cb1","3d83e726939c3a97","4132339ed4a81e25"]]},{"id":"bf6d527b2e689c09","type":"function","z":"b90f8906d88132b6","name":"function 59","func":"msg.area = \"kitchen\";\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":470,"y":300,"wires":[["9743cfa15eee6cb1","4132339ed4a81e25"]]},{"id":"6e1a9fc89a931fe5","type":"function","z":"b90f8906d88132b6","name":"function 60","func":"msg.area=\"dining_room\";\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":360,"wires":[["9743cfa15eee6cb1","4132339ed4a81e25"]]},{"id":"dfaca2dea45684fa","type":"function","z":"b90f8906d88132b6","name":"function 61","func":"msg.area=\"living_room\";\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":490,"y":420,"wires":[["9743cfa15eee6cb1","4132339ed4a81e25"]]},{"id":"b466d267b08b4388","type":"function","z":"b90f8906d88132b6","name":"function 62","func":"msg.area=\"bathroom\";\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":530,"y":480,"wires":[["9743cfa15eee6cb1","4132339ed4a81e25"]]},{"id":"d532e58ff0d394c7","type":"inject","z":"b90f8906d88132b6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":1000,"y":260,"wires":[["5594edbf.473a34"]]},{"id":"3d83e726939c3a97","type":"debug","z":"b90f8906d88132b6","name":"debug 66","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":660,"y":220,"wires":[]},{"id":"ef95d9dd2e25d0fa","type":"emerge","z":"b90f8906d88132b6","name":"","grpRules":[{"ruleProperty":"payload[0].entity_id","rulePropertyType":"msg","ruleOperation":"!empty","ruleValue":"","ruleValueType":"str"},{"ruleProperty":"area","rulePropertyType":"msg","ruleOperation":"!empty","ruleValue":"","ruleValueType":"str"}],"ruleProperty":"payload","rulePropertyType":"msg","ruleOperation":"==","ruleValue":"","ruleValueType":"str","rulesTimeout":30,"timeoutAction":"1","x":1620,"y":420,"wires":[["9e296b915b60674d"]]},{"id":"4132339ed4a81e25","type":"link out","z":"b90f8906d88132b6","name":"link out 15","mode":"link","links":["ac2358bd50789091"],"x":785,"y":300,"wires":[]},{"id":"ac2358bd50789091","type":"link in","z":"b90f8906d88132b6","name":"link in 6","links":["4132339ed4a81e25"],"x":1555,"y":300,"wires":[["aeae209239892666"]]},{"id":"9e296b915b60674d","type":"switch","z":"b90f8906d88132b6","name":"","property":"area","propertyType":"msg","rules":[{"t":"eq","v":"bedroom","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":1770,"y":420,"wires":[["dfb7ddc99f8c8f1e"]]},{"id":"dfb7ddc99f8c8f1e","type":"function","z":"b90f8906d88132b6","name":"function 63","func":"var area = msg.area;\nmsg = {};\nmsg.payload = global.get(\"Jarvis_\"+area);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1930,"y":420,"wires":[["6425bf97106c8b5d"]]},{"id":"7c2a7a88dc16012c","type":"link in","z":"b90f8906d88132b6","name":"Repopulate Areas","links":["22e9575c964c55c7","4542279a53b84e2e"],"x":85,"y":420,"wires":[["5594edbf.473a34","9e0363dd06cb74de","9a49af5c98c095b7","5889ee928e66df3d","63a75e69816acba3"]]},{"id":"6425bf97106c8b5d","type":"link out","z":"b90f8906d88132b6","name":"link out 16","mode":"link","links":[],"x":2015,"y":320,"wires":[]},{"id":"aeae209239892666","type":"function","z":"b90f8906d88132b6","name":"function 64","func":"var y = {};\n\ny.area = msg.area;\nreturn y;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1790,"y":300,"wires":[["ef95d9dd2e25d0fa"]]},{"id":"ec27eafad9a561ab","type":"inject","z":"b90f8906d88132b6","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":120,"y":300,"wires":[["5594edbf.473a34"]]},{"id":"6ef9d4432ab2c85d","type":"debug","z":"b90f8906d88132b6","name":"debug 67","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":920,"y":360,"wires":[]},{"id":"4afbd465.07e87c","type":"server","name":"Home Assistant","addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"","connectionDelay":false,"cacheJson":false,"heartbeat":false,"heartbeatInterval":"","statusSeparator":"","enableGlobalContextStore":true}]