BRUH DIY Multisensor


The only automation that link to this pir is when there is motion detect while the alarm is on then send me notify and camera feed.

It works normally when I use this pir as sensor not binary_sensor. The matter is pir sensor cannot be seen in homebridge.

Try to change from sensor to binary_sensor. the status show differently on front end. from standby change to clear. from motion detected change nothing still show clear. At the entity of this binary_sensor show off which I assumed if there is motion detected it should be on. but nothing change as well show as off all the time.


Got it works now. Thank you so much. So happy.


Someone asked about my sensor that I used… (for the case only)

It was this one.




I can’t get my configuration.yaml file to work with the multisensor, where’s the best place to post it so I can get some help with it?


Hello @abutters, here is just perfect just use preformatted text </> option for posting the code.


Hey everyone,

I’m a noob, I’ve been following Bruh Automation’s $15 Multisensor guide and as I said in my previous post I cant get my configuration.yaml file to work. When I copy and paste his example into my config Home Assistant won’t start. Below is my config:

  # Name of the location where Home Assistant is running
  name: Home
  # Location required to calculate the time the sun rises and sets
  latitude: 52.654264
  longitude: -1.072211
  # Impacts weather/sunrise data (altitude above sea level in meters)
  elevation: 91
  # metric for Metric, imperial for Imperial
  unit_system: metric
  # Pick yours from here:
  time_zone: Europe/London
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend

# Enables the frontend

  broker: core-mosquitto  
  port: 1883  
  client_id: home-assistant-1  
  username: YOURUSERNAME  
  password: YOURPASSWORD  
  - platform: mqtt_json  
    name: "SN1 LED"  
    state_topic: "bruh/sensornode1"  
    command_topic: "bruh/sensornode1/set"  
    brightness: true  
    flash: true  
    rgb: true  
    optimistic: false  
    qos: 0  
  - platform: mqtt  
    state_topic: "bruh/sensornode1"  
    name: "SN1 Humidity"  
    unit_of_measurement: "%"  
    value_template: '{{ value_json.humidity | round(1) }}'  
  - platform: mqtt  
    state_topic: "bruh/sensornode1"  
    name: "SN1 LDR"
    ##This sensor is not calibrated to actual LUX. Rather, this a map of the input voltage ranging from 0 - 1023.
    unit_of_measurement: "LUX"  
    value_template: '{{ value_json.ldr }}'  
  - platform: mqtt  
    state_topic: "bruh/sensornode1"  
    name: "SN1 PIR"  
    value_template: '{{ value_json.motion }}'  
  - platform: mqtt  
    state_topic: "bruh/sensornode1"  
    name: "SN1 Temperature"  
    unit_of_measurement: "°F"  
    value_template: '{{ value_json.temperature | round(1) }}'  

 - platform: mqtt  
    state_topic: "bruh/sensornode1"
    name: "SN1 Real Feel"
    unit_of_measurement: "°F"
    value_template: '{{ value_json.heatIndex | round(1) }}'
    name: Sensor Node 1  
      - sensor.sn1_temperature  
      - sensor.sn1_humidity  
      - sensor.sn1_ldr  
      - sensor.sn1_pir  
      - light.sn1_led  

# Enables configuration UI

  # Secrets are defined in the file secrets.yaml
  # api_password: !secret http_password
  # Uncomment this if you are using SSL/TLS, running in Docker container, etc.
  # base_url:

# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically

# Allows you to issue voice commands from the frontend in enabled browsers

# Enables support for tracking state changes over time

# Tracked history is kept for 10 days
  purge_keep_days: 10

# View all events in a logbook

# Enables a map showing the location of tracked devices

# Track the sun

# Weather prediction
  - platform: yr  
# Text to speech
  - platform: google

# Cloud

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

The issue occured after the copy/paste, which is lines 23-84 if that helps. Below is the output I get when using the built in configuration validation:

Testing configuration at /config 2018-02-21 20:51:40 ERROR (SyncWorker_0) [homeassistant.util.yaml] while parsing a block mapping in "/config/configuration.yaml", line 1, column 1 expected <block end>, but found '<block sequence start>' in "/config/configuration.yaml", line 69, column 2 2018-02-21 20:51:40 ERROR (MainThread) [homeassistant.bootstrap] Error loading /config/configuration.yaml: while parsing a block mapping in "/config/configuration.yaml", line 1, column 1 expected <block end>, but found '<block sequence start>' in "/config/configuration.yaml", line 69, column 2

Any help would be much appreciated



On line 69 you are missing a space before - platform: mqtt
The line needs to start with 2 spaces.



Awesome, thank you!


Hello @abutters,

Change this:

 - platform: mqtt  
    state_topic: "bruh/sensornode1"
    name: "SN1 Real Feel"
    unit_of_measurement: "°F"
    value_template: '{{ value_json.heatIndex | round(1) }}'


  - platform: mqtt  
    state_topic: "bruh/sensornode1"
    name: "SN1 Real Feel"
    unit_of_measurement: "°F"
    value_template: '{{ value_json.heatIndex | round(1) }}'


By the way. I was wondering if there is any up to date fork of the “official” Git repository? I see a couple of unmerged pull requests including a couple of bugfixes I copy and pasted into my code.


I ask my self the same. There is a bunch of forks (more than 10) around which are also capable of handling more sensors (gas sensors for example).


Also some forks did code improved the pir sensor for better results.
Would be nice to get them merged back or get a “new” master branch where all/some improvements are in and get occasional updates when needed.

I just builded my first Multisensor. I had tempreature/humidity and light sensor up without troubles. But I have hard time with the pir/motion sensor and the led.

LED problem:

I don’t get it to light up with the proposed wiring. I see that the command is received by the sensor and set (serial monitor) - so no problem here. Weird thing is when I wire it differently and put one of the R-G-B lines on ground I get this color permanent lightning and when I set a color in home assistant it actually has an impact also changing the led color (even though the color which is wired on ground is “always on”). I’m not sure if I got the wrong LEDs (used the link from bruh to order) and I also tried diffrent ones to be sure it’s not a half-broken one.
Does any one has a clue whats going on here?

PIR-Motion problem:

Even harder. It’s always in stand-by. Just when I wire it off and on I can force a short ‘motion detected’. No idea where to debug because it’s all happening inside the sensor… any ideas here?


I have similar problems, the sketch by BRUH works just fine but I have problems with the LED option in the Shawn Cory sketch, all other sensors work just fine and my sensorname is “sensornode2”.

      - platform: mqtt
        name: "SN2 LED"
        state_topic: "homeassistant/light/sensornode2_sensor_led/state"
        command_topic: "homeassistant/light/sensornode2_sensor_led/set"
        brightness_command_topic: "homeassistant/light/sensornode2_sensor_led/brightness/set"
        brightness_state_topic: "homeassistant/light/sensornode2_sensor_led/brightness/state"
        rgb_command_topic: "homeassistant/light/sensornode2_sensor_led/rgb/set"
        rgb_state_topic: "homeassistant/light/sensornode2_sensor_led/rgb/state"
        brightness: true
        flash: true
        rgb: true
        optimistic: false
        qos: 0

The light is displayed but the LED just won’t turn on and I tried nearly any mqtt option?

I had also problems with the power on the node. On nodeMCU v3, do not use the Vin (this is a input), only use the 3v outputs on the device.

Hope someone has the answer to my question?


Looking at the sketch…

Not brightness but brightness!!!

#define DEVICE_LED_BRIGHTNESS_COMMAND_TOPIC "homeassistant/light/" DEVICE_NAME "_sensor_led/brighness/set"
#define DEVICE_LED_BRIGHTNESS_STATE_TOPIC   "homeassistant/light/" DEVICE_NAME "_sensor_led/brighness/state"

It is working now!


brighness? :face_with_monocle:

With your sketch the led even does not stay not the home assistant gui…

When I use this code the led switcher in the hass gui stays on (eventhough the led is off…

  - platform: mqtt_json  
    name: "SN1 LED"  
    state_topic: "bruh/sensornode1"  
    command_topic: "bruh/sensornode1/set"
    brightness: true  
    flash: true  
    rgb: true  
    optimistic: false  
    qos: 0


What housing are using there. It looks great. Can you send a link where to get it?


Hi. Sadly it wont’t be of any use to you I’m affraid… I bought it at a local shop in Croatia.
Here is the link:


So, I struggled for weeks with getting intermittent NAN values from my DHT22’s on 6 different Bruh multisensors.

When I built the first one I thought it may have been a hardware issue with the nodemcu board, the DHT sensor or the power supply being used, but after building 6 of these with different brand power supplies, NodeMCU’s, DHT’s, etc. I was getting intermittent NANs on all of them at different times.

The only thing that would reliably fix it was to remove power from the nodemcu and reapply it (a reboot). After that it would tend to work for a while but the NANs would come back. Sometimes, very infrequently, it would fix itself.

Well, I think I finally nailed it. The DHT Sensor Library from Adafruit has a bug in it for all versions 1.2.0 and above. It is all over the web. For some reason it took me ages to find it, but now that I have found it, it appears to be rife.

I didn’t want to stuff around with other libraries as I am just learning Arduino and didn’t want to introduce a possibly conflicting library as I didn’t know what the impact of that would be or how to undo it if I had issues.

The way I fixed it was to install version 1.1.1 of the library (the version previous to 1.2.0). After recompiling and redeploying the new code to all Bruh sensors, I have not had another NAN reported for a couple of weeks now.

There is a side effect though. The ComputeHeatIndex function within the DHT library doesn’t appear work properly in v1.1.1. It produces obviously incorrect heat index data. When humidity is high, heat index is low and vice versa.

I just ignore the heat index value calculated by the nodemcu, and calculate my own heat index inside of hassio using a value template.

I hope this helps someone who has/is experiencing similar frustrations to me. I almost abandoned the project because of it, but now I am stoked it is working. Wifey is not all that happy about seeing little 3D printed black boxes everywhere that flash red when she walks past them, but that is part of the fun isn’t it? Annoying the missus!


Hi, i have built this sensor and used Bruh his code.
All works except for the light sensor. I use the temt6000 for that but i get no value at all.
I ordered two of them and both don’t give a value.

Do i have to change something to the code?
I also used the example Yaml from Bruh, but i cant find something wrong in there.

Does someone have any hints what to look for?