I forgot to share Node Red flow, just in case yo need it:
[{"id":"8d5644fa.b4b938","type":"server-state-changed","z":"64c31825.2bb9f","name":"Sensor entrada","server":"f7110cd.9a9c9f","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.sensor_entrada_movimiento","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"x":140,"y":460,"wires":[["f9fed3f2.c89fb8","3c400ae8.1c9fa6"],[]]},{"id":"f9fed3f2.c89fb8","type":"stoptimer","z":"64c31825.2bb9f","duration":"5","units":"Second","payloadtype":"num","payloadval":"0","name":"","x":320,"y":460,"wires":[["d68441a1.498688"],[]]},{"id":"d68441a1.498688","type":"ha-api","z":"64c31825.2bb9f","name":"","server":"f7110cd.9a9c9f","debugenabled":false,"protocol":"http","method":"post","path":"states/binary_sensor.sensor_entrada_movimiento","data":"{\"state\":\"off\"}","dataType":"json","location":"payload","locationType":"msg","responseType":"json","x":470,"y":460,"wires":[["6c8994d1.03f574"]]},{"id":"f7110cd.9a9c9f","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]