Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make OLED display work without wifi connection #6

Open
rradar opened this issue Aug 1, 2018 · 2 comments
Open

Make OLED display work without wifi connection #6

rradar opened this issue Aug 1, 2018 · 2 comments

Comments

@rradar
Copy link

rradar commented Aug 1, 2018

In my setup the display only works when there is a active wifi connection.

Would be nice to get a "offline" mode (probably without time and network stats) 馃憤

@mhaack
Copy link
Owner

mhaack commented Aug 2, 2018

@rradar feel free to create a PR :-) I think it should be possible, the main challenge might be related to Homie because this does all initialization, network & MQTT connect first. But it might be possible to use in offline mode as well.

@rradar
Copy link
Author

rradar commented Oct 23, 2018

hey @mhaack
I tried to build with homie but because I'm lacking any serious coding skills I failed silently.

But I did somehow rebuild your idea with the great esphomeyaml https://github.com/OttoWinter/esphomeyaml by @OttoWinter

It's working (right now with a BMP180 - so without humidity for now) including mqtt (with auto discovery for home assistant) and working OLED display - even when offline 馃槃

What's actually missing is your really nice and perfectly oled optimized screen animations, layout and icon set. Are you interested to contribute your work for this "mind fork"? 馃檪

here is my mqtt-bmp180-oled.yaml for a ESP-M3 (but works with all esp8266 and esp32 if you just edit platform/board and i2c ports in the sketch)

esphomeyaml:
  name: mqtt-bmp180-oled
  platform: ESP8266
  board: esp8288

wifi:
  ssid: 'xxx'
  password: 'xxx'

mqtt:
  broker: 'xxx'
  username: 'xxx'
  password: 'xxx'

# Enable logging
logger:

ota:
  password: 'xxx'

i2c:
  sda: 0
  scl: 2
  scan: False

binary_sensor:
  - platform: status
    name: "mqtt-bmp180-oled Status"
    id: status

sensor:
  - platform: wifi_signal
    name: "mqtt-bmp180-oled WiFi Signal"
    update_interval: 60s
    id: signal

  - platform: bmp085
    temperature:
      name: "mqtt-bmp180-oled Temperature"
      id: temperature
    pressure:
      name: "mqtt-bmp180-oled Pressure"
      id: pressure
    update_interval: 60s

switch:
  - platform: restart
    name: "mqtt-bmp180-oled Restart"

font:
  - file: "five.ttf"
    id: five8
    size: 8

time:
  - platform: sntp
    id: time
    servers:
      - 0.pool.ntp.org

display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    lambda:  |-
      it.printf(0, 10, id(five8), "Temp: %.1f Celsius", id(temperature).value);
      it.printf(0, 20, id(five8), "Pressure: %.1f hPa", id(pressure).value);
      it.strftime(0, 35, id(five8), "Time: %H:%M", id(time).now());
      it.strftime(0, 45, id(five8), "Date: %d.%m.%Y", id(time).now());
      it.printf(0, 60, id(five8), "Wifi: %s", id(status).value ? "Online" : "Offline");
      it.printf(80, 60, id(five8), "%.1f", id(signal).value);

Looks like this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants