RGB_Hass_entities

RGB_Hass_entities

Usage

This flow supports the Home Assistant Lights Control and Home Assistant via Node-Red app. in Snips app store.

It is used to control the color of light/group of lights entities in homeassistant.

When the command is given under a certain rule, we can control color changes into two entities in a single command.

It handles the intent produced by Snips.AI assistant, it extracts the needed values and triggers a homeassistant call service (or a mqtt publish message).

https://www.youtube.com/watch?v=kpdakdll3Ac

Requirements

Home Assistant with some light entities.

Node-Red as an add-on.

Snips.AI as an add-on with "Home Assistant via Node-Red" app added in your assistant.

Note: This flow works when Node-Red and Snips run as addons in Home Assistant. It can work in a satelite device as well with some changes though. The satelite flow will be uploaded as different flow.

Installation

Node-Red

To intall the flow download the zip and extract it. Open the flow with your favorite editor, copy the content and paste it in the Import/clipboard tab in Node-Red.

Reconfigure the flow.

Read the comments nodes to guide you through this process.

Read in each node the Description tab as well for a brief node explanation.

Snips.AI

  • Add the app "Home Assistant via Node-Red" in your assistant.

  • Edit the slot Rgbentity

In this slot enter the names of the light entities you have in your homeassistant config.yaml and group.yaml . Note that they should be added as slot values and not synonyms. Synonyms can be added but they will point to the slot value, so be sure you have entered the names as found in your .yaml files.

  • Delete values that you don't use from the ones that already in the slot.

  • Edit the training examples and re-configure to include the names of your entities.

  • Edit the slot Chroma

In this slot enter the colors you would like to use.

  • Add or delete values according you liking.

  • Edit the training examples and re-configure to include the colors you added (if any).

  • Download and install your assistant.

Home Assistant

In your home assistant config.yaml enable snips component


snips:

In your home assistant config.yaml (or intent_script.yaml if you have split things up) add the following.

intent_script:
  Rgbandentity:
    speech: 
      type: plain
      text: ' {{ Rgbentity }} color changed to {{ Chroma  }}. '
 

Note: If you have changed the intent name, re-configure the above to match.

Note: Adding a text into your config.yaml for each intent is important. It will speed up the overall process. If you don't want any kind off feedback just play an empty text. (text: ' ')

[{"id":"4cf772d4.c2341c","type":"tab","label":"RGB_entity","disabled":false,"info":"Change color into one or two light entities.\nNote: in odrer for this flow to function \nyou should keep in mind the command should follow \nthe rule: 1st entity followed by the color name\nthen the 2nd entity followed by the desired color.\nThe current flow is not capable of handling\na different order.\n\n\n This flow is made for users that are running\nHome Assistant and use Node-Red and Snips.AI as\nadd-ons.\n It can be easily switched for use as a flow\n on a satellite device that runs snips and node red \n and publish mqtt messages instead of triggering a \nhomeassistant turn_service. \n"},{"id":"45d3b733.91b058","type":"mqtt in","z":"4cf772d4.c2341c","name":"MQTT TOPIC","topic":"hermes/intent/nik_poz:Rgbandentity","qos":"2","datatype":"auto","broker":"e92d1794.a4b0d8","x":149,"y":330,"wires":[["f7c0e169.323db","efe22597.c96bd8"]],"info":"This node needs to be reconfigured\n\n1)Add your server.\n2)Repalce \"nik_poz:Rgbandentity\" in the topic area, \nin the Properties tab.\n\n\nTip:\n I found the internal one(127.0.0.1),\nworking better for me.\n Try listening on both of your servers \n and see what works best for you.\n \nNote:\nMake sure you have added your server credentials."},{"id":"68788c0.2603f74","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","x":610,"y":333,"wires":[]},{"id":"f7c0e169.323db","type":"yaml","z":"4cf772d4.c2341c","property":"payload","name":"","x":417,"y":332,"wires":[["68788c0.2603f74","c08be169.c4509","4831489c.dfa1d8"]],"info":"Nothing to configure"},{"id":"9a725f2.b6c24a","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":646,"y":651,"wires":[]},{"id":"a504feb7.21853","type":"change","z":"4cf772d4.c2341c","name":"SET TEMPORARY msg.topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"{    \"domain\": \"homeassistant\",    \"service\": \"turn_on\",    \"data\": {        \"entity_id\": \"light.kitchen_secret\"    }}","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":968,"y":481,"wires":[["a3bc5bfb.761128","b4951ea4.17807"]],"info":"In this node we are setting up on msg.topic the\nformat that we will use to trigger a \nhomeassistant light.turn_on service.\n All content of the msg.topic will become \n msg.payload later on in the process.\n\n\n"},{"id":"fb346caf.348eb","type":"api-call-service","z":"4cf772d4.c2341c","name":"","server":"4bbac141.a7708","service_domain":"homeassistant","service":"","data":"{\"entity_id\":\"nik_poz\"}","mergecontext":"","output_location":"","output_location_type":"none","x":151,"y":1028,"wires":[[]]},{"id":"a3bc5bfb.761128","type":"change","z":"4cf772d4.c2341c","name":"COLOR TO RGB VALUE","rules":[{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"red","fromt":"str","to":"{    \"0\": \"255\",    \"1\": \"0\",    \"2\": \"0\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"green","fromt":"str","to":"{    \"0\": \"0\",    \"1\": \"255\",    \"2\": \"0\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"blue","fromt":"str","to":"{    \"0\": \"0\",    \"1\": \"0\",    \"2\": \"255\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"violet","fromt":"str","to":"{    \"0\": \"208\",    \"1\": \"32\",    \"2\": \"144\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"deeppink","fromt":"str","to":"{    \"0\": \"205\",    \"1\": \"16\",    \"2\": \"118\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"orchid","fromt":"str","to":"{    \"0\": \"139\",    \"1\": \"71\",    \"2\": \"137\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"maroon","fromt":"str","to":"{    \"0\": \"128\",    \"1\": \"0\",    \"2\": \"128\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"darkpink","fromt":"str","to":"{    \"0\": \"178\",    \"1\": \"58\",    \"2\": \"238\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"turquoise","fromt":"str","to":"{    \"0\": \"0\",    \"1\": \"245\",    \"2\": \"255\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"cyan","fromt":"str","to":"{    \"0\": \"0\",    \"1\": \"139\",    \"2\": \"139\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"yellow","fromt":"str","to":"{    \"0\": \"238\",    \"1\": \"238\",    \"2\": \"0\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"gold","fromt":"str","to":"{    \"0\": \"205\",    \"1\": \"173\",    \"2\": \"0\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"orange","fromt":"str","to":"{    \"0\": \"255\",    \"1\": \"104\",    \"2\": \"3\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"chocolate","fromt":"str","to":"{    \"0\": \"139\",    \"1\": \"69\",    \"2\": \"19\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"fucshia","fromt":"str","to":"{    \"0\": \"255\",    \"1\": \"0\",    \"2\": \"255\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"firebrick","fromt":"str","to":"{    \"0\": \"178\",    \"1\": \"34\",    \"2\": \"34\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"light[object Object]","fromt":"str","to":"{    \"0\": \"69\",    \"1\": \"118\",    \"2\": \"255\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"navyblue","fromt":"str","to":"{    \"0\": \"0\",    \"1\": \"0\",    \"2\": \"128\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"pink","fromt":"str","to":"{    \"0\": \"255\",    \"1\": \"111\",    \"2\": \"180\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"raspberry","fromt":"str","to":"{    \"0\": \"238\",    \"1\": \"0\",    \"2\": \"238\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"indigo","fromt":"str","to":"{    \"0\": \"75\",    \"1\": \"0\",    \"2\": \"130\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"silver","fromt":"str","to":"{    \"0\": \"192\",    \"1\": \"192\",    \"2\": \"192\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"coral","fromt":"str","to":"{    \"0\": \"255\",    \"1\": \"106\",    \"2\": \"80\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"stateblue","fromt":"str","to":"{    \"0\": \"122\",    \"1\": \"103\",    \"2\": \"238\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"gray","fromt":"str","to":"{    \"0\": \"122\",    \"1\": \"122\",    \"2\": \"122\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"medium[object Object]","fromt":"str","to":"{    \"0\": \"0\",    \"1\": \"153\",    \"2\": \"255\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"sienna","fromt":"str","to":"{    \"0\": \"160\",    \"1\": \"82\",    \"2\": \"45\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"magenta","fromt":"str","to":"{    \"0\": \"139\",    \"1\": \"0\",    \"2\": \"139\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"dark[object Object]","fromt":"str","to":"{    \"0\": \"104\",    \"1\": \"39\",    \"2\": \"139\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"spring[object Object]","fromt":"str","to":"{    \"0\": \"13\",    \"1\": \"255\",    \"2\": \"34\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"purple","fromt":"str","to":"{    \"0\": \"125\",    \"1\": \"0\",    \"2\": \"255\"  }","tot":"json"},{"t":"change","p":"payload.slots[1].rawValue","pt":"msg","from":"white","fromt":"str","to":"{    \"0\": \"255\",    \"1\": \"255\",    \"2\": \"255\"  }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":185,"y":653,"wires":[["cba59926.8f5e98","8cb999c9.b424b8"]],"info":" In this node the names of the colors used in \nSnips console are replaced by rgb values.\n Use a rgb color list to help you get the values\nfor the colors you use in your assistant.\n If you use the application with the contained colors,\nthey are prety much preconfigured.You can alter the values \nto the coloration of your choice though.\nTo add an other color just add the name of the \ncolor in your assistant.In this node  \nadd the name and change it to rgb values of \nyour choice.\n Use the the preconfigured colors as your guide.\n\n "},{"id":"cba59926.8f5e98","type":"change","z":"4cf772d4.c2341c","name":"DATA MOVE","rules":[{"t":"set","p":"topic.data.rgb_color[0]","pt":"msg","to":"payload.slots[1].rawValue[\"0\"]","tot":"msg"},{"t":"set","p":"topic.data.rgb_color[1]","pt":"msg","to":"payload.slots[1].rawValue[\"1\"]","tot":"msg"},{"t":"set","p":"topic.data.rgb_color[2]","pt":"msg","to":"payload.slots[1].rawValue[\"2\"]","tot":"msg"},{"t":"set","p":"topic.data.entity_id","pt":"msg","to":"payload.slots[0].value.value","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":507,"y":652,"wires":[["9a725f2.b6c24a","71c551f2.54fbf"]],"info":"In this node the converted values are moved in the\ncorresponding fields in the format we created earlier in the \nmsg.topic.\n\nNothing to configure."},{"id":"8cb999c9.b424b8","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":360,"y":652,"wires":[]},{"id":"a4566dc6.f0469","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":632,"y":814,"wires":[]},{"id":"2d70180c.128098","type":"change","z":"4cf772d4.c2341c","name":"REPLACE   \"  \" , \"_\"","rules":[{"t":"change","p":"topic.data.entity_id","pt":"msg","from":" ","fromt":"str","to":"_","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":490,"y":813,"wires":[["a4566dc6.f0469","d7263f86.8f95e"]],"info":"In this node the \" \"  contained in the entity's name is\nreplaced by \"_\".\n\nUsually nothing to add in this configuration."},{"id":"71c551f2.54fbf","type":"function","z":"4cf772d4.c2341c","name":"\"light.\" ADDITION","func":"msg.topic.data.entity_id = ('light.') + msg.topic.data.entity_id;\nreturn msg;","outputs":1,"noerr":0,"x":811,"y":650,"wires":[["65d03a73.64eb54","c6a94347.18c6d"]],"info":"In this node we give to the entity the approriate\n\"light.\" addition that it needs.\n\nNothing to configure."},{"id":"65d03a73.64eb54","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":956,"y":650,"wires":[]},{"id":"d7263f86.8f95e","type":"change","z":"4cf772d4.c2341c","name":"FINAL RECONSTRUCTION STAGE","rules":[{"t":"set","p":"payload","pt":"msg","to":"topic","tot":"msg"},{"t":"set","p":"topic","pt":"msg","to":" ","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":866,"y":815,"wires":[["9e44cac3.494638","b2e0f600.7a7478"]],"info":" In this node we are ready to move the content of the\nmsg.topic to msg.payload and leave a blank msg.topic.\nWe are now ready to call the homeassistant turn_on\nservice."},{"id":"b2e0f600.7a7478","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1097,"y":815,"wires":[]},{"id":"c6a94347.18c6d","type":"change","z":"4cf772d4.c2341c","name":"\"group.\"  EXCEPTIONS","rules":[{"t":"change","p":"topic.data.entity_id","pt":"msg","from":"light.secret lights","fromt":"str","to":"group.secret lights","tot":"str"},{"t":"change","p":"topic.data.entity_id","pt":"msg","from":"light.tv secret lights","fromt":"str","to":"group.tv secret lights","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":145,"y":813,"wires":[["2d70180c.128098","3fa212ca.6a66de"]],"info":" In this node you will have to manually insert all \nlight entities that are grouped together\nas found in your homeassistant group.yaml.\n\n\n It is used to track group entities and change into \n\"group.\"  the \"light.\" addition they gained in the \nprevious node \nUse the given example as your guide to comfigure \nthis node. \n\nExample:\nIn this flow, there are two groups off dimmable\nlights. \"secret lights\" and \"tv secret lights\".\nWe replace the \"light.\" with \"group.\",\nby tracking their names.\nAdd the replacement for your group of light entities.\n\n\n\nNote:\n This node will look in the entity_id used in your \nsnips assistant and detect names that we like to function\nas light groups.\n Be sure that the names of the group entities you use\nmatch the names used in Home Assistant as well.\n Editing snips entity_id slot is also required to match\nthe exact spelling of the home assistant configuration.\n\n"},{"id":"c08be169.c4509","type":"switch","z":"4cf772d4.c2341c","name":"DUPLICATING THE INTENT MESSAGE","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":170,"y":461,"wires":[["532eedb7.d4d124","e81de0fd.5c2ce"]],"info":"In this node we are duplicating intent message,\nIn the second message we will add the values\nfor the second entity we want to control,if any.\nElse, we will delete the message later on, \ntracking it by a \"mistake\" we will do by intention.\n\nNothing to configure in this node."},{"id":"4831489c.dfa1d8","type":"switch","z":"4cf772d4.c2341c","name":"DUPLICATING THE INTENT MESSAGE","property":"payload","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":166,"y":503,"wires":[["6a373b68.3e9d94","e68704c9.74b5e8"]],"info":"In this node we are duplicating intent message,\nIn the second message we will add the values\nfor the second entity we want to control,if any.\nElse, we will delete the message later on, \ntracking it by a \"mistake\" we will do by intention.\n\nNothing to configure in this node."},{"id":"532eedb7.d4d124","type":"change","z":"4cf772d4.c2341c","name":"SETTING msg.topic TO \"1\"","rules":[{"t":"set","p":"topic","pt":"msg","to":"1","tot":"str"},{"t":"delete","p":"payload.sessionId","pt":"msg"},{"t":"delete","p":"payload.asrTokens","pt":"msg"},{"t":"delete","p":"payload.slots[2]","pt":"msg"},{"t":"delete","p":"payload.slots[3]","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":586,"y":463,"wires":[["a504feb7.21853","90ab8e08.57ab8"]],"info":"In this node we create seperate names for the messages\nin order to delete the extra values and leave each of\nmessages just with the values we care for.\n\nNothing to configure\n\nNote:\n After this process the messages should both contain\nno more data that the data needed. From now on the\nmessages will follow the same path for extracting\nthe data,so both messages should look similar. \n Bare that in mind if you find yourself \ninterested of addind a third message in this flow.\n\n\n"},{"id":"6a373b68.3e9d94","type":"change","z":"4cf772d4.c2341c","name":"SETTING msg.topic TO \"2\"","rules":[{"t":"set","p":"topic","pt":"msg","to":"2","tot":"str"},{"t":"delete","p":"payload.sessionId","pt":"msg"},{"t":"delete","p":"payload.asrTokens","pt":"msg"},{"t":"delete","p":"payload.slots[1]","pt":"msg"},{"t":"delete","p":"payload.slots[0]","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":505,"wires":[["a504feb7.21853","75d8e8f7.0e3e78"]],"info":"In this node we create seperate names for the messages\nin order to delete the extra values and leave each of\nmessages just with the values we care for.\n\nNothing to configure\n\nNote:\n After this process the messages should both contain\nno more data that the data needed. From now on the\nmessages will follow the same path for extracting\nthe data, so both messages should look similar. \n Bare that in mind if you find yourself \ninterested of addind a third message in this flow.\n\n\n"},{"id":"e81de0fd.5c2ce","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":389,"y":462,"wires":[]},{"id":"e68704c9.74b5e8","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":388,"y":504,"wires":[]},{"id":"75d8e8f7.0e3e78","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":766,"y":504,"wires":[]},{"id":"90ab8e08.57ab8","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":768,"y":461,"wires":[]},{"id":"b4951ea4.17807","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":1149,"y":480,"wires":[]},{"id":"efe22597.c96bd8","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":279,"y":330,"wires":[]},{"id":"3fa212ca.6a66de","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":320,"y":815,"wires":[]},{"id":"c0956221.e9e54","type":"comment","z":"4cf772d4.c2341c","name":"README","info":"In this node you will have to manually insert all \nlight entities that are grouped together\nas found in your homeassistant group.yaml\n\nIt is used to add \"group.\" instead of the\n\"light.\" addition, added in the previous node.\n\nIn this flow, there are two groups off dimmable\nlights. \"secret lights\" and \"tv secret lights\".\nWe replace the \"light.\" with \"group.\",\nby tracking their names.\n\nReconfigure yours to match the names of your light\ngroups as found in your group.yaml.","x":162,"y":789,"wires":[]},{"id":"9e44cac3.494638","type":"switch","z":"4cf772d4.c2341c","name":"ELAMINATING PATH","property":"payload.data.entity_id","propertyType":"msg","rules":[{"t":"eq","v":"light.light.kitchen_secret","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":139,"y":938,"wires":[["cf8f4d22.ee05c"],["52ee4406.f8e81c","fb346caf.348eb"]],"info":" This node is used to filter the incoming\nmessages.It is looking the none altered value in the\nentity_id field, that through the message\nreconstruction process stayed unedited and became\n\"light.light.kitchen_secret\".\nThis unedited area is the \"mistake\" we look for.\n\nA path is created for the elemination process of the \nsecond message, if the \"mistake\" is detected.\n\nNothing to configure."},{"id":"cf8f4d22.ee05c","type":"change","z":"4cf772d4.c2341c","name":"DELETE EXTRA MESSAGE","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"delete","p":"topic","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":588,"y":917,"wires":[["144ad277.afdbde"]],"info":"In this node is passed the unedited extra message \nand it is deleted.\n\nNothing to configure."},{"id":"52ee4406.f8e81c","type":"debug","z":"4cf772d4.c2341c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":339,"y":945,"wires":[]},{"id":"dff30e85.449ef","type":"comment","z":"4cf772d4.c2341c","name":"THE STEPS","info":"    Steps\n1)Track the intent.\n2)Convert the string into a javascript object.\n3)Duplicate the message.\n4)Set temporary topics for each message and delete extra\n  values.\n5)Start rebuilt process in msg.topic for each message.\n6)Convert the name of the colors to rgb values.\n7)Move values in msg.topic.\n8)Add the \"light.\" to the entity_id value.\n9)Change the \"light.\" to \"group.\" in order  \n  control a group of light entities.\n10)Replace the \" \" with \"_\" .\n11)Move to msg.payload the collected values.\n12)Delete the second message if only one entity's\n  color is commanded to changed.\n13)Trigger a homeassistant turn_on service.","x":185,"y":217,"wires":[]},{"id":"2001415b.18997e","type":"comment","z":"4cf772d4.c2341c","name":"DUAL ENTITY COLOR CONTROL","info":" A flow that handles color change commands.\nUp to two entities color can be changed in a singlecommand.\n\nUsing just two slots in snips assistant(color and entity).\nIt  will function if the command follow the pattern:\n Fisrt entity and desired color followed\nby the second entity and the desired color.\n\n Make sure the entity_id slot in snips assistant\ncontains the names of your home assistant light entities,\nas found in States tab.\n Synonyms will call the actual name of the slot value.\nSo slot value must match.\n\n\n ","x":148,"y":134,"wires":[]},{"id":"f2997e2.a825f8","type":"comment","z":"4cf772d4.c2341c","name":"Read the comments","info":" Read the comments to help you understand the steps\ninvolved.\n In each node, under Description tab, you will find \na brief node explanation.","x":167,"y":175,"wires":[]},{"id":"144ad277.afdbde","type":"debug","z":"4cf772d4.c2341c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":802,"y":918,"wires":[]},{"id":"1ffd6e0a.1c4ee2","type":"comment","z":"4cf772d4.c2341c","name":"README","info":"In the node below you can add the colors of your choice.\nRead the description tab within the node.","x":208,"y":630,"wires":[]},{"id":"e92d1794.a4b0d8","type":"mqtt-broker","z":"","name":"","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"4bbac141.a7708","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false}]

Flow Info

Created 6 years, 4 months ago
Updated 6 years, 2 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x9)
  • comment (x5)
  • debug (x15)
  • function (x1)
  • mqtt in (x1)
  • mqtt-broker (x1)
  • switch (x3)
  • yaml (x1)
Other

Tags

  • #homeassistant
  • #HomeAutomation
  • #HomeAssistant
  • #rgb-hass-entities
  • #RGB_Hass_entities
  • #rgb_control
  • #Snips.AI
  • #snips.ai
  • #snips
  • #Snips.ai
  • #color_control
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option