Soluçao para "conflito" de um node com outro

Boas,

Existe maneira de conseguir com que quando o esp8266 execute o script, faça parar o delay do motion?
Isto assim a funcionar causa-me problemas. Quando o motion passar novamente para o estado “off” e estiver no delay, se o esp8266 der sinal e o delay do motion tiver a terminar já não consigo ver o popup da camera :thinking:

Deixo foto do node para ser mais facil de perceber:

Mete um change node a fazer reset ao contador de delay ou aumenta o tempo de delay.

image

E eu a pensar que seria uma coisa dificil :hushed:
Esse change node faz muita falta. Com delay grande nao ficava muito bem. Agora sim :ok_hand:

1 Curtiu

Ainda bem que funcionou. Se puderes/quiseres coloca aqui o flow, para o caso de alguém querer utilizar ou ver como funciona.

1 Curtiu

Complicamos sempre o que é facil.

Deixo aqui o exemplo a cima:

[{"id":"4ca9ad8e.b886a4","type":"api-call-service","z":"b9a2d7e0.a7f1c8","name":"sleep_tablet_100_template","server":"","version":1,"debugenabled":false,"service_domain":"script","service":"sleep_tablet_100_template","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1000,"y":820,"wires":[[]]},{"id":"92884b85.a59398","type":"comment","z":"b9a2d7e0.a7f1c8","name":"screensaver clock","info":"","x":970,"y":780,"wires":[]},{"id":"bde3ead7.6308a8","type":"api-current-state","z":"b9a2d7e0.a7f1c8","name":"motionl on?","server":"","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"binary_sensor.tablet","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":770,"y":820,"wires":[[],["4ca9ad8e.b886a4"]]},{"id":"7df04c82.772894","type":"delay","z":"b9a2d7e0.a7f1c8","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":320,"y":880,"wires":[["bde3ead7.6308a8"]]},{"id":"17593dee.30ba72","type":"switch","z":"b9a2d7e0.a7f1c8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":760,"wires":[["594ff1e9.f9683"],["7df04c82.772894"]]},{"id":"3155b632.c011aa","type":"server-state-changed","z":"b9a2d7e0.a7f1c8","name":"motion_kiosk","server":"","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.tablet","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":90,"y":760,"wires":[["17593dee.30ba72"]]},{"id":"2544c6bb.67b43a","type":"api-call-service","z":"b9a2d7e0.a7f1c8","name":"tocar_campainha","server":"","version":1,"debugenabled":false,"service_domain":"media_player","service":"play_media","entityId":"media_player.tablet","data":"{\"media_content_id\":\"/local/audio/tocar_campainha.mp3\",\"media_content_type\":\"music\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":170,"y":560,"wires":[[]]},{"id":"594ff1e9.f9683","type":"api-call-service","z":"b9a2d7e0.a7f1c8","name":"","server":"","version":1,"debugenabled":false,"service_domain":"script","service":"wake_tablet","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":520,"y":620,"wires":[["e310a620.0b41a8"]]},{"id":"e310a620.0b41a8","type":"change","z":"b9a2d7e0.a7f1c8","name":"RESET","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":580,"wires":[["7df04c82.772894"]]},{"id":"5c94f73c.5eb058","type":"delay","z":"b9a2d7e0.a7f1c8","name":"","pauseType":"delay","timeout":"30","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":880,"y":500,"wires":[["bde3ead7.6308a8"]]},{"id":"a2f504cc.14c7d8","type":"api-call-service","z":"b9a2d7e0.a7f1c8","name":"browser_nav_home_reload_wake,","server":"","version":1,"debugenabled":false,"service_domain":"script","service":"browser_nav_home_reload_wake","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":600,"y":520,"wires":[["5c94f73c.5eb058","e310a620.0b41a8"]]},{"id":"7d0eec0d.dc77a4","type":"delay","z":"b9a2d7e0.a7f1c8","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"minutes","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":740,"y":340,"wires":[["a2f504cc.14c7d8"]]},{"id":"93a0f776.9d8678","type":"api-call-service","z":"b9a2d7e0.a7f1c8","name":"nav_cameras_acordar_first","server":"","version":1,"debugenabled":false,"service_domain":"script","service":"nav_cameras_acordar_first","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":520,"y":320,"wires":[["7d0eec0d.dc77a4"]]},{"id":"cf79eabe.9ae408","type":"api-call-service","z":"b9a2d7e0.a7f1c8","name":"start_camera_frente_acordar_first","server":"","version":1,"debugenabled":false,"service_domain":"script","service":"start_camera_frente_acordar_first","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":500,"y":360,"wires":[["7d0eec0d.dc77a4"]]},{"id":"63a04b53.f3f714","type":"switch","z":"b9a2d7e0.a7f1c8","name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"on","vt":"str"},{"t":"eq","v":"off","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":230,"y":360,"wires":[[],["2544c6bb.67b43a","cf79eabe.9ae408"]]},{"id":"cc6370fd.6fd02","type":"comment","z":"b9a2d7e0.a7f1c8","name":"esp8266 acorda camera frente","info":"","x":150,"y":300,"wires":[]},{"id":"b9456d41.2c36b","type":"server-state-changed","z":"b9a2d7e0.a7f1c8","name":"esp8266","server":"","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.sensor_contact","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":true,"x":80,"y":360,"wires":[["63a04b53.f3f714"]]},{"id":"91691368.50f5e","type":"comment","z":"b9a2d7e0.a7f1c8","name":"Motion","info":"","x":70,"y":720,"wires":[]}]
1 Curtiu

Copyright © 2017-2021. Todos os direitos reservados
CPHA.pt - info@cpha.pt


FAQ | Termos de Serviço/Regras | Política de Privacidade