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

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 @Crispin

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?

Unlikely as it’s widely used for this. A read switch or hall effect senor offers, I suspect, nothing in the way of drag.

Yes. Wakes it up

Today, since it was raining the entire day on my holiday location, i decided to finally look for a solution to implement Face Recognition in our OpenHAB integrated doorbell.

Currently my doorbell setup:

  • Takes a snapshot of the front door camera and sends this to our phones using pushover.net
  • Plays a doorbell chime through our SONOS speakers
  • Blinks the Hue lights red a few times throughout the house
  • Starts a live video feed of the front door camera on the various wall mounted tablets throughout the house.

All of the visual components are showing “There is someone at the door”.
For sure it is way cooler if we could make this text say who is actually at the door (given we are able to recognise the person(s))

The Doorbell:

  • Wemos D1 ESP8266 board with LED pushbutton sitting outside next to our front door
  • This ESP8266 sends an ON/OFF message through MQTT towards OpenHAB whenever the doorbell is pressed.

The video camera:

  • Unify NVR running on VMware ESXI
  • Unifi UVC-G3-FLEX IP camera

Face Recognition solution:

  • FaceBox container running on my docker server
  • Free version restricted to 100 faces (should be enough for the average household)

Logic/Rules:

  • I have entirely switched over to Node-Red for rule processing so it was suiting to use Node-red to integrate the whole.

Diagram of the doorbell flow:

Node-red doorbell flow:

FaceBox has proven to be easy to learn new faces. Simply upload 1 (preferably more for better results) pictures of the faces you would like to recognize. Immediately after the learning process you can start with the detection and recognition of faces. The REST API of facebox is pretty flexible and will give enough details to succesfully integrate the face recognition results into a system like OpenHAB/Node-red.

Besides that, FaceBox runs locally on my own docker environent preventing me from having to share my front door snapshots with any public cloud service.

I will write a more elaborate write-up once this solution has left the test bench and fully entered my production environment.

In the mean time i’ve also updated my Habpanel Doorbell view:

  • It shows the main video feed
  • an overlay bar showing the names of the face(s) detected (bar is not shown if no faces recognized)
  • the buttons on the right will eventually link to the most recent doorbell recordings (coming from my NVR)

18 Likes

I’m loving this face recognition stuff. Seeing as my house generally has people in and out the same door it really changes how occupancy can be used

Given it’s accurate and cannot be cheated… :slight_smile: I have yet to see how many times this setup correctly identifies people… will get back and update once we have some flying hours under our wing.

Did you ever try if a stranger (i.e. not known by your system) can walk in just holding a printed picture of you (e.g. from a social network) in front of the camera? (Or even on a tablet screen.)

2 Likes