How can I get an entity ‘parent’ or ‘group’ in node-red.
Example. I’ve a ‘states node’ with regex _adjust$
that captures a lot of entities. Next step I would like to lookup what ‘group’ it’s attached to (e.g. livingroom, bedroom).
Looking at the data there’s something called parent_id
. Can I set that value somehow in HA?
{
"topic": "input_number.bedroom_light1_adjust",
"payload": 73,
"data": {
"entity_id": "input_number.bedroom_light1_adjust",
"old_state": {
"entity_id": "input_number.bedroom_light1_adjust",
"state": 28,
"attributes": {
"initial": null,
"editable": true,
"min": 0,
"max": 100,
"step": 1,
"mode": "slider",
"unit_of_measurement": "%",
"friendly_name": "Sänglampa Test"
},
"last_changed": "2020-10-24T15:04:00.445742+00:00",
"last_updated": "2020-10-24T15:04:00.445742+00:00",
"context": {
"id": "25ca5e50160a11eb9eb85fcead666a97",
"parent_id": null,
"user_id": "69df44825150485e896ba4e8cc8af97e"
},
"original_state": "28.0"
},
"new_state": {
"entity_id": "input_number.bedroom_light1_adjust",
"state": 73,
"attributes": {
"initial": null,
"editable": true,
"min": 0,
"max": 100,
"step": 1,
"mode": "slider",
"unit_of_measurement": "%",
"friendly_name": "Sänglampa Test"
},
"last_changed": "2020-10-24T15:04:36.885194+00:00",
"last_updated": "2020-10-24T15:04:36.885194+00:00",
"context": {
"id": "3b8296ff160a11eb8ae4c7b2ebc22777",
"parent_id": null,
"user_id": "69df44825150485e896ba4e8cc8af97e"
},
"original_state": "73.0",
"timeSinceChangedMs": 15
}
},
"_msgid": "c3e9465.462d8b8"
}