QA on my first Node Red flow

Hi community! Thanks for being so great :smile:

I have just started with home automation, and have moved into Node Red.

Im struggling with this flow that suddenly it simply doesnt turn on the lights.

[{“id”:“549b8ea4.5052e”,“type”:“server-state-changed”,“z”:“75be098d.df4428”,“name”:“Motion?”,“server”:“c7e5594f.ff7148”,“entityidfilter”:“group.livingroom_motion”,“entityidfiltertype”:“exact”,“outputinitially”:false,“state_type”:“str”,“haltifstate”:"",“halt_if_type”:"",“halt_if_compare”:“is”,“outputs”:1,“output_only_on_state_change”:false,“x”:70,“y”:100,“wires”:[[“e39136b2.bcc0c8”]]},{“id”:“c7e5594f.ff7148”,“type”:“server”,“z”:"",“name”:“Home Assistant”,“legacy”:false,“hassio”:true,“rejectUnauthorizedCerts”:true,“ha_boolean”:“y|yes|true|on|home|open”,“connectionDelay”:true}]

Basically what I want to do is that I have two motion sensor, one at each part of my livingroom.
if I sit to silent in the couch, it will not detect us so thats why I introduced to check the status of the tv as well.

Is this done in an efficient way or do you have any pointers for me?

Welcome to HA mate. That is a very busy flow you have there and it will take me a while to work through it. I suggest you start by trying to make it as simple as possible:

  • Remove all debugging outputs - you can put them back in later or as needed
  • Re-layout the nodes - it looks like an aerial view of an Italian’s dinner 8)
  • Consider being a bit more verbose on your node labels.
  • Consider adding some comment nodes (the white ones)

[EDIT]: Use code tags and please make sure that your code is usable! I get syntax errors in NR from your code. Could you export the whole flow and attach to your post - you may need to make a few postings to be able to attach. Also you need to set a “safe” extension for your file eg .xml

Cheers
Jon