Hi,
I have a call service node which is fed a msg and I can extract the entity_id from that payload in the data using:
{
"entity_id": "{{payload.entity_id}}",
"option": "Faulted"
}
This works fine and the result is for example… “entity_id”: “binary_sensor.front_door”
What I would like to do is manipulate the payload.entity_id text coming from {{payload.entity_id}}. I’d like to replace the text ‘binary_sensor’ with ‘select’ (like a find and replace action) and append ‘_bypass_mode’ to the end of the text, so ‘binary_sensor.front_door’ becomes ‘select.front_door_bypass_mode’.
I can append the text at the end fine with the below giving me ‘binary_sensor.front_door_bypass_mode’, but how to do a replace/substitution properly on the string binary_sensor?
{
"entity_id": "{{payload.entity_id}}_bypass_mode",
"option": "Faulted"
}