Best Cheap products for PIR, Temperature, Humidity

I would recommend the Xiaomi range of sensors, but don’t get the gateway and use this:

https://community.home-assistant.io/t/zigbee2mqtt-getting-rid-of-your-proprietary-zigbee-bridges-xiaomi-hue-tradfri/

Works a treat!!!

1 Like

I use Xiaomi as well, works like a charm (I use multiple gateways).

@lolouk44 I do not know about other devices but the xiaomi sensors do not give false readings when the battery get’s low they just stop working. To avoid that you can have a battery low warning.

1 Like

I have one Xiaomi Temp/Humidity sensor, and two Sonoff TH10’s with temp and humidity sensor’s connected to them. Now this is just my OCD kicking in probably, but I prefer the sonoff’s, as they are powered, they give a more updated reading. With the Xiaomi battery one’s, they only update if there is a significant change, I guess to save battery, but it just makes the graph look weird, I mean there is nothing wrong with the actual reading, its just my OCD :smiley:

Sonoff
loft

Xiaomi
office

I have some Sonoff plugs around as well, so have ordered the parts to do this to them,

https://github.com/arendst/Sonoff-Tasmota/issues/670

So can add some more sensors around the house that are powered.

1 Like

So I have a TH10 that’s flashed and works for the power but I haven’t managed to get the temperature from it. I have a probe that looks like a little metal bullet, if I visit the device via http I can see the temp so it is working. Do you have any instructions you followed to get urs working and to graph it?

Looks like I’m heading down the xiaomi route as well :slight_smile:

You need to add a MQTT sensor, presuming you have it setup to connect to a MQTT server, and from there this is my code, so adjust to fit your sensor,

- platform: mqtt
  name: "Loft Temperature"
  state_topic: "tele/extractorfan/SENSOR"
  value_template: "{{ value_json['AM2301'].Temperature }}"
  unit_of_measurement: "°C"
  retain: true
- platform: mqtt
  name: "Loft Humidity"
  device_class: "humidity"
  state_topic: "tele/extractorfan/SENSOR"
  value_template: "{{ value_json['AM2301'].Humidity }}"
  unit_of_measurement: "%"
  retain: true

By the sounds of it, you have the waterproof temp sensor, so not sure that does humidity, so can probably ignore the second bit, but it also has a different name, so if you got to the tasmota/http page for the sonoff, and then go to the console, you will see the messages it is sending to the MQTT server, should be something like this,

12:53:10 MQT: tele/extractorfan/SENSOR = {"Time":"2018-08-03T12:53:10","AM2301":{"Temperature":28.5,"Humidity":49.5},"TempUnit":"C"}

the AM2301 part is the name of the sensor, yours will be different, so just change out that part of the code for what your’s read’s and it should be good to go.

Before you do, have a look at this.

I did the zwave course (xiaomi -zigbee) and this solution is just better in all respects. It works, It’s inexpensive and It’s easy to setup.

The simplest way forward with this is to get a couple of Sonoff rf gateways, flash them with a simple micro usb (no soldering, no wiring, nothing ) and order 7 to 8 dollar motion and contact sensors from china. There’s a list of proven sensors.

… and don’t forget to configure the TH10 to expect the probe data - like this:

1 Like

and what he said :smiley: :smiley:

thanks chaps! god i love this mqtt stuff!!!

Can you point me in the right direction for more info on doing this? Please and thanks!

what exactly do you want need help with / what part were you interested in?

Can you explain your setup @juan11perez? I’m interested in 433mhz, infrared IR to and from MQTT on ESP8266 . How are the sensors setup? Is it similar to MySensors, where you use a microcontroller like Arduino or ESP8266 to connect the sensor to. Then sensor inputs are sent via MQTT back to HomeAssistant?

@benhuson1 Which Zigbee USB do you use? I’m keen to know about this route as well. As I have some IKEA lights and a hub already.

Hello!

I just used everything on the Zigbee2Mqtt setup.

The wiki pages show you all the bits you need to get going:

Its a really well written guide

1 Like

Hi @sentur I’m in a 2200sqft flat. I have two sonoff bridges spread out. I use the sonoff only for 433mhz sensors; but you can use it to transmit to RF devices. I have 10 pirs, 8 door/window and 1 fire/smoke alarm.
I started with the openmqtttgateway sketch last November and it worked fine. About 2 weeks ago I decided to move to Tasmotta, since I have many “tasmotized” devices and I use the Tasmoadmin docker to monitor them I wanted to have consistency. Flashing to tasmotta is very easy (you can use the Drzz video).

The sonoff acts as a gateway. It receives RF signals and transmits back to HA via MQTT (similar concept to Mysensors, but with sonoff bridge the device is ready!). It works very well; in 9 months now using this system, I have not had any issues at all. Moreover sensor batteries are now running for 9 months also.

The other advantage is you can put as many gateways as you need/want. They’re only USD14 and they’re connected via wifi. No USB limitations or complications passing them to dockers or virtual machines or whatever is the set up.

The sensors are another advantage. You can get good sensors for an average of USD7.

As I said before I started with zwave because everybody does as it seems easy, but it’s not. This forum is filled with tons of zwave complaints/problems from the most elementary to the most cumbersome.

I understand people feel a bit intimidated with “flashing” devices, but the youtube videos are very easy to follow.

If I can offer further details let me know.

Thanks @benhuson1.

Thanks for clarifying your setup @juan11perez. It sounds like a very promising route to go down. Can you provide any links to where you bought your PIR sensors from and the gateway hub?

Do you have multiple gateway hubs in your flat in order to maximise coverage?

Are there any down sides to your setup. I’d read some negative comments about the window sensors. People keep saying the sensor only reports on the window being open. There’s no sensor output to say when it has closed, as far as I’ve seen. Is that true?

@sentur

Im using these Pirs.
https://www.aliexpress.com/store/product/DIGOO-DG-HOSA-Wireless-Infrared-PIR-Detector-Sensor-For-433MHz-Home-Security-Alarm-System-Kits/3043029_32819986075.html?spm=2114.12010608/itm2home-1.0.0.3cc51f3cNHHcTb 17
Very good quality, hard plastic good range. Been running on same battery 9 months now.

I use this door/window sensors.
https://www.aliexpress.com/item/3ps-lot-Wireless-Alarm-Accessories-Intelligent-Door-Window-Sensor-Magnetic-Door-Sensor-for-G90B-GSM-PSTN/32761822450.html?spm=a2g0s.13010208.99999999.259.3d243c00pfWlgn 18
They provide on and off signal. Same battery length thus far.

I have 2 gateways (sonoff rfbridge) to ensure coverage. You can add as many as you want/need. All you have to do is use the same topic in all to ensure at least one gets the signal. The first to get it will report it, so no issue there
this is the oem https://www.itead.cc/sonoff-rf-bridge-433.html
Buy only the gateway from them and the sensors I suggested above.

The comment about the window is true if you get a sensor that only provides an on signal. buy the one I suggest as it provides on/off (open/closed). No downside on my view.

4 Likes

Brilliant. Thanks for the all the details of your setup. It’s helped me and I’m sure will be useful to others.

One last thing, are the PIR sensors quick to respond or is there a noticeable delay? Also which smoke alarm do you have?

I tried a couple of PIRs, the one’s Im suggesting are very good. 1 or 2 sec I would say same response time as zwave.
Smoke alarm also from the same manufacturer of Pirs. You’ll find it in their store site.

1 Like

@juan11perez Thanks for you’re advice. I’ve gone down your suggested route. I’ve a couple of the Sonoff RF Bridges, flashed with Tasmota and the Digoo PIR sensors. Dirt cheap!

So far I’ve only been able to discover the 433mhz/MQTT data code for when the PIR is activated. Are there any other codes, ie for Low Power / Battery Changes? Or an OFF code?

No. the pir sensor only generates an on signal. You have to add an automation to turn it off. This is what i use:

for example

- platform: mqtt
  name: "pir1_masterroom"
  state_topic: 'tele/sonoff/rfbridge/RESULT' 
  value_template: '{{ value_json["RfReceived"].Data }}'
  payload_on: "315C48" 
  payload_off: "315C48OFF" 
  device_class: motion
  scan_interval: 5
  retain: true


- id: reset_single_code_detector
  alias: Reset single code detector
  initial_state: 'on'
  trigger:
  - platform: homeassistant
    event: start # Event can also be 'shutdown'
  - platform: time
    seconds: '/5'
  action:
  - service_template: mqtt.publish
    data_template:
      topic: 'tele/sonoff/rfbridge/RESULT'
      payload_template: >
        {% if (((as_timestamp(now())-as_timestamp(states.binary_sensor.pir1_masterroom.last_changed)) | int) > 5) and is_state("binary_sensor.pir1_masterroom", "on") %} 315C48OFF
        {% elif (((as_timestamp(now())-as_timestamp(states.binary_sensor.pir2_roomtwo.last_changed)) | int) > 5) and is_state("binary_sensor.pir2_roomtwo", "on") %} D0ED58OFF
        {% endif %}

as you add more sensors, you add to the “elif” part of the automation

also no battery information, but you can safely count on 1 year operation with new batteries

2 Likes