BRUH DIY Multisensor


#588

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.


#589

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


#590

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

It was this one.


#591


#592


#593

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?


#594

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


#595

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:

homeassistant:
  # 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: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  time_zone: Europe/London
  # Customization file
  customize: !include customize.yaml

# Show links to resources in log and frontend
introduction:

# Enables the frontend
frontend:


mqtt:  
  broker: core-mosquitto  
  port: 1883  
  client_id: home-assistant-1  
  username: YOURUSERNAME  
  password: YOURPASSWORD  
  
  
light:  
  - 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  
  
  
sensor:  
  
  - 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) }}'
  
  
group:  
  sensor_node_1_card:  
    name: Sensor Node 1  
    entities:  
      - sensor.sn1_temperature  
      - sensor.sn1_humidity  
      - sensor.sn1_ldr  
      - sensor.sn1_pir  
      - light.sn1_led  



# Enables configuration UI
config:


http:
  # 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: example.duckdns.org:8123

# 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:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
  # Optional, allows Home Assistant developers to focus on popular components.
  # include_used_components: true

# Discover some devices automatically
discovery:

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

# Enables support for tracking state changes over time
history:

# Tracked history is kept for 10 days
recorder:
  purge_keep_days: 10

# View all events in a logbook
logbook:

# Enables a map showing the location of tracked devices
map:

# Track the sun
sun:

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

# Cloud
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


#596

Hi,

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

Regards
Erik


#597

Awesome, thank you!


#598

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) }}'

to:

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

#599

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.


#600

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).


Source: https://github.com/bruhautomation/ESP-MQTT-JSON-Multisensor/network

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?


#601

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”.

light:
      - 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?


#602

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!


#603

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…

light:  
  - 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

#604

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


#605

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:

http://www.electronic-center.hr/elektronika/elektroni/kutije-za-samogradnju/kutija-plasticna-pp42ws.html


#606

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. https://github.com/adafruit/DHT-sensor-library/issues/94

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!


#607

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?