Esphomelib - A comprehensive solution for using ESPs with Home Assistant

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.

I do have that in my config but I have always need to make a conversion.

@OttoWinter i use hassio, and i try do clean some mqtt topics, i saw this

To fix this, esphomeyaml has a simple helper script that purges stale retained messages for you:

esphomeyaml configuration.yaml clean-mqtt
This will remove all retained messages with the topic <DISCOVERY_PREFIX>/+/NODE_NAME/#. If you want to purge on another topic, simply add --topic <your_topic> to the command. 

But i dont understand how to to use that “script” , how i can deleted the mqtt retained messages?? can you explain me. sorry for the question.

I noticed my snapshots triple in size and it was due to the esphomeyaml folder. I can’t delete it from Samba because I don’t have authorization even though I log in through Samba. Any way to delete the folder?

@talondnb Well there are no configuration options ATM :stuck_out_tongue: Also, the clicking on “Open Web UI” button issue is because of HassIO - besides just create a bookmark in the browser of your choice and the problem c be gone.

@pcl Hmm, do you happen to have any “œ” characters in your configuration. And which version are you running, I think it should have been fixed in 1.6.2

@zarthan Well you want to apply a filter to the temperature, right? Then maybe put the filter into the temperature section like so :wink:

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

@Rodolfo_Vieira That script doesn’t currently exist in the HassIO add-on sorry. But if you log into the HassIO container with the SSH add-on you should be able to install the Python package like in the blog post.

@maxdaniel Yeah the problem is that platformio’s build files can sometimes be humongous - and can not easily be cleaned. I don’t know why it doesn’t work from sambda (seeing this too now), but executing this from the SSH add-on works for me:

cd /config/esphomeyaml
rm -rf <NODE_NAME>/

@OttoWinter : Thanx for the reply much appreciated. Running 1.6.2 on a clean installed Hassio. I’m not aware of any off characters in my configuration. Just worked my way thru the livingroom example and this is the result.

If I can help you out with some log files just let me know. Happy to oblige.

Yeah weird how it’s not able to delete it. Thanks for the answer, will try deleting from ssh! Also thanks for the Esp add-on! First time I got it to work with almost no effort.

Many thanks! Once I saw your post it became very obvious. ;-D

I’m having issues with OTA; I’ve flashed using USB successfully and can see the binary sensors I’ve added in HA (and can trigger them by shorting some GPIO). When attempting OTA I get the following:

INFO [esphomeyaml.espota] Sending invitation to alarm_panel.local
ERROR [esphomeyaml.espota] Failed
ERROR [esphomeyaml.espota] Host alarm_panel.local Not Found

Any idea?

does

ping alarm_panel.local

work?

No, that was the first thing I tested.

On searching the forums it looks to be a common issue? I’m using SSL through duckdns, not sure if that has any impact. Resolv.conf also doesn’t list anything…

Try using a static IP for the node, that should always work: https://esphomelib.com/esphomeyaml/components/wifi.html

Thanks, I will give that a try. I have already reserved the IP via DHCP but will try the static.