Cheap temperature/humidity/light sensor?

Hey, I’ve recently begun with the whole home automation and openHAB, starting off with my IKEA lamp. Now I’d like to control this lamp depending on the current brightness, because time is rather unreliable with the seasons. My problem is, that I can’t find a really cheap light sensor that isn’t something for a DIY project. I wouldn’t have a problem doing it myself, but I have like no knowledge about that kinda stuff. Something like this (DIY: Cheap wifi-based temperature/humidity sensor based on ESP8266 & DHT22) looks pretty good but I don’t know where to get the parts and what to do :smiley:

My question is, do you have any links for this type of sensors (temperature/light/humidity) that I can use? Or maybe a link on how to get started with this DIY stuff, so that I can do it myself. I really appreciate any help

1 Like

Hi there,

You can use the esp8266 with a sensor to send info to Openhab using MQTT. If you google it you will find usefull tutorials.

The other way is to use Xiaomi stuff. The have a cheap humidity / temp sensor ( 9 euro at aliexpress ). You will need a xiaomi gateway with this, it’s works with openhab out of the box Thats around 20,-.

You can play with zigbee2mqtt instead of the xiaomi gateway but will require some additional programming. But again, google it and you will find a lot.

Also on this forum you will find a lot about

I have some xiaomi sensors and switches, they work good.

1 Like

Welcome to the world of OH2 @andarotajo
As was said already, there are many esp8266/esp32 based solutions that are all DIY. You can find easily temp/humidity sensors on one platform or the other, but off-the-shelves light sensors seem to be a little harder to come by. There are also arduino based solutions, just google it.
One platform that may work for you:

1 Like

There is a ‘movement detection’ sensor from xiaomi that can also measure lux.
The value is relative, but can be usefull. The gateway also has a lux sensor build in.

The question is more do you prefer finished products, or home build. The last is more fun, but not always the cheapest.

1 Like

Thanks for the link @lipp_markus

I don’t mind, doing this stuff myself @landzaat. The problem is that I don’t really know anything about the hardware site. I can solder a bit but that’s where it ends unfortunately :smiley:. For now I’m looking for the cheapest product for either temperature, humidity and lux or a combination of those. I wanna slowly get into this whole home automation stuff and don’t spend tons of money directly. Especially when I want to have those sensors in more than one room.

The Astro binding could be a solution without hardware. It will tell things about the sun position. Maybe you could use it to know how bright it was.

1 Like

I use the Astro binding and then when the sunset event starts, my lights go on. It also has an offset so if you find that sunset it too late, you can have it fire X min beforehand.

Initially I started looking at using my lux sensors as the trigger but then your rules can get tricky when you have to account for accidental low lux throughout the day ( i.e thunderstorm), the impact on the lux of the light actually turning on, etc


@Thedannymullen, @NicGray
Thanks for the suggestion! That looks really good actually. With this I don’t have to worry about the light atleast. How accurate is this though? Comparing to a cheap diy sensor? Now I just need to figure sth. out for the temperature and humidity :smiley:

1 Like

Shelly makes a nice humidity and temperature sensor. It works over Mqtt and in combination with the offset profiles for items it’s a really nice one. And as its wifi you don’t need a zigbee dongle or similar.

1 Like

Astro works great. Every day after midnight, it updates the times for sun rise/set based on your latitude and longitude, and also includes a number of other events (nautic dawn, noon, etc.) that you can use as triggers. You can also use it to run rules based on conditions (e.g. if after sunset and before sunrise), so your rules will adjust for the time of year.

It took me awhile to wrap my head around Astro, but there’s enough discussion on here that I was able to figure it out.

If you go down the Zwave path, I’ve had success using these sensors:

I have the DHT22 and a BMP280 running on separate WEMOS boards tied into OH2. One in the basement and the other upstairs.

As far as a light sensor, you can use a photoresistor to sense the light level. Plenty of demos of both options on Google search.

Actually there are a couple of battery operated Xiaomi products that broadcast humidity and temperature via bluetooth low energy (not requiring the gateway).
Xiaomi Temperature and humidity sensor
Xiaomi plant Monitor
(the latter broadcasts also fertility and light intensity)
I use the Raspberry running openhab to read their data.
Earlier, I used the Broadlink A1 sensor (more expensive than xiaomi though)

1 Like

I have one, it works, senses light, humidity and temp
$30 usd from amazon
Here is a link to a motion sensor thread I started. I tested several zwave sensors. The Dome, Fibaro and monoprice all sense light and temp, the monoprice does all three.

Light sensors can be tricky to work with - if they are close to the light the sensor values change when your rule turns them on firing your rule to turn them off - you’ll end up writing pointless code to work around this

You can use the network and time bindings to get a robust solution with minimal code
Time gets updated regularly and fires many very useful events, dawn, dusk, sunrise, sunset, etc
These events are specific to your location/timezone

if you go for diy (not too hard): I recommend Esp8266 with tasmota firmware. And for sensors go with Bme280 (not bmp) over dht22: you get temp, pressure and humidity - faster and more precise.
Light: I wrote a library for tsl2561, including lux calculation, so I recommend this one :slight_smile: It is not the only possibility, but better than photo resistors. The digital interface makes it more easy to get meaningful data.

If you go the Xiaomi/Aqara way, may want to consider instead of their hub. I fou d it very useful in my setup.
Plus I’m also using z2m for few Ikea Tradfri items - to get pir/dimmer integration with openhab, which would not be available if used with Tradfri hub).

This sounds cheap and cool!
What battery do you use and for how long does it last?

The xiaomi aqara temperature sensor runs aprox. 2 years on battery which is awesome but price also is higher than your DIY

I wasn‘t aware you want battery power. Tasmota is not designed for this. In fact the esp8266 and wifi is not optimal then.
I currently try to use the esp32 with its ultra low power copro for this. Still has the possibility of wifi but also bluetooth and ble and can operate i2c sensors from the ulp (which only draws micro amps, needed for battery operation, not over 100 mA like wifi)

Thanks for the answer, this makes sense…

I was thinking of building a room temp monitor for each room, but I would like to run on battery as I dont have sockets available where I hope to place the device