BRUH DIY Multisensor


#496

Hi @lambtho

Just wanted to ask you regarding connecting the PIR sensor to nodemcu. Could you please tell me which one is VCC, GND and DATA on the pir sensor that bruh is using?

Thanks.


#497

They’re labeled on the PCB, it will have a tiny - for the ground and a S for signal/data, then the last one is your VCC.
Hint: Be sure to check both sides of the PCB.


#498

Thanks but mine doesn’t have anything so it’s a lil hard.

I have noticed that the rgb doesnt turn red or yellow. Do you experience the same?


#499

I did not build a sensor with an RGB LED, odd that it has no markings. I’ll check the ones I have and post a pin out picture if someone else doesn’t first.


#500

Thanks buddy will wait for the picture


#501

Here’s the picture, you can see the - 0 and + printed on the PCB.
0 is Data/Signal.

Hope this helps.


#502

Hi @lambtho

So I finally uploaded your modified code and its impressive. The readings change as soon as I blow on the DHT22 sensor. However I have noticed that the temperature in the room is higher by 2-3 degrees celsius.

Do you think this is something to do with the code? Because in the original code the readings from the DIY multisensor was higher by 0.3-0.5 degrees celsius.


#503

Thanks for the pic buddy. My sensor clearly does not have any markings for the VCC, GND and DATA.


#504

Hi Lambtho
Can you please share the code.
Thanks


#505

No explanation for the higher temperature from software side.
My guesses are that, either it is too close to the nodeMCU (as the nodeMCU generates a bit of heat), or there is not enough air circulation where it stands, or it is in direct sunlight or next to some sort of heat.

If it is not any of those things, I do not know what causes this difference. If the difference you record is constant, just substract it from the value returned in HA (or transmitted by the nodeMCU).


#506

I am still in the cleaning process of all my codes, and I did not have a whole lot of time to do it recently. I will try to get it done by the end of august so that I can uplaod everything to github)


#507

Do you have any exemple of sensor.yaml to add your sensor?


#508

For the full sensor node with IR and stuff I have

#Sensor Node - IRLiving

sensor:
  - platform: mqtt  
    state_topic: "lambtho/SN_IRLiving"  
    name: "SN_Living Humidity"  
    unit_of_measurement: "%"  
    value_template: '{{ value_json.humidity | round(1) }}'    
  
  - platform: mqtt  
    state_topic: "lambtho/SN_IRLiving"  
    name: "SN_Living Temperature"  
    unit_of_measurement: "°C"  
    value_template: '{{ value_json.temperature | round(1) }}'  
  
  - platform: mqtt  
    state_topic: "lambtho/SN_IRLiving"  
    name: "SN_Living Light"  
    unit_of_measurement: "Ohm"  
    value_template: '{{ value_json.ldr }}'  
 
  - platform: mqtt
    state_topic: "home/IRtoMQTT"  
    name: "SN_Living IR"  
       
 
switch:
  - platform: mqtt
    name: "SN_Living HiFi"
    state_topic: "home/IRtoMQTT"
    command_topic: "home/commands/IR_NEC"
    payload_off: "2149589215"
    payload_on: "2149589215"
  
  - platform: mqtt
    name: "SN_Living TV"
    state_topic: "home/IRtoMQTT"
    command_topic: "home/commands/IR_SAMSUNG"
    payload_off: "3772793023"
    payload_on: "3772793023"
  
  
light:
  - platform: mqtt_json  
    name: "SN_Living LED"  
    state_topic: "lambtho/SN_IRLiving"  
    command_topic: "lambtho/SN_IRLiving/set"  
    brightness: true  
    flash: true  
    rgb: true  
    optimistic: false  
    qos: 0

#509

Okey! Thanks!
I did get the PIR sensor to work just fine, i can see the PIR sensor working.

What could be wrong with my code?

  • platform: mqtt
    state_topic: "homeassistant/sensor/sensornode4_sensor_humidity"
    name: "Tvattstugan Luftfuktighet"
    unit_of_measurement: "%"
    value_template: ‘{{ value_json.humidity | round(1) }}’

  • platform: mqtt
    state_topic: "homeassistant/sensor/sensornode4_sensor_temp/state"
    name: "Tvattstuga Temp"
    unit_of_measurement: "°C"
    value_template: ‘{{ value_json.temperature | round(1) }}’


#510

are you sure of your state_topics ?
If it is the bruh’s automation code, temp and hum should be in the same topic I think.
Could you provide your arduino code to see if there is a problem here ?
Also, could you use preformatted text when you post code (the symbol </>), that way we can see if there is some syntax problem more easily


#511

Im trying your code on your github for the sensor


#512

which code ?


#513

Maybe not your code, but should be an updated code for the sensrs


#514

ok not my code indeed, but I know this one too.
So first of all, the humidity topic is
homeassistant/sensor/sensornode4_sensor_humidity/state
and not
homeassistant/sensor/sensornode4_sensor_humidity

also, I assume the line 44 in your code is exactly

#define DEVICE_NAME "sensornode4"


#515
#define DEVICE_NAME          "sensornode4"
#define DEVICE_FRIENDLY_NAME "sensornode4"

Thats the code for the ESP8266

Yes, i did try with /state on the end also but nothing shows up anyway.

I can see everything working on my mqtt server, that it changes temp if i blow on it and so on.