Current state node not updating

Good day,

As the title says, I have a simple flow that uses the current state node, looking at an input boolean.

The current state node has completely stopped updating. I am likely missing something very simple, but I’m not quite sure what.

Can’t help you if you don’t show us the flow.

Here it is. I’m rather new at this so if anything more is needed let me know.

If you post the code and a picture it is more helpful. Go into Export > JSON > compact > copy to clipboard, and don’t forget to surround it in 3 backticks in the forum when you paste.

Something needs to trigger a flow to start, and the current state node does not - it only retrieves the current state when the flow is already triggered. I don’t know what your AC node is, but it probably doesn’t trigger the flow to start either. Then again, maybe it does because otherwise nothing I can see would ever start this flow running, and the debug node shows it has run. And you’re “restart when done” node is unknown too. It looks suspiciously like you’re going about this in the wrong way.

I expect you need an “events: state” or “trigger: state” node in there somewhere.

Here is the export:

[{"id":"bdc42d88b45f1da5","type":"tab","label":"Direction air clim","disabled":false,"info":"","env":[]},{"id":"ba374d7f58b8617a","type":"gree-hvac","z":"bdc42d88b45f1da5","name":"AC","device":"376a658758bc9f9d","interval":"1","debug":false,"x":190,"y":420,"wires":[["74c00259ae3ffa06"],["bce602c957dc8c09","74c00259ae3ffa06"]]},{"id":"5ff5cb57031c1594","type":"switch","z":"bdc42d88b45f1da5","name":"Topics","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"power","vt":"str"},{"t":"eq","v":"mode","vt":"str"},{"t":"eq","v":"swingVert","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":310,"y":180,"wires":[[],["cb9386537206ce80"],[]]},{"id":"bce602c957dc8c09","type":"split","z":"bdc42d88b45f1da5","name":"","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"topic","x":170,"y":180,"wires":[["5ff5cb57031c1594"]]},{"id":"74c00259ae3ffa06","type":"debug","z":"bdc42d88b45f1da5","name":"","active":true,"tosidebar":true,"console":true,"tostatus":true,"complete":"true","targetType":"full","statusVal":"payload","statusType":"auto","x":930,"y":320,"wires":[]},{"id":"1529dbd1046e6f14","type":"rbe","z":"bdc42d88b45f1da5","name":"","func":"rbe","gap":"","start":"","inout":"out","septopics":true,"property":"payload","topi":"topic","x":930,"y":180,"wires":[["74c00259ae3ffa06","ba374d7f58b8617a"]]},{"id":"31739003652b5041","type":"change","z":"bdc42d88b45f1da5","name":"Cool","rules":[{"t":"change","p":"topic","pt":"msg","from":"mode","fromt":"str","to":"swingVert","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"fixedTop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":140,"wires":[["1529dbd1046e6f14"]]},{"id":"cb9386537206ce80","type":"switch","z":"bdc42d88b45f1da5","name":"Run Modes","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"cool","vt":"str"},{"t":"eq","v":"dry","vt":"str"},{"t":"eq","v":"heat","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":490,"y":180,"wires":[["31739003652b5041"],["3c2a137dd09eed76"],["76a6079532260e37"]]},{"id":"3c2a137dd09eed76","type":"change","z":"bdc42d88b45f1da5","name":"Dry","rules":[{"t":"change","p":"topic","pt":"msg","from":"mode","fromt":"str","to":"swingVert","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"fixedTop","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":180,"wires":[["1529dbd1046e6f14"]]},{"id":"27293097b2bc5c82","type":"change","z":"bdc42d88b45f1da5","name":"Heat","rules":[{"t":"change","p":"topic","pt":"msg","from":"mode","fromt":"str","to":"swingVert","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"fixedBottom","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":280,"wires":[["1529dbd1046e6f14"]]},{"id":"5ca8c7d35df3527c","type":"complete","z":"bdc42d88b45f1da5","name":"Restart when done","scope":["1529dbd1046e6f14","76a6079532260e37"],"uncaught":false,"x":470,"y":440,"wires":[["398628be2ea31c3e"]]},{"id":"398628be2ea31c3e","type":"debug","z":"bdc42d88b45f1da5","name":"Complete node","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":740,"y":440,"wires":[]},{"id":"76a6079532260e37","type":"api-current-state","z":"bdc42d88b45f1da5","name":"Présence Cuisine","server":"3f46ed9cdd92ba91","version":3,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_boolean.presence_salle_a_manger","state_type":"str","blockInputOverrides":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"payload","valueType":"jsonata"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":430,"y":260,"wires":[["49d400eb2e6fadb6"],["27293097b2bc5c82"]]},{"id":"49d400eb2e6fadb6","type":"change","z":"bdc42d88b45f1da5","name":"Heat","rules":[{"t":"change","p":"topic","pt":"msg","from":"mode","fromt":"str","to":"swingVert","tot":"str"},{"t":"set","p":"payload","pt":"msg","to":"fixedMid","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":240,"wires":[["1529dbd1046e6f14"]]},{"id":"376a658758bc9f9d","type":"gree-hvac-config","name":"Salon","host":"192.168.20.120"},{"id":"3f46ed9cdd92ba91","type":"server","name":"Home Assistant","version":5,"addon":false,"rejectUnauthorizedCerts":false,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":true,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

Présence cuisine is a motion sensor. I want the vertical swing to change according to the presence or not of someone in that room, only in heat mode.

The flow itself works, but it needs the AC to do something for it to check the state.

The AC is a gree minisplit that I control with HA, but fixed vertical swing positions are not available in the native HA component else I wouldn’t bother with node-red for this.

I’ve tried using other nodes such as event state but what happens is that the message no longer works when I do this. It strips everything and only keeps the change in my heat nodes.

Ideally I’d like the state change from the input boolean to start the flow without messing up the message payload.

The flow itself works, but it needs the AC to do something for it to check the state.

I think this is the problem. The only node that will trigger this flow is when AC changes. And if this is what you want:

vertical swing to change according to the presence

Then you should also use an “events: state” node to detect that the state of presence has changed and adjust the swing accordingly. However it’s not clear what you mean by this:

It strips everything and only keeps the change in my heat nodes

I’m guessing what you mean is that if the flow starts in any other way it doesn’t know the current AC mode. That node is very weirdly written - normally you’d expect one node to set the value and another that triggers on a state change. Given it doesn’t have a means of reading the current mode, you’d need to store the mode in (for example) flow context to be used later when the presence changes.

However, in Googling that very strange node, I saw somebody has fixed the underlying problem with a HACS addon - Gree Extension for Home-Assistant. That might be a better way to go.

I think I understand what they mean by strip. As @michaelblight said this is a weird node. It seems to loop to itself. I’m assuming the current state “strips” the original payload and swaps it with the presence entity state.

@snaky69 in the current state node, towards the bottom, change the output setting to the following.

image