Node Red : Edit : Trigger : state node

Trigger : state node output (among other thing ) topic, being populated by the entity_id. I would like to set up topic with another value.

In the configuration of this node, there is a “custom outputs” section, however I cannot figure out how to set a new value to topic.
Can anyone help me or direct me where I can find information how to set this “custom output”.
I know that I can attach a (function) node at the end of of the (trigger: state node) and change the value of topic easily. However, I would prefer to change it within (trigger: state node)

Hey I don’t know if it’s helpful but I played around with this and here is what I came up with… the problem is that it is a separate output, and I think you’re looking for the original output’s topic to be changed… I think you may have no choice but to use a separate function node to either set the topic to what you want or use the method below and have a function node combine the topic sent from the state node custom output with the original msg object…

custom msg = {"topic":"TOPIC_SET_TO_THIS_TEXT"}

[{"id":"aaa2def4.d4c5c","type":"trigger-state","z":"1ce2dbec.424954","name":"BinarySensor","server":"b2dc7545.2e5d78","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"binary_sensor.bathroom_motion_sensor_occupancy","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"off","propertyValue":"new_state.state"}],"outputs":3,"customoutputs":[{"messageType":"custom","messageValue":"{\"topic\":\"TOPIC_SET_TO_THIS_TEXT\"}","messageValueType":"json","comparatorPropertyType":"always","comparatorType":"is","comparatorValue":"","comparatorValueDataType":"str","comparatorPropertyValue":""}],"outputinitially":true,"state_type":"str","x":120,"y":260,"wires":[["956bc084.fea198"],["337f2c92.61ed3c"],["23a7e54c.5c84ba"]]},{"id":"337f2c92.61ed3c","type":"debug","z":"1ce2dbec.424954","name":"blocked","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":480,"y":280,"wires":[]},{"id":"23a7e54c.5c84ba","type":"debug","z":"1ce2dbec.424954","name":"custom","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":480,"y":320,"wires":[]},{"id":"956bc084.fea198","type":"debug","z":"1ce2dbec.424954","name":"allowed","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":480,"y":240,"wires":[]},{"id":"b2dc7545.2e5d78","type":"server","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

Thank you. I came to the same conclusion: use a separate function.

How about just using a change node? You can customize the topic like this:

Thank you for your replay. This is exactly what I did.