Seven segment display with ESP8266 and ESPEasy

Hi all,

I have couple of ESPEasy flashed ESP8266s with a temperature/humidity sensor attached to it, which are sending data to hass via MQTT.
I would now like to attach a 7-segment-display (eg. TM-1637) to the ESP8266 and display either the actual temperature (or humidity, or both alternating), but have no clue how to configure that in hass (wire setup seems to be clear from the explanation

Many thanks in advance,
Christian

If you are using ESPEasy, why involve Hass if you intend to display the data from the local sensor?

Maybe ask at https://www.letscontrolit.com/forum/? It looks to me like it will take a rules set to take the value from the environmental sensor and push it to the display via a command.

You could also look at this page maybe for more guidance. https://www.letscontrolit.com/wiki/index.php/Tutorial_Rules

I have not tried a 7 segment display, I use the Wemos OLED on my units.

1 Like

I would expect the command to look like this in the rules.

7dn,[Env#Temp]

Env being the name of the environmental sensor device and Temp being the name of the variable that contained the temperature.

Thanks, for exactly that purpose this might be the easiest solution, will ask over there…

But in general it would be interesting how to send data from hass and show it on the display…

[Edit] This is me asking the question at the let´s controll it forum: ESP8266 with DHT22 and seven-segment display - Let's Control It

Sending data from Hass is fairly easy. On HA one would use MQTT publish and on the ESPEasy box you would define a sniffer device and listen to a particular topic. I use this method to “broadcast” the outside temp and the feelslike temp to my units with displays.

Using the below settings, on the display one would display [sniff#Real] and [sniff#FeelsLike].

1 Like

Hello… I have couple of ESPEasy flashed ESP8266s with a temperature/humidity sensor (DHT22) attached to it. This sensor is the part of the PCB assembly itself which makes it a compact board and easy to use with programmer.
I would now like to attach a 7-segment-display to the ESP8266 and display either the actual temperature (or humidity, or both alternating), but have no clue how to configure that.

Hi Christian,

hope u dont mid the bump, but im curious to know if you had any luck with this?

I have been looking a lot around after an ESPHome / HA solution for the TM1637 7 segment display.

br
Peter

Hey Peter,

no, didn´t manage to find a solution and gave up…

Best,
Christian

ya, I could see that you dident have much luck here either: https://www.letscontrolit.com/forum/viewtopic.php?f=5&t=4845

thanks for your repply though - I’ll post here if I have any luck (cos it would really be nice to be able to connect a cheap TM1637 to an ESP32 and use it to get various status informaiton from HASSIO.

br Peter

Yeah, I had a look at the “rules” mentioned over there, but didn´t follow it up further.

Wishing you good luck!

try to have a look here: https://github.com/esphome/esphome/tree/dev/esphome/components/tm1637

looks like something could be happening in next release of esphome.

update:


…looks like the good people are still working on version 1.15.0 :grinning:

/Peter

1 Like

Hi, did you have any luck with this? I have put together a nodemcu with temp and humidity sensor with an 8 digit 7 segment display showing both, this was my first project and it works okay and reports into HA.I con’t get it to display time yet but this seems to be an library issue or my config, either way there does not seem to be much documentation on this.
Is this what you are looking to do and are you still stuck? If so happy to share my solution.
cheers

Jan

hi jan,

thanks for sharing. Im still waiting for esphome to bump up to version 1.15 with support for TM1637 (whitch i have a few of).before I continue with this project.

If you have an example for another display it would be nice to see the configuration so I can learn.

br Peter

Hi Peter,

This was my first little gadget, it is basically an 8 digit, 7 segment display soldered onto the same board as a DHT22 and a NodeMCU. And it all works. It cycles every 10 seconds between the time and the temp / humidity. It is hard wired onto a little board and to my eyes it looks quite cute. From here reporting back into HA is pretty much plug and play.

esphome:
  name: nodemcu1
  platform: ESP8266
  board: nodemcuv2

wifi:
  ssid: "<WiFi>"
  password: "<password>"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Nodemcu1 Fallback Hotspot"
    password: "e9Y3KkD2CVY2"

captive_portal:

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:

globals:
  - id: disp_time
    type: int
    restore_value: no
    initial_value: '1'

time:
  - platform: homeassistant
    id: homeassistant_time
    timezone: Europe/London
  - platform: sntp
    id: sntp_time

sensor:
  - platform: dht
    model: dht22
    pin:
      number: D2
      mode: INPUT_PULLUP
    temperature:
      name: "Den Temperature"
      id: "dentemp"
    humidity:
      name: "Den Humidity"
      id: "denhum"
    update_interval: 60s


# matrix Display
spi:
  clk_pin: D5
  mosi_pin: D7

display:
  - platform: max7219
    cs_pin: D8
    intensity: 5
    num_chips: 1
    lambda: |-
      static int state = 0;
      if (state == 0)
        it.printf("%.0fc %.0frh", id(dentemp).state, id(denhum).state);
      else
        it.strftime("  %H.%M", id(sntp_time).now());
      state = 1 - state;
    update_interval: 10s

I really like how easy it is to set stuff like this up in ESPhome, however it is so far behind the Arduino community on support and online documentation that I have decided to take the plunge and start again with C++ through the Arduino IDE, which supports ESP8266 boards as well the Arduino boards and clones. Much harder to pick up but most / all problems seem to have been solved and documented by someone so actually my rate of learning has been much quicker and less frustrating. And also, in the end, you know C++!

Your code helped!

I needed to display 3 values after one another, this is what I wrote and it works. It might not be the prettiest, but it could help someone.

sensor:
  - platform: dht
    model: DHT22
    pin: D2
    temperature:
      name: "Cellar temperature"
      id: "cellartemp"
    humidity:
      name: "Cellar humidity"
      id: "cellarhum"
    update_interval: 60s    
  - platform: max6675
    name: "Chimney temperature"
    id: "chimneytemp"
    cs_pin: D8
    update_interval: 60s

display:
    platform: tm1637
    id: tm1637_display
    clk_pin: D1
    dio_pin: D3
    inverted: true
    length: 4
    lambda: |-
      static int state = 0;
        if (state == 0) {
          it.print(0, "h");
          it.printf(1, "%.0fc", id(cellartemp).state);
          state = 1;
        }
        else if (state == 1) {
          it.print(0, "p");
          it.printf(1, "%.0f", id(cellarhum).state);
          it.print(3, "%");
          state = 2;
        }
        else {
          it.printf(0, "%.0f c", id(chimneytemp).state);
          state = 0;
        }
    update_interval: 5s
2 Likes