Tinkering with Tasmota sensors
-
@archers I'm still trying to find a PIR enclosure, to securely mount the light sensor. Did you find one specifically? Thanks!
@therealdb I have not found any really good enclosure for that either.
For my outdoor sensor above I had to DIY a bit, I took the dome from an old PIR sensor I had laying around (similar to this one), drilled a hole in the enclosure and then hot glued the dome and the sensor in place.
It is possible to buy just the domes also e.g. here.
-
@therealdb I have not found any really good enclosure for that either.
For my outdoor sensor above I had to DIY a bit, I took the dome from an old PIR sensor I had laying around (similar to this one), drilled a hole in the enclosure and then hot glued the dome and the sensor in place.
It is possible to buy just the domes also e.g. here.
-
I have now completed two more CO2 meters. I used a similar enclosure as for the IR tranceiver, but this time 80 x 80 mm. I got it from Conrad, but you can get it from e.g. Farnell also. The enclosure is available in black and grey also.
The sensor contains a D1 Mini ESP8266, a MH-Z19B CO2 sensor and a BME280 temp/humidity/air pressure sensor. I have found the BME280 to be pretty good.
The temp reading from the MH-Z19B is however completely off so a separate sensor is required.A tip is to add a switch for the power to the MH-Z19B, this is needed for switching the MH-Z19B off when (re)flashing the ESP.
I think the MH-Z19B requires too much power from the PC USB when flashing.Another tip is that in Tasmota it is possible to adjust the sensor offset with TempOffset and HumOffset.
There are a few options for the MH-Z19B with the Sensor15 command. I have turned off auto calibration.
The plan is to push the data into OpenLuup from the sensors with Mqtt when I get this fully up and running.
-
A tip is to add a switch for the power to the MH-Z19B, this is needed for switching the MH-Z19B off when (re)flashing the ESP.
Why is that?
@sender I discovered that the ESP does not flash with Tasmotizer when the MH-Z19B is connected. Why I do not know, usually it is no problem to flash ESPs with sensors attached.
I think it could be that the MH-Z19B draws too much power or something.The solution I chose (since I soldered the MH-Z19B to the ESP) was to add a simple on/off switch to the 5V VCC connection. That way when flashing I can put the switch in "off" position and then when done I turn it bach to the "on" position.
When using Dupont cables you can simply disconnect the MH-Z19B instead.
Btw this is normally only an issue when re-flashing, I usually do the initial flash before attaching any sensors.
-
@sender I discovered that the ESP does not flash with Tasmotizer when the MH-Z19B is connected. Why I do not know, usually it is no problem to flash ESPs with sensors attached.
I think it could be that the MH-Z19B draws too much power or something.The solution I chose (since I soldered the MH-Z19B to the ESP) was to add a simple on/off switch to the 5V VCC connection. That way when flashing I can put the switch in "off" position and then when done I turn it bach to the "on" position.
When using Dupont cables you can simply disconnect the MH-Z19B instead.
Btw this is normally only an issue when re-flashing, I usually do the initial flash before attaching any sensors.
-
I’m tinkering without any hardware...
...just prototyping an MQTT Tasmota bridge. Does everyone use the default cmnd / stat / tele prefixes?
@akbooer yes. I usually use both /tele/devicename/sensor, and stat/devicename/status8 to get sensors data. It's useful to get both telemetry message and stats pushed via automations/console/UI. and cmnd/ to send/get commands.
EDIT: and tele/devicename/LWT to handle disconnections as well.
-
I’m tinkering without any hardware...
...just prototyping an MQTT Tasmota bridge. Does everyone use the default cmnd / stat / tele prefixes?
@akbooer You can't really change the default prefixes through the Tasmota UI, just the topic itself.
It can be done through Console CLI along with hundreds of other minor variations to the standard Tasmota defaults, however, I don't know why anyone would given the overall flexibility in sending data with the MQTT standard.
-
Some time ago I stumbled on some rather nice looking temperature and humidity sensors from Xiaomi and how to get them to communicate with a Tasmota ESP32 with BLE.
I ordered an ESP32 on Ebay and a three-pack of the sensors from Bangood. The sensors are quite cheap, you can find them for €4-5 in the usual sites.
The sensors are quite small, approx 4.5cm and run on a CR2032 battery. Time will tell how long the batteries will last. With the custom firmware you can change the reporting interval.
I have now been running this for little over two months and it works surprisingly well, bringing the temperature and humidity data into OpenLuup.
In short what you do is the following:
-
Download the beta Tasmota for ESP32, flashing is a bit different from the regular Tasmota but pretty straight forward
-
Enable bluetooth with
setoption115 1
-
The Xiaomi sensors can used both with stock firmware and flashed with a custom firmware that removes the encryption from the transmit of data, I flashed them with a Win10 laptop and it was super easy. You can even roll back the original firmware if you want.
The Xiaomi sensors will then be included by the ESP32 Tasmota device and can be sent to OpenLuup with rules, brought in with Sitesensor or now via MQTT.
@archers This is perfect for our greenhouse I'm building right now!
I ordered a Sonoff Dual R3 for heating/cooling fan and lightning control, temp/humidity sensor for visual display and automation/remote readings and a couple of Mi Flora to feed info in to the irrigation system, thanks for sharing! -