What did you build/automated today (with pictures)?

I have been thinking for a while how to reliably detect when we cook and the fan needs to be set to extraction mode. So it is a continuation of the fan ir remote I build a few weeks back. I found the solution in the mlx90614 infrared temperature sensors. I connected this to a wemos d1 mini and put it in a 4x4 cm wooden box. Although it is made for close range measurement it is enough to detect a noticeable difference to the ambient temperature when pointed in the general direction of the stove from about 50cm away.


Johannes

3 Likes

Box may need some work but I LOVE the idea! That’s really cool.

I was just about to ask “why didn’t you just hide it in the fan housing”, and then remembered just how well my own ceiling fan metal housings blocked the WiFi signal…

Actually, come to think of it, now that I’m learning how useful the ESP8266 is, I’m realizing I’m going to be running into this problem more and more often.

What do you think about this one?

I feel like a little wifi antenna sticking out isn’t going to matter, and then I can hide the MCU inside a metal enclosure.

Cant put it in the fan housing as the fan is on the opposit wall of the stove and the mxl90614s only measure anything I can use when less than 50cm from the stoves surface as they are made for accurately measuring in the 2-3cm range. the box looks rougher on the pictures so close up than in reality :see_no_evil: but Im definitely no professional wood worker.

1 Like

Well, as long as your significant other is happy :smiley:

1 Like

If you use the external antenna, I believe you also need to move the resistor on the wemos board.

1 Like

I automated my air conditioning today!

The entire project obviously took way more than a day (it’s a learning process) but I deployed it today.

@JGKK how do you like that screen cutout. I filed it very, very carefully while thinking of your fan controller. :grin:



It’s a Wemos D1 ESP8266 with an IR emitter (transistor powered), 200x200 pixel SPI display, and a 433 MHz remote receiver, running purpose-built software and talks to openHAB as an MQTT/Homie 3.0.1 device.

The display shows the setpoint. Yes, the setpoint currently is really 28 degrees celsius (82 F). Living in a tropical climate it makes no sense for the indoor temperature to differ too much from outdoor. I’ve found myself chasing the outdoor temperature 4-5 times a day, which meant walking to the bedroom (central air, controls the whole house) and using an infrared remote.

No more! It’s now automatic, based on an offset from the outdoor temperature, with formulas/rules that I am sure I will be tweaking for a while.
Next step is to take the astro binding local sun elevation/azimuth into account so that I can make it ignore the exterior temperature sensor when it gets hit by the sun for about an hour around 5:30 PM.

Those 200x200 SPI displays are painfully slow, it takes almost a whole second to update the entire screen, and there doesn’t seem to be any fill commands and no way to optimize things, you really have to write pixel values… ugh. But, for this purpose it works. At least I don’t have to rewrite the screen to control the brightness, I connected the backlight control pin directly to a PWM pin. :slight_smile: The display shows the current setpoint, nothing more.

I have a separate temperature formula for sleep mode, and that means I can now finally tie things like exterior lights to sleep mode as well. Before, when “sleep mode” was just a toggle switch in openHAB, of course I never remembered… but there’s no way I’m forgetting to change the air conditioning temperature. Seeing my new A/C controller on the wall (instead of the original remote) will certainly be enough of a reminder to press the sleep mode button! which is an aeotec wallmote next to the bed.

The 433 MHz remote receiver does not have a purpose yet but I’m sure I will find a reason to put up a 433 MHz wall remote for something else now that I have a receiver in the bedroom.

6 Likes

Cudos. Well done. Would you be able to share the code base for the ESP? Having an ESP with IR as an MQTT device gives a lot room for other interesting applications.

1 Like

EDIT: It’s DONE.

Sure! It’ll take some cleanup, and then some setup work to build (i use Sloeber, not the arduino IDE) but it’s definitely possible.

My code base has a few nice features as standard: HTTP server (for control and status info), Telnet server (for direct debug output), OTA update, and MQTT/Homie.

It does not have any kind of runtime configuration, though. Everything is hardcoded, even SSID. I will always be a programmer, so it’s not worth it for me to spend the time making anything runtime configurable – it’s actually easier for me to just re-compile and re-upload.

The display does look a little bit crooked :sweat_smile:. Because of that slow refresh im playing around with small oleds right now.
Good work.
Johannes

1 Like

Very nice, and practical project @leif

I also started with astro binding, but at the end solved similar problem with two temperature sensors, both are intentionally placed to be exposed to the sun, one on the east and other on the west side of the building. Then I can use lowest temperature of those two as ambient air temperature, and I can use highest temperature as reference of how it “feels” outside on the sun, and I can use the difference to tell how “strong” the sun is, as we have a lot of rain (and controll blinds etc).

5 Likes

Thanks. Much appreciated. We all have been in that situation ,-). If the code is available others will fill in the gaps. I certainly will have a look into it. You want setting up a repo on gitlab/hub?

:rofl:

That’s a really clever idea to use two sensors! I hadn’t thought of that. I’ll definitely look into it.

21 posts were split to a new topic: 433 MHz switches

Hi @CDriver

Thanks for sharing. Could you explain a bit more about how this works and what type of gas meter you have please?

Thanks

I love those technical details but I think this discussion is really worth an own thread.

Please guys, open a new topic for 433mhz buttons. Maybe some of the admins could move relevant messages to that new topic? @digitaldan @hmerk or someone who is fallowing?

5 Likes

Moved those posts here.

4 Likes

I’ve got one that looks similar to this
image

I cut the gas line and inserted a flow meter. It smells a bit but works just fine… :smiley:
I jest - don’t do this at home kids :slight_smile:

Next to the right hand numbers is a magnet which comes round with the zero.
My esp8266 goes to deep sleep and when the magnet comes around it resets.
When it boots up it connects to the wifi, publishes a message to mqtt and goes back to sleep.

Within OH I have an item and a rule

Item:

Switch UtilityGasPulse (g_persist_change)  {mqtt="<[mqtt:home/utility/gas/tick:state:MAP(gasTick.map)]"}

rule:

rule "Count Gas Useage"
when Item UtilityGasPulse changed to ON
then

    UtilityGasPulse.sendCommand(OFF)
    UtilityGasLastPulse.sendCommand(now.toString)

    if (UtilityGasVolumeTotal.state == NULL) return;

    val Number calorificValue = UtilityGasCalorificValue.state as Number
    //logWarn("calorificValue", calorificValue.toString)

    g_Utility_Volume?.members.forEach[item | 
            val newVal = (item.state as DecimalType + 0.001);

            //update volume
            sendCommand(item.name, newVal.toString)

            //units = value * 1.02264 * Calorific value * price per kWh
            val newUnits = (newVal * 1.02264 * calorificValue) / 3.6
            sendCommand(item.name.replace("Volume", "Units"), newUnits.toString)
            //logWarn("FFF", item.name + " - CV - " + newVal.toString + " -- " + newUnits.toString)
    ]


end


I count the ticks and just keep adding them up. it works quite well and keeps in sync.
I am also, as the code shows, working out what my actual gas bill will be though this is still a WIP.
I was planning on telling SWAMBO how much her cooking costs :smiley:

I can post the code (in another thread) should you want it.

C

1 Like

I’ve no idea how that meter works, but is there the chance you’re affecting the meter’s reading by putting a bit of resistance to the free turning of that magnet? Or more importantly, would your gas company have grounds to say you are?

Are you getting the ESP to reset with a reed switch?