BRUH DIY Multisensor


#547

I’ve heard they’re a bitch to get working how the way you want them.


#548

I use both Z Wave and a couple of BRUH sensors - amazing stuff from @bruhautomation . They each have their own advantages depending on where you want to deploy them.

If you have somewhere that has a power point handy, then the BRUH sensors are better as they report instantly and very reliably over MQTT and WiFi, if you need to place the sensor somewhere without a close by power-source, then a Z Wave sensor is a better option.


#549

Thanks. I’m more interested in reliability, so it sounds like the BRUH sensor is the way to go.

Has anyone mounted a BRUH sensor in a blank wall plate with cutouts for PIR, light, temp? Seems like you could cram everything into a low voltage box.


#550

It would definitely fit, I used a modified version that uses LiPo batteries so I can place the sensors anywhere I like and charge them once every few months.


#551

Cool. What sort of battery life do you get, and do you have any more details on your setup?

Thanks.


#552

It’s been 4-5 months and the sensor in my Master bedroom is sitting at 55%.

I am using an Adafruit Feather M0 RFM69HCW Packet Radio - 868 or 915 MHz with one of their Lithium Ion Polymer Battery - 3.7v 1200mAh.

I then have the DHT22 and the PIR connected and use the MySensors libraries to communicate with HASS.
I left off the LUX sensor since it’s 5V and didn’t feel like connecting a 3V -> 5V booster just for a single sensor.

Inserted into custom PCB:

3D Printed self designed enclosure:


#553

what do you use as a gateway to go from the 915 (or 868) MHZ to network (to get to MySensors)?


#554

I used an Arduino Uno with a W5100 Ethernet shield.

I used the Adafruit RFM69HCW Transceiver Radio Breakout - 868 or 915 MHz - RadioFruit connected to the Uno (since it has built in level shifters) with the W5100 shield. Works like a charm.


#555

Hey there,

This is my first attempt at making anything electrical and my first attempt at coding.
Everything seems to go swimmingly but my Hassio doesn’t want to boot after I edited the configuration.yaml file.
If i go into the SSH logs i get the following error:

2017-12-11 19:42:12 ERROR (SyncWorker_0) [homeassistant.util.yaml] mapping values are not allowed here
in “/config/configuration.yaml”, line 29, column 60
2017-12-11 19:42:12 ERROR (MainThread) [homeassistant.bootstrap] Error loading /config/configuration.yaml: mapping values are not allowed here
in “/config/configuration.yaml”, line 29, column 60

Would someone be able to take a look through my configuration file and see where I went wrong? Help would be greatly appreciated.


#556

I fitted my multisensor in a bit different 3d print :joy:


#557

Sounds like you have a bad space or colon or something in your yaml file around line 29.


#558

Would i be expecting too much to ask if you can take a look at my configuration file?


#559

Post the relevant section here and we’ll all take a look.


#560

I did some googling because and I seem to have sorted out the issue. But now only the SN1 LED is showing up in my dashboard, also the light seems to be flickering.


#561

Sorry guys, I came right. It happens when you just copy and paste without pasting it in the right place.
But like I said, it’s my first time and ill hopefully get better at this.


#562

I bought a cheap motion sensor from eBay / AliExpress tipped out all the electronics and replaced them with the multi sensor… pretty much a perfect size. Not sure how well the sensors will work but I’ll give it a go…


#563

Probably an easy one for you guys - but can you add more than one of the same sensor?

I’m wanting to add multiple PIR sensors so would you just define all the sensors in the PIN DEFINITIONS section of the code? Then how would you differentiate between the different sensors in config.yaml?

Similarly I also want to add multiple LEDS on a different sensor board to make a “who’s home board” 1 LED per person on a board, and depending on if they’re home or not it is either green or red.

Thanks in advanced!


#564

You can add more of the same sensors, but the code has to be changed.
You need to define the pin, then duplicate “root[“motion”] = (String)motionStatus;” changing root[“motion”] to root[“motion1”], root[“motion2”] etc and also duplicate “//PIR CODE” part for each sensor.

Then on Home Assistant config at the value_template or each PIR sensor use: ‘{{ value_json.motion1 }}’ or ‘{{ value_json.motion2 }}’

Hope it makes sense!
Otherwise you can always try ESP Easy which after flashing doesn’t require any coding experience :slight_smile:


#565

Thanks! I’ve added the bits in below at the appropriate places

#define PIR1PIN    D5  ### EDITED CODE ###
#define PIR2PIN    D4  ### ADDED CODE ###

  root["motion1"] = (String)motionStatus;  ### EDITED CODE ###
  root["motion2"] = (String)motionStatus;  ### ADDED CODE ###

I’ve also edited the ****** START SETUP ****** section to the below

  pinMode(PIR1PIN, INPUT); ### ADDED CODE ###
  pinMode(PIR2PIN, INPUT); ### ADDED CODE ###

It’s just the //PIR CODE bit I’m unsure of now - I’ve duplicated it and added PIR1PIN and PIR2PIN.

    //PIR1 CODE
    pirValue = digitalRead(PIR1PIN); //read state of the

    if (pirValue == LOW && pirStatus != 1) {
      motionStatus = "standby";
      sendState();
      pirStatus = 1;
    }

    else if (pirValue == HIGH && pirStatus != 2) {
      motionStatus = "motion detected";
      sendState();
      pirStatus = 2;
    }

    //PIR2 CODE
    pirValue = digitalRead(PIR2PIN); //read state of the

    if (pirValue == LOW && pirStatus != 1) {
      motionStatus = "standby";
      sendState();
      pirStatus = 1;
    }

    else if (pirValue == HIGH && pirStatus != 2) {
      motionStatus = "motion detected";
      sendState();
      pirStatus = 2;
    }

    delay(100);

Would that be correct? Any obvious errors I might have made?
Obviously I will remove al the ### CODE ADDED/EDITED ### parts.


#566

Compile, upload, test and let me know if it worked, I will be very happy to know I did actually learn some coding this year and maybe I shouldn’t rely so much on ESP Easy :joy: