Это видео недоступно.
Сожалеем об этом.

How to Turn On Lights with a Motion Sensor in NodeRED and Home Assistant

Поделиться
HTML-код
  • Опубликовано: 17 авг 2024
  • This video will teach you how to make a simple flow that will listen to your motion sensor, turn on any associated lights, and set an off timer that will be automatically re-set as long as motion is detected within a certain period of time.

Комментарии • 57

  • @robi2668
    @robi2668 2 года назад +1

    Amazing simple and explicit tutorial, would love to see more!!!!

  • @PatipanWongkleaw
    @PatipanWongkleaw 2 года назад +6

    You need to properly tune your volume, don't just edit with your headphones on at max volume

  • @darrenmunday4064
    @darrenmunday4064 3 года назад +8

    Thanks for getting me up and running with this. Now I must remember to turn my sound back down! Your vols are very low.

    • @thebleepbloop4547
      @thebleepbloop4547  3 года назад +2

      Sorry about that. Sometimes I have to record these late at night when the family is sleeping in a really chaotic remodeling situation ;).

  • @V0X4455
    @V0X4455 3 года назад

    Great walk through, exactly what I needed.

  • @quasimodo1427
    @quasimodo1427 3 года назад +2

    Please do more simple flows

  • @stu6533
    @stu6533 3 года назад

    This is excellent. Nice bit of logic there as well - very helpful :-)

  • @RandomGuy-lm8wh
    @RandomGuy-lm8wh 3 года назад +7

    Please make more of these simple examples.....
    Almost all videos I see are way too difficult for a beginner and have a lot of programming stuff in it.
    I like the way af using nodes instead of complex javascript files!
    Do you know if there is a easy way to dim or increase lights when a trigger is activated? I cant find a easy way.

    • @thebleepbloop4547
      @thebleepbloop4547  3 года назад

      As long as the light is dimmable. Use an events state node to watch a particular entity (as that will be your trigger.) When the state changes, a message will be sent through the flow. Connect the event state node to a call service node and simply set the brightness of the light. It's a bit trickier if you want to dim through some values, and sometimes choppy because of the capabilities of most LED bulbs. It's tough to get them to dim smoothly without adding some sort of loop to process the values from one to another.

  • @frankbecks218
    @frankbecks218 2 года назад

    Works great, thanks :)

  • @dirkselzer439
    @dirkselzer439 4 года назад +3

    thanks for the video :) the next time, please do it little bit louder ;)

  • @MaxGoddur
    @MaxGoddur 3 года назад

    Please continue to make videos these are probably the only videos I have found covering step-by-step examples using Home Assistant and Node-Red. I still don't understand how the flow in NR talks to the HA devices. I can understand how the ESPhome works due to having the upload feature but no idea how the code gets to the ESP device once the flow is written?

    • @thebleepbloop4547
      @thebleepbloop4547  3 года назад

      ESP devices simply become sensors or switches or lights. The Home Assistant nodes in NodeRED simply connect to the services that already exist in Home Assistant. So, if you have a motion sensor, and you used ESPHome to configure it and connect it to Home Assistant, then you can use the NodeRED Home Assistant nodes to listen to or trigger those entities. NodeRED doesn't send any code *to* the ESPHome device. NodeRED simply interfaces with Home Assistant much like you would if you were using the Home Assistant user interface. An example would be a basic light switch. In NodeRED, you use a Call Service node, point it to the light or switch you want to change, set whether it's to be turned on or off, and then use an inject node to test it. Whatever you add to the input of the service call will be what triggers NodeRED to send the "on" or "off" signal to Home Assistant through the call_service function.

    • @MaxGoddur
      @MaxGoddur 3 года назад

      @@thebleepbloop4547 if you ever decide to do a video using NR and HA and the Athom socket (my understanding of the Athom single gang receptacle is it is flashed with Tasmota) as it pertains to monitoring a washing machine and notifying it has completed I would be very interested and we could sip on a "buy you a cup of coffee" while we talk about the setup. I have tried to follow the many videos and instructions on how to do this but it appears the missing steps render the tutorials DIW.

  • @DegenWelle
    @DegenWelle 3 года назад +1

    Please. More videos. Also a flow who detect motion and don't turn off the lights while there is people in the room.

    • @jongriffith4293
      @jongriffith4293 3 года назад

      That's a tough one. You need a myriad of sensors to achieve true presence detection, and the algorithm you're creating for yourself could be a nightmare. If it's motion and people stop moving, it won't work. If it's devices and someone leaves their phone in another room, it won't work. If it sonic sensors and nobody is in the path of the sensor, or it's not a human in the path of the sensor, then it won't work.

    • @captain_loeffel
      @captain_loeffel 2 года назад

      @@jongriffith4293 There is under special circumstances a way to realize that. But therefor you need a room that is covered by a camera with person identification. I've seen a video somewhere, that shows a HACS Integration, that can identify if there is a person in the room or not. I think it can even count. In the new cameras from Unifi you have such thing integrated. They have "three" motion sensors. One for general motion, one when a person enters the camera view and one that reacts when a car enters the camera view.
      But I think any other way is hard to realize.

  • @danieljensen761
    @danieljensen761 3 года назад

    excellent video. great level of explanation. looking at you tabs in node. plenty of material to teach/explain :)

    • @jongriffith4293
      @jongriffith4293 3 года назад

      Agreed...if only I didn't have an 8 month-old wobbling around here.

  • @eddomak
    @eddomak 2 года назад

    Thanks for the video - it definitely helped me get started, and the logic is really helpful for checking additional conditions. In this particular case would it be more efficient to not even have the check for whether the light is already on and just always send a command to turn the light(s) on? This would still reset the timer each time prior to switching off.

    • @jongriffith4293
      @jongriffith4293 2 года назад

      It's not necessary, but in a mechanical automation, it might make sense to check the state of something before automating.

  • @mattb7406
    @mattb7406 3 года назад

    That was one of the coolest fricken things ever!

  • @pimmen85
    @pimmen85 3 года назад +3

    i cant get my motionsensors to continiusly detect motion like yours do, i have both a aeotec multisensor 6 and an aqara motion sensor.

    • @jongriffith4293
      @jongriffith4293 3 года назад

      Not sure what you mean by continuously detect. When I trigger a motion sensor, it switches off after a few seconds. So it's just a temporary binary on/off. I used the NodeMCU setup from BRUH Automation from a few years back to setup the device...so maybe there's something in that code that controls the timing on the sensor.

    • @jongriffith4293
      @jongriffith4293 3 года назад

      The motion sensors don't detect continuously. They're either tripped, or not. The one thing I don't have control over is how long they remain tripped. I think that's baked into this particular sensor.

  • @KrastyoKrastev
    @KrastyoKrastev 2 года назад

    Great video! Too bad you have stopped doing videos :(

  • @TheUnofficialMaker
    @TheUnofficialMaker 3 года назад +3

    can u crank up the audio

    • @jongriffith4293
      @jongriffith4293 3 года назад

      I can in the next ones I do. It was late and I was being quiet... ;).

    • @TheUnofficialMaker
      @TheUnofficialMaker 3 года назад

      @@jongriffith4293 found a volume up bookmarklet for browser to increase it, good video

  • @k5vg
    @k5vg 7 месяцев назад

    What's up with the extremely low recording sound level? This video might actually be useful if the sound were audible.

  • @n2ocharged
    @n2ocharged 2 года назад

    I know this video is a year and a half old, my motion sensors won't update the timer to reset it. What sensors are you using?

  • @Andre-xu3pq
    @Andre-xu3pq Месяц назад

    Events: State node is different now 😞
    i try to get this simpel, and step one with the debug i get no information. the witch works in MQTT is see the switch to move ..
    I this because the " Events: State node" is different now??

    • @jongriffith4293
      @jongriffith4293 Месяц назад

      It does look different now. The principle still applies. Make sure that the state that you're testing for matches the states that your device reports. In my case, the motion sensor reports 'on.' Other motion sensor I've had report "detected," etc.

  • @joos2033
    @joos2033 2 года назад

    What if, instead of a timer i want say to turn on and off the lights only in the moment of the day where there is no light outsite. It is possible ? do you have a video or explanation about how to do it ?

    • @jongriffith4293
      @jongriffith4293 2 года назад

      There is probably not going to be a time when there is no light at all. So, what you would need is a light sensor that can give you a value in HA. Then, create a flow that watches that sensor and allows the message to pass if the value of that sensor falls below the value you note when the light conditions are what you want them to be, and vice versa

  • @JoseBerruezo
    @JoseBerruezo 3 года назад

    Hello, how can I enable or disable this flow from the homeassistant? For example, with a switch, on homeassistant, I can enable or disable this flow .Thanks

    • @jongriffith4293
      @jongriffith4293 3 года назад

      Create an input boolean in HA, then in NodeRED add a switch to your flow that tests against it and stops the flow if it's TRUE.

    • @JoseBerruezo
      @JoseBerruezo 3 года назад

      @@jongriffith4293 Thank you

  • @Ellghee
    @Ellghee 3 года назад

    What is the advantage using your solution instead of using a trigger??

    • @jongriffith4293
      @jongriffith4293 3 года назад

      "Trigger" is subjective. NodeRED is a visual solution for those who aren't a fan of yaml. 6 of one, 1/2 dozen the other.

    • @Ellghee
      @Ellghee 3 года назад

      @@jongriffith4293 I'm not a programmer and my .yaml knowledge is limited to cut and paste. That is why I use node-red and I find the trigger node extremely simple to use, just open, set the time and click a check box if I need 2 outlets. Sorry your English is too complicated for me to understand.

    • @jongriffith4293
      @jongriffith4293 3 года назад +1

      @@Ellghee Ahh...I see. I believe the trigger-state node wasn't around when I originally made this automation. The trigger-state node does add some functionality that's not there on the State Change node. Thanks for the heads up.

  • @simonburke6681
    @simonburke6681 3 года назад

    I don't have sensor as an option under Home Assistant, any idea why?

    • @thebleepbloop4547
      @thebleepbloop4547  3 года назад +1

      There could be many reasons for this, but I would start by looking at your Home Assistant configuration.yaml file. You should define your sensors through this file, whether it's directly in this file, or by using an included file in a different sub-folder of your home assistant configuration.

  • @danielducu
    @danielducu 2 года назад

    Motion sensor cool down period not taken into account here … unexpected results when you revisit the room and nothing happens

    • @jongriffith4293
      @jongriffith4293 2 года назад

      The motion sensors I'm using trigger, then they reset in a matter of seconds. Hasn't been an issue.

  • @emaanrad1624
    @emaanrad1624 3 года назад

    hmm show me > > Home assistant connection failed with error: Connection to home assistant could not be established with config: localhost:8300

  • @constas559
    @constas559 3 года назад

    I can't hear anything

  • @PitFighter2007
    @PitFighter2007 2 года назад

    sound is very quiet...annoyingly so. good vid tho.

  • @Paullik83
    @Paullik83 2 года назад

    bad logic. this never works well.😆... How reset the timer if movement is acriv for more then 5 minits?

    • @jongriffith4293
      @jongriffith4293 2 года назад

      Motion sensor is a binary on/off with a built in timer, so there's no continuous motion detection. It would simply be repeated motion triggers, so you could easily create a flow that re-triggers the timer every time it senses motion and shut down the lights after 5 minutes have passed without motion detected.

  • @pauls8366
    @pauls8366 2 года назад

    Bad resolution, bad noise, I gave up after 30 seconds, but read the comments and give it a try more.