Comments about "My home automation projects built with MQTT and Node Red" topic

Something I have considered using all around my RV, like a trim… but not tried yet due to cost, is IR LED strips… the same type of rolls as typical RGB strips. The can be picked up in waterproof sheathing and ganged together to make what could look like faint reddish accent lighting all around a parameter, assuming they are even visible enough to see with the eye… I know some IR ranges are not that easy to see, but work well with cameras (the ones with adjustable IR cut filters). Whatever IR LEDS my BrightPi used (LITEON HSDL-4261) are near invisible to my eye unless I get up real close and personal, in the dark.

This should create broad enough lighting to illuminate, but not glare.

1 Like

For some other readers with possible tips for the available options I think it would be useful to define what you mean by visible light as this might be understood as visibly illuminating the area with reddish light. For instance the cheap ones I got do not emit light in a way you could see the light itself but the LED lights themselves can be clearly seen as an array for small red leds. I would doubt the neighbours minding or noticing them if directed in a suitable angle. Visible or not, you’d probably not want to point the lights at the neighbours direction anyway…

I think this is a bit of a twofold issue. On one hand you might want the cameras and lights to be as stealth as possible but on the other they might also act as a deterrent to give a hint the potential unwanted visitors are being monitored.

I don’t know the kind of environment your house in Spain. But if it’s the type my late grandparents owned, a villa in the rural area near a small town, you would probably rather want some kind of a deterrent rather than catching the burglars on video while trying to break in. My grandparents villa got robbed 3 times during the 10-20 years they lived there (but this was in the 80’s). After they got two guard dogs (which the neighbours took care of while they were visiting Finland during the summer when it was the hottest there) the place was not robbed again.

1 Like

Good point…

To clarify what I meant… most mass produced (AKA cheap) IR LEDS are in the Near-IR frequency range (850nm). They do have slight red glow, but not easily detected from a distance unless grouped in a bundle, particularly in total dark.

Having these on an otherwise hidden camera is not a desired trait but can somtimes be mitigated with a red filter… although degrading their effectiveness. However, these can possibly act as misdirection of the cameras true location when mounted as “external” light sources.

The quality (AKA expensive) IR LEDs are classified closer to the Mid-Far-IR range (940nm), and look basically off unless you are literally going eyeball to LED (not a good idea as they are still blasting your retina to some degree :eye: )

@ristomatti, thanks again - plenty of food for thought.
The property is in a built-up area, the Spanish equivalent of a housing estate. Most properties on the urbanisation are holiday homes, so are empty most of the time. I only know of one break-in in th roast 3 years, which was an opportunist burglary when a neighbour left a door open on a warm night.
It seems that holiday homes of this type are generally targeted when the owners are at home, as it’s money, jewellery and portable electronics that are the main things that are taken.

Electricity is expensive in Spain, and neighbours tend to want to be neighbourly by alerting one another if lights etc are left on accidentally when they go away. It’s a quiet area and not mich happens, so a light that burns unnecessarily can be quite an exciting event!
So, my ideal situation would be to have IR illumination where there is no red glow when you look directly at the light source from a distance of a few metres. Because of the layout of the property, the cost of buying IR lights and the cost of running them every night during darkeness; and the cost of setting-up a network of overlapping cameras, there will inevitably be some areas that aren’t covered. If the red glow of the IR lights can be seen in one area, but not another, then it’s a bit of a giveaway that there is no CCTV coverage in that area.

Next time I’m over there I’ll take a fresh look at possible CCTV and IR lighting locations and see if I can come up with a workable plan.

Thanks again,

Pete.

Sounds like a similar area as the neighbours were all Finnish also. But based on your description I guess the times have changed quite a bit during the last 30 years. These days nobody would leave small sized valuables to their holiday home and TV’s and such are not that valuable considering the effort of moving them around and then selling for a fraction of the price. Sneaky burglars have been replaced by shameless/desperate robbers.

Considering the above, indoor cameras might be something to consider. It’s much easier to get a sharp enough image of someone’s face (assuming unmasked) from a close by camera. I’ve noticed faces easily get over exposure with the bright floodlights and come out completely white. But I hope you will never need to go through this scenario.

Have you thought about having the IR lights triggered by a PIR (or those newer “microwave” sensors)? This way they would not bother the neighbours and would prevent planning ahead from which direction to attempt breaking in. Also you would realise you’ve been spotted when one comes on and would not know if there’d be another one in behind the corner. This would allow using cheaper options and make the power consumption a non issue.

Please share what you end up doing!

2 Likes

Hi Pete
I just started my Node-Red .

but I can’t get Alexa to work don’t Know why ?

Error: connect ECONNREFUSED 34.240.81.189:8883
port is 8883 not 1883

Yay! Another one comes over to the dark side :grinning:

I’ve not come across this before, but a bit of googling came up with this website in Japanese:

Google Chrome made quite a good job or translating most of it and it says:
“An error message may be outputted at deployment, but it is okay to ignore it (timing problem?).”

It then goes on to talk about “Confirm Connection”, but this is where it seems to get lost in translation, because phrases like “Alexa, with the living light” makes no sense as a command.

So, if this error occurs only when you hit the Deploy button, it may be okay to ignore it.
Have you tried an “Alexa, Discover Devices” command?
It should come back with “I’ve found Sonoff” and possibly some other stuff about enabling skills in the Alexa App, which you can ignore.

You can then try an “Alesa, Turn Sonoff On” command, at which point you should get a debug message like “TurnOnRequest”, which is what you’d expect.

If none of this works then maybe make sure you can ping 34.240.81.189 and check that your firewall (either on your Pi or Router) isn’t blocking port 8883.

Pete.

as you know I am new with PI I am asking if
there is a way to add or remove prog. like windows or to clean up because

the first time i installed node-red was not in a directory
sudo apt-get install nodered

second time I installed it in
cd $HOME/.node-red

pi@hassbian:~/.node-red $

HA sees my “sonoff” and I can control it from there
but with Alexa it is not discoverable even with port forwarding to 8883 or 1883
Thanks

HA

To be honest, the Pi operating system stuff is a bit of a mystery to me too.
I used @scargill’s ‘script’ to do the basic install:

This has the advantage of also installing a control panel on port 10000, which I find very handy.
After that, I use the Node-Red palette manager to do any additional contrib installs from the GUI interface rather than messing around with all the Linux command line stuff.

Maybe do a clean install using the script on another Micro SD card and see how that goes?

Pete.

Hi
you are still awake.:smile:
I found a solution and it is working now.
I did all setup from my phone and not from my PC (Add Device and Node-Red Skill)

strange I am getting a boolean message

10/30/2018, 3:17:35 AM xxxx msg.payload : boolean     true

10/30/2018, 3:17:43 AM xxxx msg.payload : boolean     false

also when i push the ON or the OFF Button it don’t latch like a switch but act like a PB

Yes, couldn’t sleep!

Glad it’s working now.
You’re right about the frue/false payload. If you change the Debug node to Complete Message you’ll see the TurnOnRequest stuff there. I think that if you’re just using a device as a switch then using the true/false output is fine. If you set the device up as a thermostat then you’ll get other values coming through depending on what you ask Alexa, so in those cases you need to see what type of response you’re processing.

The Blynk Switch widgets should work as normal. Are you testing to see if you’re getting a “1” or a “0” (strings not integers) in your processing of the payload data coming from the switch widget?

Pete.

1 Like

yes, every thing is OK now .
thanks

1 Like

Great, glad you’re starting to get somewhere.
It’s a bit of a steep learning curve to begin with, especially if like us you’re not that experienced with the quirks of the Pi, but worth sticking with in my opinion.
Give me a shout if I can help with other stuff. I’m still learning all the time so certainly don’t have all the answers, but I’ll help if I can.

Pete.

1 Like

how can I convert the RGB o/p from Blynk ws Zergba to HEX

msg : Object 
object
payload: array[3]
pin: "40"
hex: "#4d9800"
r: 77
g: 152
b: 0
rgb: "77;152;0"
 _msgid: "9edbe053.923fb"

from RGBW to HEX

color: "#4d980000"

Well, because the Hex value is already in the message from Blynk, but just not the payload, it’s easy to switch the Hex value across to the payload with a Change node…

Capture0

You could do it in a function as well…

msg.payload = msg.hex;
return msg;

Pete.

thanks Pete

Did you work-out the “00” on the end?
I’m not near a PC at the moment, but maybe msg.payload = msg.hex + “00”;

Or maybe single quotes like this ‘00’ ?

Pete.

As I know nothing about js I need your help for two functions.
Both functions should output this format for Magic Home to work.

 json
    {"on":  true,"brightness": 0,"color": "#0F0F0F00"}

it works OK with Inject Nodes.

the Convert Node HSV—>RGB is not working correctly
https://flows.nodered.org/node/node-red-contrib-color-convert

Here is my working code function from Arduino

  void HSV_to_RGB(float h, float s, float v, byte rgb[])
    {
      int i;
      float f,p,q,t;   //http://www.easyrgb.com/en/math.php
  
    h = constrain(h, 0.0, 360.0);
    s = constrain(s, 0.0, 100.0);
    v = constrain(v, 0.0, 100.0);
  
    s /= 100;
    v /= 100;
  
    if (s == 0) {
      // Achromatic (grey)
      rgb[0] = rgb[1] = rgb[2] = round(v*255);
      return;
    }

    h /= 60.0; 
    i = floor(h); // sector 0 to 5
    f = h - (float)i; // factorial part of h
    p = v * (1.0 - s);
    q = v * (1.0 - s * f);
    t = v * (1.0 - s * (1 - f));
  
    switch(i) {                //http://colorizer.org/
      case 0:
        rgb[0] = round(255*v);
        rgb[1] = round(255*t);
        rgb[2] = round(255*p);
        break;
      case 1:
        rgb[0] = round(255*q);
        rgb[1] = round(255*v);
        rgb[2] = round(255*p);
        break;
      case 2:
        rgb[0] = round(255*p);
        rgb[1] = round(255*v);
        rgb[2] = round(255*t);
        break;
      case 3:
        rgb[0] = round(255*p);
        rgb[1] = round(255*q);
        rgb[2] = round(255*v);
        break;
      case 4:
        rgb[0] = round(255*t);
        rgb[1] = round(255*p);
        rgb[2] = round(255*v);
        break;
      default: // case 5:
        rgb[0] = round(255*v);
        rgb[1] = round(255*p);
        rgb[2] = round(255*q);
      }
  }                   
//---------------------------------

the two functions are:

"zeRGBa to MagicHome"
"Alexa to MagicHome"

of course I am asking this if you can.
thanks again
Joe

Hmmm… a bit over my head I’m afraid!

I’m not near a PC now, but could have a look later, although it might take a while to get my head around it.

An alternative might be to look for people that have done this before. If found this Node-Red contrib for Magichome that seems to do what you’re looking for:

Do you fancy giving that a try and seeing how you get on with it?

Pete.

this is the node I am using for Magic Home (the blue one)

but there is no examples or help or youtube

any way take your time .

perhaps I can also ask help @scargill