Here's a cool thing someone else has probably did. Esp8266 Lcd display?

I suspect this is the kind of question that the wife will regret me asking =p

Has anyone managed to hook up a cheap Lcd display of some description to enable, for example, a cool looking Lcd indicator panel for HSM or to display the temperature of a hubitat-linked probe?

Possibilities are endless! The wife will probably leave me....

I use the What Did I Say app to track some actions on a dashboard tile. I also use flasher for a quiet signal in the early morning when the garage door auto-opens for incoming deliveries. I also have a 3-gang switch in my blue-sky project box that I've thought I'd make into a 3-lamp indicator. @danabw uses a color code in smart bulbs, I believe.

I'm kinda waiting for a cheap, individually addressable led array --zigbee, of course. Then I'd conjure up some sort of signal board.

1 Like

The infamous (in Event Engine lore) Piano Light, which notifies me by turning on/red, if doors are open/unlocked when we're going to bed. Very simple, basic stuff compared to what the OP is about! :slight_smile:

Yeah, but we have to work with what we have, heh.

1 Like

Thanks for the links. I suspected this may be out of reach for me at the moment (don't have any arduino experience) but some of the suggestions look really cool.

I guess I was stupidly hoping for something to flash into a esp8266, a link to a simple small display to connect to it, and then an easy way to send messages to it (plus switch it on/off) through a hubitat device.

Way too much to ask for, I know =p

I am looking into a way of cleanly mounting some ws2812b s to display heating/entry/motion etc status too. Haven't quite figured that out yet, but wled is probably a good call.

It is if you also say 'easy'. I built a device from an ESP32 with an 2 line LCD display and a ultrasonic range detector. The arduino sketch measures treats them has two separate MQTT 'devices' as well as a combined device device. There are/were hubitat drivers that I used to test the device(s). The ultimate use doesn't require Hubitat. You also have to deal with 5v vs 3.3v power and signals and packaging it all up with a case. I also 'invested' in a 3D printer to build the case and learned enough open scad to modify a case design. Not easy, not cheap but it was fun. The cheap LCD and OLED displays are small and can not be read from a long distance. That limits what kind of device can be place where - don't forget the power cord.

@ccoupe

I'm familiar enough with konnected / nodemcu's but I've yet to move to @ogiewon's software for ard's/sketches. Also, I have seen mqtt mentioned a few times but I've never had the need nor the understanding.

I did a quick search of your posts to see if I could find anything regarding what you mentioned but have came up short.

Is there a particular approach you could recommend, at least as a starting point? If this is too noobie-ish, feel free to say so =p

Happy to learn, but sometimes find it difficult to know where to start with the unfamiliar aspects of this territory.

Also, with respect to the small lcds.... Small is fine. I just want to mount them on a kind of DIY central heating control box.

I'm happy to share what I've done. I moved from Arduino to MS VS Code and PlatformIO. I use MQTT for my reasons but HTTP (Maker Api) could be used if someone wants to do that work in the C++ code and there own HE groovy drivers - Plenty of examples on the interwebs for both. Assuming you write code.

Here's the C++ code and 3D files. It's not a lot of help unless you already know most of it.

If it helps to visualize the box I built . The camera stand is for a different but related device.

1 Like

This may be kind of what you're looking for. This is a dev board I'm using to build a bread proofing box. This uses the ESP8266 with a SSD1306 display. I use a MAX6675 Thermocouple as the temperature probe, and it's either plugged in or is powered via 18650 battery:

The production version that I have in the pantry also has a door sensor for the proofing box, and it also has a 5V relay shield that turns on and off a heat lamp to warm the proofer.

The Arduino code was pretty simple, and I'm relatively new to this type of project, with most of my experience being in software development management (not hardware). The cool thing about this project is it's running web server, so it provides an API to anything (including Habitat) to expose data elements like temperature, temp target, door open/closed, etc. This allows for addition to Habitat dashboards as well as standalone webpages for control and monitoring:

Lots can be done here -- it seems the possibilities are endless. Let me know if you'd like more info.

Chris

1 Like

@spotty

I would very, very much like some more info please. That sounds amazing.

Bearing in mind that I have zero coding experience, but I'm relatively technically minded (I've put a fair few things together for hubitat involving relays, nodemcu's, contact sensors and the like), I'd be very appreciative if it were possible for a basic run through of how to achieve this.

For reference, I was planning on adding a display to an existing back box. This back box currently houses a nodemcu running konnected, and reports temp to hubitat. Obviously if the hub goes down, then this little lot is useless. I'm assuming that using your approach means that it's accessible to any system somehow. Which would be awesome. The display would ideally display the temp, whether the heating was on or off, and various other bits that are already available to hubitat.

@ccoupe - no experience with coding. My gut is telling me this may be out of my zone...?

Unless you want your zone to be 'software developer'. This is not a good project for beginning programmers because there is so much to learn. @spotty project is slightly easier since he doesn't use MQTT but it's still a lot for a beginner. If I was still baking bread, I'd build that.

Cheers.

To be honest, I'd be absolutely happy just being able to connect a small display, and be able to send text from webcore to it.

That would absolutely cover my needs.

@spotty - does that make it less of a ballache for a 'quick guide'? I'm pretty sure more people would benefit too. =)

And @ogiewon - I'd bet my dog's recently removed nuts that you've already done something like this with less effort than it takes me to scratch my arse. =p

1 Like

LOL, you crack me up @djh_wolf! If you're initially just looking for webcore (which I don't use) to send some value to an ESP8266 with small display, that would definitely be a much smaller ballache. :slight_smile:

Let me put a small example together, and I'll post later. Basically, the result would be some code that would be managed though the Arduino software, and uploaded to the ESP8266. There'd be a (rough) wiring diagram or photo of the hardware, and finally the communication would happen via a URL with a parameter sent from anything that can launch URLs (which I'm sure webcore can do).

Would that work?

Chris

Chris!

That would be awesome. And yes, that work - webcore can happily launch URLs.

Bear in mind that I already have a stack of esp8266's, and 5v power supplies running to wherever they may get installed. Plus a 12v line.

Much appreciated !

1 Like

If I were to implement this in HubDuino, I would probably add a "Child Notification" device on the Hubitat side, and an EX_Notification device on the Arduino side. That device could easily update an LCD panel. The only hold up? I have never owned an LCD or OLED display for an Arduino-style microcontroller. It sounds like a fun little project though... :thinking:

Which display panel are you considering using? Maybe I'll pick one up for some testing. :wink:

The nice thing about using a standard 'Notification' device is that any Hubitat App could use it.

Here's a (hopefully) simple and complete example of using ESP8266 & SSD1301 to send & receive data between the controller/display and a client that can send a query via URL. The following image is a simple wiring for this project. Wiring: Display (GND, VCC, SCL, SDA) -> ESP8266 (G, 5V, D5, D2).

The Arduino code is here. It compiled and ran for me. The URLs that will be used are in a comment near the top of the code. Have a look -- hopefully it'll make some sort of sense! :slight_smile:

#include <SSD1306.h>
#include <ESP8266WiFi.h>
#include <ESP8266WebServer.h>

// SSD1306 display: http://amzn.com/B08FD643VZ
// ESP8266 controller: http://amzn.com/B081PX9YFV
// URL for setting value: http://<ip address of esp8266>/get?value=myvalue
// URL for receiving value: http://<ip address of esp8266>/test
//
// Wiring: Display (GND, VCC, SCL, SDA) -> ESP8266 (G, 5V, D5, D2)

const char *ssid = "Wifi SSID goes here";
const char *password = "Wifi password goes here";
const int sdaPin = D2;
const int sclPin = D5;
String valueString = "";
String webrootString = "This is the webroot";

ESP8266WebServer server(80);
SSD1306 display(0x3C, sdaPin, sclPin); // Address 0x3C may vary on display

void handleRoot() {
  server.send(200, "text/plain", webrootString);
}

void setup() {
  Serial.begin(115200);

  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
  server.on("/", handleRoot);

  server.on("/test", []() {
    server.send(200, "text/plain", "This string is returned when visiting /test via URL");
  });

  server.on("/get", HTTP_GET, []() {
    if (server.arg("value")) {
      valueString = server.arg("value");
      server.sendHeader("Location", "http://www.google.com"); //redirect after get if needed
      server.send ( 302, "text/plain", "");
    }
  });

  server.begin();
  Serial.println("HTTP server started");

  display.init();
  display.flipScreenVertically();
  Serial.println("Display initialized");
}

void loop() {
  server.handleClient();
  display.setFont(ArialMT_Plain_16);
  display.clear();
  display.drawString(0, 0, "Value received:");
  display.setFont(ArialMT_Plain_24);
  display.drawString(0, 18, valueString);
  display.display();
  Serial.print("Value received: ");
  Serial.println(valueString);

  delay(1000);
}

I haven't played around with Hubduino at all, and it may work better than what I've played around with. That said, my primary goal wasn't deep integration with Habitat, but I wanted to at least share data between my hardware projects and HE. I'll have to take a look at Hubduino though...

Chris

1 Like

HubDuino aims to simplify the integration between Arduino IDE-compatible microcontrollers and Hubitat, by implementing the Hubitat Standard Device Capabilities. Thus, one can attach any one of a multitude of temperature sensors to a microcontroller, and then have that sensor appear in Hubitat as a standard Temperature Sensor device. I have never thought about implementing a small display in some sort of standard way, thus my initial thought of using the Notification capability.

As you've shown above, implementing a simple http server on an ESP8266 is pretty simple, as is taking that data and displaying it on a screen.

It is good to have options!

1 Like

Well, this looks pretty awesome..... cheers! Maybe a new toy!

I take it this link would suffice?

https://www.amazon.co.uk/AZDelivery-Display-Pixels-Arduino-Raspberry/dp/B07VBY34FF/ref=sr_1_13?dchild=1&keywords=SSD1306&qid=1613089806&sr=8-13&th=1

or this:

https://www.amazon.co.uk/SSD1306-Self-Luminous-Display-Compatible-Raspberry-Blue-Yellow/dp/B08FD643VZ/ref=sr_1_17_sspa?dchild=1&keywords=SSD1306&qid=1613089806&sr=8-17-spons&psc=1&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUEyTDFEQlVIRzIxV0FJJmVuY3J5cHRlZElkPUEwMzY5NjY0M1VLMjRERUZaTUpHNSZlbmNyeXB0ZWRBZElkPUEwMDc1MTE1MlAzNlpPQkNaRFA1JndpZGdldE5hbWU9c3BfYnRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==

Also, could one of you crazy coder types take a crack at how to use webcore to send a variable to this display? I'm knackered now (past bed time!), but from what I understand from Chris's posts above, the display is kinda hard-coded into the code ...?

-=edit=-

ah, read it wrong. I guess you'd just need to get webcore to do a
http:///get?value=[nameofvariable]

=/edit=-

Again, this is looking awesome! Interested !!