Re-send input_text from a node

Hi,

I have this automation for my vacuum that runs based on inputs that allows you to either selects a time from a drop down or to input one manually. The problem I’m having is that when a time is selected and then you choose manual time that it doesn’t send that time through, unless you change it in the input text on dashboard. Is there anyway I could get the “Manual Input” trigger node to resend its data?

Thanks,

Screenshot (12)

[{"id":"3f72f382d7ce085a","type":"api-call-service","z":"3853876227abae5f","name":"App Notification - Start Vacuum","server":"fcbb557.4bc97a8","version":3,"debugenabled":false,"service_domain":"notify","service":"mobile_app_sonny_s_iphone_12_pro_max","entityId":"","data":"{\"message\":\"Do you want to start the vacuum?\",\"title\":\"Start the vacuum\",\"data\":{\"actions\":[{\"action\":\"vac_yes\",\"title\":\"Yes\"},{\"action\":\"vac_no\",\"title\":\"No\"}]}}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1170,"y":360,"wires":[[]]},{"id":"8ae14de9c0d1c7fe","type":"api-current-state","z":"3853876227abae5f","name":"Home?","server":"fcbb557.4bc97a8","version":2,"outputs":2,"halt_if":"home","halt_if_type":"str","halt_if_compare":"is","entity_id":"person.xalies","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"x":900,"y":300,"wires":[["13320048d576bf8f"],["3f72f382d7ce085a"]]},{"id":"2f66a5ea3afb8ca8","type":"schedex","z":"3853876227abae5f","name":"Time","passthroughunhandled":false,"suspended":false,"lat":"-32.82752","lon":"151.35598","ontime":"","ontopic":"","onpayload":"on","onoffset":0,"onrandomoffset":0,"offtime":"","offtopic":"","offpayload":"","offoffset":"","offrandomoffset":0,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"sun":true,"x":750,"y":320,"wires":[["8ae14de9c0d1c7fe"]]},{"id":"13320048d576bf8f","type":"api-call-service","z":"3853876227abae5f","name":"Alexa Actionable Notification - Start Vacuum","server":"fcbb557.4bc97a8","version":3,"debugenabled":false,"service_domain":"script","service":"activate_alexa_actionable_notification","entityId":"actionable_notification_vacuum","data":"{\"text\":\"Would you like me to start vacuum cleaning?\",\"event_id\":\"actionable_notification_vacuum\",\"alexa_device\":\"media_player.living_room_echo_plus\"}","dataType":"json","mergecontext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1190,"y":300,"wires":[[]]},{"id":"d1facddc4f023fe5","type":"function","z":"3853876227abae5f","name":"set time - offset","func":"varAlarmTime = msg.payload;\nmsg.payload = {};\nmsg.payload.ontime = varAlarmTime\nmsg.payload.offtime = varAlarmTime\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":600,"y":300,"wires":[["2f66a5ea3afb8ca8"]]},{"id":"3709c43ce61fb35b","type":"trigger-state","z":"3853876227abae5f","name":"Selected Time","server":"fcbb557.4bc97a8","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_select.cleaning_time","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is_not","comparatorValueDatatype":"str","comparatorValue":"Manual Time","propertyValue":"new_state.state"}],"outputs":3,"customoutputs":[{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorType":"is","comparatorValue":"Manual Time","comparatorValueDataType":"str","comparatorPropertyValue":"new_state.state"}],"outputinitially":true,"state_type":"str","x":380,"y":320,"wires":[["d1facddc4f023fe5"],[],["e8e8291a13847211"]]},{"id":"e8e8291a13847211","type":"trigger-state","z":"3853876227abae5f","name":"Manual Input","server":"fcbb557.4bc97a8","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_text.cleaning_time","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"entity_id","targetValue":"input_select.cleaning_time","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"Manual Time","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":true,"state_type":"str","x":590,"y":360,"wires":[["d1facddc4f023fe5"],[]]},{"id":"82da0fb208f9f9e1","type":"trigger-state","z":"3853876227abae5f","name":"Cleaning Mode - Semi-Auto","server":"fcbb557.4bc97a8","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_select.cleaning_mode","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"Semi-Auto","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":true,"state_type":"str","x":160,"y":320,"wires":[["3709c43ce61fb35b"],[]]},{"id":"fcbb557.4bc97a8","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

The description of the trigger state node says:

Input
Enable / Disable
If incoming payload or message is a string and equal to enable or disable then set the node accordingly. Saves over restarts.

I guess you want to get the value of input_text.cleaning_time when Selected Time sends a message to Manual Input?
Trigger state Nodes only output, if the entity configured inside them changes. The input of a trigger_state can only be used to enable/disable the node.

In this flow

  • the preprogrammed time gets set if you select it via dropdown
  • the manual time gets set if you select manual from dropdown
  • the manual time gets set if you change it and the dropdown is set to manual
[{"id":"6590a9c53cda4935","type":"trigger-state","z":"cc639dbb.119d5","name":"Selected Time","server":"fcbb557.4bc97a8","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_select.cleaning_time","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"this_entity","targetValue":"","propertyType":"current_state","comparatorType":"is_not","comparatorValueDatatype":"str","comparatorValue":"Manual Time","propertyValue":"new_state.state"}],"outputs":3,"customoutputs":[{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorType":"is","comparatorValue":"Manual Time","comparatorValueDataType":"str","comparatorPropertyValue":"new_state.state"}],"outputinitially":true,"state_type":"str","x":360,"y":2300,"wires":[["eadf70aed64bc70c"],[],["2eb26f92c3a40a0a"]]},{"id":"3e93950c249a4e35","type":"trigger-state","z":"cc639dbb.119d5","name":"Manual Input","server":"fcbb557.4bc97a8","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_text.cleaning_time","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"entity_id","targetValue":"input_select.cleaning_time","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"Manual Time","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":true,"state_type":"str","x":350,"y":2180,"wires":[["eadf70aed64bc70c"],[]]},{"id":"2eb26f92c3a40a0a","type":"api-current-state","z":"cc639dbb.119d5","name":"get manual cleaning time","server":"fcbb557.4bc97a8","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_text.cleaning_time","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":550,"y":2420,"wires":[["eadf70aed64bc70c"]]},{"id":"eadf70aed64bc70c","type":"change","z":"cc639dbb.119d5","name":"set time - offset","rules":[{"t":"set","p":"payload.ontime","pt":"msg","to":"payload","tot":"msg"},{"t":"set","p":"payload.offtime","pt":"msg","to":"payload","tot":"msg"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":2180,"wires":[[]]},{"id":"fcbb557.4bc97a8","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]

I don’t know what the semi-auto node should do but you may change that as well

Thanks anyway but it didn’t work it just wont pass the manual time that’s already there. Both the trigger node and get state nodes do read the existing time but wont give an output, I get nothing from the debug node… until I change the time from the HA dash and then it updates in node red and gives an output

This should be an easily solvable problem. If I understood you correctly, the problem is:

  1. you set a manual time via input_text, while dropdown is set to manual (node outputs correctly)
  2. you set a time vie dropdown (also outputs correctly)
  3. in the dropdown, you change to manual again (manual input_text time does not output) ← problem

Am I correct?

Yep that’s right.

OK, so the problem was that if the condition of a trigger state isn’t true, it only outputs on the blocked output. I had to delete the condition and add two extra outputs, one for "is not Manual Time" and one for "is Manual Time".

[{"id":"f77b7def836ac04a","type":"api-current-state","z":"cc639dbb.119d5","name":"get manual cleaning time","server":"44b2605f.5d41","version":2,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_text.cleaning_time","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":390,"y":2680,"wires":[["d1facddc4f023fe5"]]},{"id":"d1facddc4f023fe5","type":"function","z":"cc639dbb.119d5","name":"set time - offset","func":"varAlarmTime = msg.payload;\nmsg.payload = {};\nmsg.payload.ontime = varAlarmTime\nmsg.payload.offtime = varAlarmTime\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":640,"y":2620,"wires":[["a965966e3653f250"]]},{"id":"b30b5e7bc1a8664a","type":"trigger-state","z":"cc639dbb.119d5","name":"Selected Time","server":"44b2605f.5d41","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_select.cleaning_time","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"outputs":4,"customoutputs":[{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorType":"is_not","comparatorValue":"Manual Time","comparatorValueDataType":"str","comparatorPropertyValue":"new_state.state"},{"messageType":"default","messageValue":"","messageValueType":"json","comparatorPropertyType":"current_state","comparatorType":"is","comparatorValue":"Manual Time","comparatorValueDataType":"str","comparatorPropertyValue":"new_state.state"}],"outputinitially":false,"state_type":"str","x":120,"y":2620,"wires":[[],[],["d1facddc4f023fe5"],["f77b7def836ac04a"]]},{"id":"d6b128563844f78e","type":"trigger-state","z":"cc639dbb.119d5","name":"Manual Time","server":"44b2605f.5d41","version":0,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"input_text.cleaning_time","entityidfiltertype":"exact","debugenabled":false,"constraints":[{"targetType":"entity_id","targetValue":"input_select.cleaning_time","propertyType":"current_state","comparatorType":"is","comparatorValueDatatype":"str","comparatorValue":"Manual Time","propertyValue":"new_state.state"}],"outputs":2,"customoutputs":[],"outputinitially":false,"state_type":"str","x":110,"y":2540,"wires":[["d1facddc4f023fe5"],[]]},{"id":"44b2605f.5d41","type":"server","name":"Home Assistant","version":1,"legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"on","connectionDelay":false,"cacheJson":false}]

Thank you that did the trick :partying_face: