Esphomelib - A comprehensive solution for using ESPs with Home Assistant

Having ordered a dozen Wemos boards plus some goodies a little over a week ago, and reading up on how to work with the ESP8266 boards, this add-on could not have come on a better moment! Having gone through all documentation I am really impressed Otto with what you created here.

As I have also ordered a dozen of SHT30 shields, I will test those and let you know how that works out.

For the SHT: Mine arrived two days ago and I fixed a minor bug. The fix is only in the latest dev version right now though: https://esphomelib.com/esphomeyaml/guides/faq.html#how-do-i-use-the-latest-bleeding-edge-version

Hi, I do have a bunch of Sonoff POW with its original firmware (no Tasmota) will this component work or not?

I’ve gotten the relay to turn on/off and the blue LED to turn on/off on a Sonoff Pow with the following setup. The energy sensor doesn’t work - esphomelib doesn’t yet have support for the HLW8012 chip the Pow uses. The Pow R2 uses a different energy sensor that also does not have support in esphomelib yet.

esphomeyaml:
  name: tv_outlet
  platform: ESP8266
  board: esp01_1m
  board_flash_mode: dout

wifi:
  ssid: 'xxxx'
  password: 'xxxx'

mqtt:
  broker: 'xxxx'
  username: 'xxxx'
  password: 'xxxx'

logger:

ota:

binary_sensor:
  - platform: gpio
    id: tv_outlet_button
    pin:
      number: GPIO0
      mode: INPUT_PULLUP
      inverted: True
    name: "TV Outlet Button"
    on_press:
      then:
        - switch.toggle:
            id: tv_outlet_relay

  - platform: status
    id: tv_outlet_status
    name: "TV Outlet Status"

switch:
  - platform: gpio
    id: tv_outlet_relay
    name: "TV Outlet Relay"
    pin: GPIO12

output:
  - platform: gpio
    id: basic_blue_led
    pin: GPIO15

light:
  - platform: binary
    id: tv_outlet_blue_led
    name: "TV Outlet Basic Blue LED"
    output: basic_blue_led
2 Likes

Does this only work with HassIO? I am using Hassbian.

In Hassbian this would be something like:

sudo apt-get update
sudo apt-get install python python-pip python-setuptools
pip install esphomeyaml

# Use dashboard
esphomeyaml <FOLDER_YOU_WANT_TO_STORE_CONFIGURATIONS_IN> dashboard

# Use command line
esphomeyaml livingroom.yaml wizard
1 Like

Apparently this was just released:

https://www.itead.cc/sonoff-ifan02-wifi-smart-ceiling-fan-with-light.html

It would be really awesome if esphomlib could support it. :wink:

1 Like

Buy it for @OttoWinter and see what happens :wink:

1 Like

I’d send a Sonoff Pow to @OttoWinter or anyone else (assuming they are in the US, don’t really want to have to deal with international shipping) if they can get support merged into esphomelib.

I can send a POW from Europe

This is just flashing it with different firmware to tasmota etc, as with all the other times you’ve asked… No flash, no fun :wink:

1 Like

That might just be able to be arranged…

@OttoWinter It might be useful to publish a grid somewhere that details why one should choose this over other custom firmware (like Tasmota). :+1:t2:

Don’t think it’s that simple.

Unless I’ve misunderstood what this is think of tasmota as one of those Lego kits that make a specific model but allow you to make some predefined choices if you want to. This, on the other hand, is more like the old fashioned Lego boxes of bits that you can do anything your imagination allows you with the added advantage of being able to do it all within the HA environment.

@OttoWinter is that right?

corrected …

1 Like

Sorry, had to take care of some personal stuff. But to answer all your questions :wink:

@finity re ifan02: I’m not an electrical engineer and from my past experience it would probably take my ages to find the RX/TX pins, get the variac in there working and so on + It’s pretty likely I would break the device in the process. So in the past, I pretty much just looked around on the Internet for existing guides, and then created my own photos and guide (like with the Sonoff S20 and 4CH). In this case, I’m also going to economise a little bit and just say: I’ll wait for the other projects to work through the difficulties with getting this device to work and then see myself if I can do this.

@jcollie re sonoff pow: Already ordered that one :slight_smile: - Besides, I think the shipping costs are in many cases even within Europe so high that buying a new device is almost as cheap. Then there comes the issue: what if I don’t get it to work, what if I break it during the process? As long as these devices are as cheap as they are here I don’t really have a problem with buying them myself - In most cases I can find a use-case for them in my own home anyway.

@Bobby_Nobble Correct! I would say feature-wise or by how many sensors/devices are supported other projects like espeasy or tasmota are in some cases even further than esphomelib. So when comparing features esphomelib would probably turn out to be the worse one :slight_smile: esphomelib’s focus is more on modularizing everything to an extreme - especially with the automation and template engine.

1 Like

Is there any documentation on configuration options for the add-on in Hass.io? The addon defaults to using my duckdns address when clicking the Open Web UI and won’t work unless I type my LAN address…

Great project. This was something I was waiting for. But I can’t seem to get it to upload on my RPI3 & Hassio ( clean install, latest version ). Errors I get are

ERROR [tornado.application] Exception in callback <functools.partial object at 0x7617ee10>
Traceback (most recent call last):
File “/usr/lib/python2.7/site-packages/tornado/ioloop.py”, line 759, in _run_callback
ret = callback()
File “/usr/lib/python2.7/site-packages/tornado/stack_context.py”, line 276, in null_wrapper
return fn(*args, **kwargs)
File “/usr/lib/python2.7/site-packages/tornado/ioloop.py”, line 780, in _discard_future_result
future.result()
File “/usr/lib/python2.7/site-packages/tornado/concurrent.py”, line 260, in result
raise_exc_info(self._exc_info)
File “/usr/lib/python2.7/site-packages/tornado/gen.py”, line 1113, in run
yielded = self.gen.send(value)
File “/usr/lib/python2.7/site-packages/esphomeyaml/dashboard/dashboard.py”, line 60, in redirect_stream
self.write_message({‘event’: ‘line’, ‘data’: data})
File “/usr/lib/python2.7/site-packages/tornado/websocket.py”, line 255, in write_message
message = tornado.escape.json_encode(message)
File “/usr/lib/python2.7/site-packages/tornado/escape.py”, line 81, in json_encode
return json.dumps(value).replace("</", “<\/”)
File “/usr/lib/python2.7/json/init.py”, line 244, in dumps
return _default_encoder.encode(obj)
File “/usr/lib/python2.7/json/encoder.py”, line 207, in encode
chunks = self.iterencode(o, _one_shot=True)
File “/usr/lib/python2.7/json/encoder.py”, line 270, in iterencode
return _iterencode(o, 0)
UnicodeDecodeError: ‘utf8’ codec can’t decode byte 0x9c in position 14: invalid start byte

@OttoWinter Thank you for such an amazingly complete project. Lots of documentation and examples. I have my first sensor up and reporting. I have a couple of questions.
There is a line in the mosquito report that shows debug.
env01/debug [D][sensor.dht:051]: Got Temperature=21.9°C Humidity=68.9%
Can this debug line be eliminated by a change in source or yaml?

Sadly I am in a Farenheight world. I am not sure where or how the filter / lamda conversion fits into the yaml for my sensor. The following doesn’t work.

sensor:
  - platform: dht
    pin: D2
    temperature:
      name: "Central  Temperature"
    humidity:
      name: "Central  Humidity"
    update_interval: 15s
    filters:
      - lambda: return x * (9.0/5.0) + 32.0;
    unit_of_measurement: "°F"

I think that if you have HA configured properly, HA will do the conversion for you.

homeassistant:
  unit_system: imperial

Is what I think enables this.