Documentation: https://esphome.io/
For issues, please go to the issue tracker.
For feature requests, please see feature requests.
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Home Page: https://esphome.io/
License: Other
Documentation: https://esphome.io/
For issues, please go to the issue tracker.
For feature requests, please see feature requests.
While trying to build a weather station with several sensors,
I found this one to be a worthy addition: https://www.amazon.de/Eltako-Windsensor-WS/dp/B0018LBFG8
There is also a ready .ino file in this repo: https://github.com/sbiermann/esp8266-anemometer/blob/master/esp8266-anemometer.ino
Would this be possible to add to esphomelib/esphomeyaml?
I have create 2 yaml files for my sonoff modules but when I press compile or validate buttons I get a terminated process message and nothing is done. I have not attached the module yet to flash because I want to migrate from Tasmota to this.
My yaml file looks like this:
esphomeyaml:
name: Sonoff2
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
wifi:
ssid: 'XXXXXXXXX'
password: 'XXXXXXXXXXX'
mqtt:
broker: 'XXXX.XXXXXXXXXXXX.XXX'
username: ''
password: ''
# Enable logging
logger:
ota:
password: 'XXXXXX'
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "Sonoff Basic Button"
- platform: status
name: "Sonoff Basic Status"
switch:
- platform: gpio
name: "Sonoff Basic Relay"
pin: GPIO12
output:
- platform: esp8266_pwm
id: basic_green_led
pin: GPIO13
inverted: True
light:
- platform: monochromatic
name: "Sonoff Basic Green LED"
output: basic_green_led
Hey!
I would like to integrate the RCSwitch library into esphomeyaml, to use its TriState functionality for 433mhz based wall plugs.
I HAVE seen the built in functionality for 433mhz of esphomeyaml but it wasnt able to satisfy me, as the RAW type of the data is quite hard to handle compared to basic TriState encoding. And the RCSwitch lib is working like a charm for over two years now and the wheel shouldn't need to be reinvented.
So I just thought I should be able to reimplement the RemoteTransmitterSwitch using it, but this seems to be harder than thought due to a total lack of documentation. I was unable to find anything about custom output components or at least a reference implementation of an output component.
I imagine the result as follows:
#File: home.yaml
#[...]
switch:
- platform: rc_switch
name: "bedroom_lamp"
on_tristate: "F0FF00FFFF0F" #example TriState value to turn on
off_tristate: "F0FF00FFFFF0" #example TriState value to turn on
rc_switch:
pin: D7
protocol: 1 #optional: RCSwitch.setProtocol()
pulse_length: 305 #optional: RCSwitch.setPulseLength()
So what would be the right way of doing this?
how can i change the icon, i try:
`light:
but it doesnt work, it cant validate
At the moment, esphomeyaml is not very extensible: once you need some functionality that isn't shipped by default, you have to dive into the c++ code - which in itself is fine - but the problem is that this doesn't play well with the generated code: as far as I can see, there's no way to register a custom component. Creating a custom component instance in the cpp file and referencing from YAML isn't possible either because it doesn't find that ID.
For example, I'm trying to make a light that flashes when turned on. This is pretty easy to achieve in c++ code, but turns out to be very hard to integrate with esphomeyaml. I'd want to make a custom output component that turns on and off repeatedly, as long it's enabled; pretty simple. However, I'd also like to use this as the output for a light component, configuring this in the YAML file; this doesn't seem to be possible.
I see 2 possible solutions (maybe to be used together):
Just using latest version of tool. I have done following configuration file for my Sonoff basic:
esphomeyaml:
name: sdb_light
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
wifi:
ssid: 'myssid'
password: 'mywifipass'
mqtt:
broker: '192.168.1.8'
username: 'mymqttlogin'
password: 'mymqttpass'
# Enable logging
logger:
ota:
switch:
- platform: gpio
name: "SDB Lumière"
pin: GPIO12
Configuration likes that works perfectly ! If I add the web component, as soon as I play one or two times with the on/off button in web interface the ESP crashes !
Vincèn
Is there any way to declare and initialize variables that can be used by the lambda? It'd be easy enough to drop into the c++ code to do this, I'm wondering if there's a way to do it from pure YAML.
I have a very simple garage door opener that works as follows:
I have a relay wired up to the button contacts, and have simple close
and open
scripts in Home Assistant that trigger relay toggles 1 second apart - once to open or twice to close.
I'd like to convert this over to the cover
model. However, I need a small state machine to determine how to open or close the door given its previous direction of motion. This could probably be accomplished with a lambda and a variable to store which way it was last moving.
I am getting this stacktrace while compiling the code below using the Docker container:
File "/usr/local/bin/esphomeyaml", line 11, in <module>
load_entry_point('esphomeyaml', 'console_scripts', 'esphomeyaml')()
File "/usr/src/app/esphomeyaml/__main__.py", line 287, in main
exit_code = write_cpp(config)
File "/usr/src/app/esphomeyaml/__main__.py", line 125, in write_cpp
get_variable(None)
File "/usr/src/app/esphomeyaml/helpers.py", line 325, in get_variable
func(config)
File "/usr/src/app/esphomeyaml/components/binary_sensor/gpio.py", line 16, in to_code
rhs = App.make_gpio_binary_sensor(config[CONF_NAME], exp_gpio_input_pin(config[CONF_PIN]))
File "/usr/src/app/esphomeyaml/helpers.py", line 428, in exp_gpio_input_pin
return exp_gpio_pin_(GPIOInputPin, conf, u'INPUT')
File "/usr/src/app/esphomeyaml/helpers.py", line 407, in exp_gpio_pin_
conf[CONF_INVERTED])
KeyError: 'inverted'
pcf8574:
- id: pcf8574_hub
address: 0x20
binary_sensor:
- platform: gpio
pin:
pcf8574: pcf8574_hub
number: 0
mode: INPUT
name: Pin0
inverted: False
Build fails with and without the inverted
parameter.
Hi,
A feature request: What do you think about multiwifi - There is a ESP Lib where you can configure several wifi ssids and the strongest will be selected (or based on some priority). I use this to connect espnodemcus at home and at your makerspace.
Following some best practices, i have separated my IoT Devices into a separate VLAN, which also has a separate SSID in my Wifi access point. I don't want to impute writing malicious code to you, @OttoWinter , but it was easier for me to put the ESPs into this VLAN as well, for firewall ruling and similar actions.
To cut a long story short: Another VLAN is another broadcast domain, so the resolving of .local during OTA process is failing. The ESP host itself is pingable via its IP address and even via internal DNS, since i specified an entry for it. So it would be great to have an option in the YAML file to specify a specific IP address or hostname for OTA, so that esphomeyaml isn't sending the invitation to .local but merely to the specified IP address.
If one does not explicitly specify this option, trying .local would be a good fallback option.
On a somehow related side note: Is port 13564 for the OTA server to listen on a fixed value? I need to specify a firewall rule to enable talkback from the IoT VLAN to the VLAN where my desktop PC resides.
Checking to see how to update to the current release with both cli install and HASSIO addon?
With CLI when I rerun the pip install it does not update to the current release.
Hi,
I'm trying to add the remote_receiver to sniff some 433mhz remote control signals with a nodemcu-32s.
But, as soon as I add the remove_receiver component, esphomeyaml won't build.
Here is the errors I got:
<command-line>:0:16: warning: ISO C++11 requires whitespace after the macro name
In file included from .piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp:10:0:
.piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp: In member function 'virtual void esphomelib::remote::RemoteReceiverComponent::setup()':
.piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp:155:77: error: 'esp_err_to_name' was not declared in this scope
ESP_LOGE(TAG, "Configuring RMT remote failed: %s", esp_err_to_name(error));
^
.piolibdeps/esphomelib/src/esphomelib/log.h:124:130: note: in definition of macro 'esph_log_e'
#define esph_log_e(tag, format, ...) esp_log_printf_(ESPHOMELIB_LOG_LEVEL_ERROR, tag, ESPHOMELIB_LOG_FORMAT(tag, E, format), ##__VA_ARGS__)
^
.piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp:155:5: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "Configuring RMT remote failed: %s", esp_err_to_name(error));
^
.piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp:162:76: error: 'esp_err_to_name' was not declared in this scope
ESP_LOGE(TAG, "Installing RMT driver failed: %s", esp_err_to_name(error));
^
.piolibdeps/esphomelib/src/esphomelib/log.h:124:130: note: in definition of macro 'esph_log_e'
#define esph_log_e(tag, format, ...) esp_log_printf_(ESPHOMELIB_LOG_LEVEL_ERROR, tag, ESPHOMELIB_LOG_FORMAT(tag, E, format), ##__VA_ARGS__)
^
.piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp:162:5: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "Installing RMT driver failed: %s", esp_err_to_name(error));
^
.piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp:168:81: error: 'esp_err_to_name' was not declared in this scope
ESP_LOGE(TAG, "Getting RMT ringbuf handle failed: %s", esp_err_to_name(error));
^
.piolibdeps/esphomelib/src/esphomelib/log.h:124:130: note: in definition of macro 'esph_log_e'
#define esph_log_e(tag, format, ...) esp_log_printf_(ESPHOMELIB_LOG_LEVEL_ERROR, tag, ESPHOMELIB_LOG_FORMAT(tag, E, format), ##__VA_ARGS__)
^
.piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp:168:5: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "Getting RMT ringbuf handle failed: %s", esp_err_to_name(error));
^
.piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp:174:81: error: 'esp_err_to_name' was not declared in this scope
ESP_LOGE(TAG, "Starting RMT for receiving failed: %s", esp_err_to_name(error));
^
.piolibdeps/esphomelib/src/esphomelib/log.h:124:130: note: in definition of macro 'esph_log_e'
#define esph_log_e(tag, format, ...) esp_log_printf_(ESPHOMELIB_LOG_LEVEL_ERROR, tag, ESPHOMELIB_LOG_FORMAT(tag, E, format), ##__VA_ARGS__)
^
.piolibdeps/esphomelib/src/esphomelib/remote/remote_protocol.cpp:174:5: note: in expansion of macro 'ESP_LOGE'
ESP_LOGE(TAG, "Starting RMT for receiving failed: %s", esp_err_to_name(error));
^
*** [.pioenvs/remoteliving/libf8d/esphomelib/esphomelib/remote/remote_protocol.cpp.o] Error 1
And here is my configuration file:
esphomeyaml:
name: remoteliving
platform: ESP32
board: nodemcu-32s
wifi:
ssid: '<redacted>'
password: <redacted>'
mqtt:
broker: '<redacted>'
username: '<redacted>'
password: '<redacted>'
logger:
ota:
remote_receiver:
pin: GPIO32
dump: all
I already tried:
What else could I try? Thanks for your help!
(And this greeeaaat tool!)
I'm using bestlibre nginx to map ports to sub domains and have proper certificates. Unfortunately it seems the ws connection when compiling is not secure or not taking into account that it's running on secure when trying to connect back.
I get a warning in chrome and then nothing happens when compiling. Is there a way to get around this?
I was able to get it to work with a local ip behind nginx. I guess it's not such a good idea to expose it through nginx as it doesn't have authentication.
Hi
Do you plan to be able to trigger some automations on some input.switch ? I have sonoff devices and I'd like to program them so one of the LEDs on it reflects the state of the relay ;)
Thanks
After i upgraded to 1.7 my bme280 starts to report incorrect value, ad ex:
[sensor.bme280:193]: Got temperature=0.7°C pressure=258601.6hPa humidity=14.3%
reverting to 1.6.2 resolve the issue:
[sensor.bme280:193]: Got temperature=24.7°C pressure=1012.0 hPa humidity=64.3%
When a user enters a device name with upper-case characters, it fails to validate or compile. But since the plugin doesn't appear to have a way to go back and edit the file, they will have to go to a configuration editor or jump over to command line to fix it.
The failure could be avoided in the first place if ESPhomeYAML did a first pass simple validation on the input field in initial config, or else did an automatic conversion to lower-case.
The BMP280 is the "cheaper/simpler" version of the BME280 which is already supported.
Thanks in advance.
Please add an inverted option to (GPIO) switch, similar to (GPIO) output.
Hi,
I'm very interested in your project. I'm wondering if esphomeyaml can be used with common hardware like sonoffS20 plug or arilux al-lc03 led driver ?
I'm an intensive user of home Assistant (and sometimes a contributor) and I'm looking for an easy way to convert and update my hardware. For now I'm using the tasmota firmware.
Trying to set my first sensor with esphomeyaml, I'm creating a dallas component base yaml file.
When trying to compile, I have the following error:
PackageManager: Installing toolchain-xtensa32 @ ~2.50200.0
Error: Could not find a version that satisfies the requirement '~2.50200.0' for your system 'linux_armv7l'
yaml file:
esphomeyaml:
name: capteur_piscine
platform: ESP32
board: lolin32
wifi:
ssid: '####'
password: '#####'
mqtt:
broker: '192.168.1.28'
username: '####'
password: '####'
# Enable logging
logger:
ota:
password: '#######'
# Example configuration entry
dallas:
- id: dallas_hub1
pin: 4
# Individual sensors
sensor:
- platform: dallas
dallas_id: "dallas_hub1"
address: 0x28FF88A9C117049C
resolution: 10
name: "Température Piscine"
Hardware/Software:
It would be nice to have the build output path configurable, so one can put all build output folders in a seperate folder, to streamline folder structure. this would also help ignoring the build output folders in gitignore files.
current situation:
would like to change it to:
I think these would need another config property and changes to these method:
https://github.com/OttoWinter/esphomeyaml/blob/a04438e92434fcc472ebfce5a1d923630ec012c6/esphomeyaml/__main__.py#L27
The example specifies both lambda
and optimistic
, which is not allowed:
cover.template:
- Invalid config for [cover.template]: Cannot specify more than one of lambda, optimistic.
Additionally, the generated c++ code (if I remove optimistic
) does not seem to be valid:
binary_sensor:
- platform: gpio
id: garage_door
device_class: garage_door
name: Garage Door
pin:
number: 12
inverted: False
mode: INPUT_PULLUP
switch:
- platform: gpio
id: garage_door_switch
name: Garage Door Switch
pin: 27
cover:
- platform: template
id: garage_door_opener
name: "Garage Door Opener"
lambda: >-
if (id(garage_door).value) {
return cover::COVER_CLOSED;
} else {
return cover::COVER_OPEN;
}
open_action:
- switch.turn_on:
id: garage_door_switch
- delay: 1s
- switch.turn_off:
id: garage_door_switch
close_action:
- switch.turn_on:
id: garage_door_switch
- delay: 1s
- switch.turn_off:
id: garage_door_switch
- delay: 1s
- switch.turn_on:
id: garage_door_switch
- delay: 1s
- switch.turn_off:
id: garage_door_switch
stop_action:
- switch.turn_on:
id: garage_door_switch
- delay: 1s
- switch.turn_off:
id: garage_door_switch
results in:
Compiling .pioenvs/garage/src/main.cpp.o
src/main.cpp: In function 'void setup()':
src/main.cpp:24:26: error: expected unqualified-id before '->' token
template_cover.template->set_state_lambda([=]() {
^
*** [.pioenvs/garage/src/main.cpp.o] Error 1
from the following code:
auto template_cover = App.make_template_cover("Garage Door Opener");
auto gpio_switch = App.make_gpio_switch("Garage Door Switch", 27);
auto *garage_door_switch = gpio_switch.switch_;
auto gpio_binary_sensor = App.make_gpio_binary_sensor("Garage Door", GPIOInputPin(12, INPUT_PULLUP, false));
auto *garage_door = gpio_binary_sensor.gpio;
garage_door->set_device_class("garage_door");
template_cover.template->set_state_lambda([=]() {
if (garage_door->value) {
return cover::COVER_CLOSED;
} else {
return cover::COVER_OPEN;
}
});
Hi,
Apparently the current Docker image generates a PlatformIO dependency on
https://github.com/OttoWinter/esphomelib.git#v1.4.0 instead of 1.5.0.
$ docker pull ottowinter/esphomeyaml
Using default tag: latest
latest: Pulling from ottowinter/esphomeyaml
Digest: sha256:a0698ee356ea1335ea50a68ee9c9dbdbdddace906c47e85ab12fd167e3added3
Status: Image is up to date for ottowinter/esphomeyaml:latest
Using the OTA update with command line argument to indicate specific IP of my ESP, it uploads successfully the firmware file in OTA but then turns in serial mode for logs instead of doing it through IP (don't know if it's possible) or then close the process and that's it ;)
12:53:25 [DEBUG]: Options: {'esp_ip': '192.168.1.152', 'host_port': 53445, 'image': '.pioenvs/led_strips/firmware.bin', 'host_ip': '0.0.0.0', 'auth': '', 'esp_port': 8266, 'spiffs': False, 'debug': True, 'progress': True}
12:53:25 [INFO]: Starting on 0.0.0.0:53445
12:53:25 [INFO]: Upload size: 384880
Sending invitation to 192.168.1.152
12:53:25 [INFO]: Waiting for device...
Uploading: [============================================================] 100% Done...
12:53:38 [INFO]: Waiting for result...
12:53:38 [INFO]: Result: OK
================================================================ [SUCCESS] Took 15.16 seconds ================================================================
INFO [esphomeyaml.__main__] Successfully uploaded program.
INFO [esphomeyaml.__main__] Starting log output from 192.168.1.152 with baud rate 115200
Traceback (most recent call last):
File "/usr/local/bin/esphomeyaml", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/__main__.py", line 463, in main
return run_esphomeyaml(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/__main__.py", line 453, in run_esphomeyaml
return POST_CONFIG_ACTIONS[args.command](args, config)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/__main__.py", line 325, in command_run
return show_logs(config, args, port, escape=args.escape)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/__main__.py", line 218, in show_logs
run_miniterm(config, port, escape=escape)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/__main__.py", line 103, in run_miniterm
with serial.Serial(port, baudrate=baud_rate) as ser:
File "/usr/local/lib/python2.7/dist-packages/serial/serialutil.py", line 240, in __init__
self.open()
File "/usr/local/lib/python2.7/dist-packages/serial/serialposix.py", line 268, in open
raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port 192.168.1.152: [Errno 2] No such file or directory: '192.168.1.152'
Hey folks!
esphomeyaml is a great way of managing the functionality of a single device, but quickly fails when trying to manage a bigger fleet of devices.
Split the configuration into templates and instances, generate the final code for each instance
As long as the number of ESP's stays quite low, it's no problem to duplicate the .yaml
for every single ESP.
But as I plan to deploy in massive scale (30+ hardware equal devices), this is no option because of the following reasons:
To solve this, I suggest a templating system for the configuration files. The idea is stolen from proved templating systems used in web-development. (e.g. Handlebars, mustache, etc.)
The idea is the following:
The configurations gets split into a template, and into instances. The template describes, how all devices together are and the instances contain specific data about a single device.
Instead of creating a single .yaml
-file for the configuration, it gets a folder. This could look as follows:
Configuration of hardware type "wifi_socket":
Folder name: .../home/wifi_socket/
. where home
is the root of all hardware types, wifi_socket
an example hardware type
Contents:
wifi_socket.yaml
: Basically a regular esphomeyaml-config, the same way as it is right now, but on steroides: Everything that is device specific, gets replaced by {{ placeholder }}
. For example:# kitchensocket1.yaml
esphomeyaml:
name: "Kitchen Socket #1"
gets:
# wifi_socket.yaml
esphomeyaml:
name: "{{ name }}"
At this point, the template is a general state, describing the whole fleet at once. To create the code for the specific instances, there are seperate .yaml
-files:
/wifi_socket.yaml
/instances/
/kitchensocket1.yaml
/kitchensocket2.yaml
/tvsocket.yaml
/... .yaml
Each of these files contain simple key-value mappings, of the placeholders of the template:
# kitchensocket1.yaml
name: "Kitchen Socket #1"
# (...)
Finally, for every instance, the specific values get merged into the final .yaml-file in memory and compiled to the code folder, the same way, esphomeyaml already does, just into it's own folder:
/wifi_socket.yaml
/instances/
/kitchensocket1.yaml
/kitchensocket2.yaml
/tvsocket.yaml
/dist
/kitchensocket1/
/lib
/src
/platformio.ini
/kitchensocket2/
/tvsocket/
This system has several advantages:
I really hope at least one person understands my idea lol .. or at least read until this point.
The implementation could be put into the esphomeyaml python app, or wrapped around it using a new application, or esphomeyaml could even be changed into an API, providing the ability to script on top of it.
Hi!
Inspired by this Twitter thread I have done some rough sketches for what I think would make a nice logo, or, rather a starting point. They are pretty straightforward in their metaphor (a stylised ESP8266 as mounted on the NodeMCU in varying degrees of abstraction + a house) but I think the simplicity works rather well.
I really liked @OttoWinter's idea to work with the chip's antenna, as it is quite a distinct feature, however I am also drawn to no.1 visual simplicity. Maybe someone will be inspired to a eureka moment by one of these.
Note that I kept the name esphomelib for now, as @OttoWinter is still thinking about the name.
Cheers
Have an option in the web UI to remember both your MQTT Broker details and the details for the Wifi, I think this could get pretty repetitive if you have a whole bunch of esp devices to set up. Perhaps even if we were able to give them a "default value" that might be suitable? Thanks
I want to make an IR transmitter with the following yaml code:
switch: - platform: ir_transmitter name: "ON/OFF" raw: carrier_frequency: 38kHz data: - 1300 - -300 - 1300 - -300 - 300 - -1300 - 300 - -1300 - 300
It's translated into the following C code by esphomeyaml:
auto *switch__switch = App.register_component(switch__irtransmittercomponent->create_transmitter("ON/OFF", switch_::ir::SendData::from_raw({ 1300, -300, 1300, -300, 300, -1300, 300, -1300, 300, }, 38000)));
But I get this error at compile time:
src/main.cpp: In function 'void setup()': src/main.cpp:28:11: error: no matching function for call to 'esphomelib::switch_::ir::SendData::from_raw(, int)' }, 38000))); ^ src/main.cpp:28:11: note: candidate is: In file included from .piolibdeps/esphomelib/src/esphomelib/application.h:63:0, from src/main.cpp:2: .piolibdeps/esphomelib/src/esphomelib/switch_/ir_transmitter_component.h:108:19: note: static esphomelib::switch_::ir::SendData esphomelib::switch_::ir::SendData::from_raw(std::vector&, uint32_t) static SendData from_raw(std::vector &raw_data, uint32_t carrier_frequency); ^ .piolibdeps/esphomelib/src/esphomelib/switch_/ir_transmitter_component.h:108:19: note: no known conversion for argument 1 from '' to 'std::vector&' *** [.pioenvs/device1/src/main.cpp.o] Error 1
Tried compliling for esp8266, nodemcuv2 or d1_mini
The last few lines are;
Linking .pioenvs/test/firmware.elf
Building .pioenvs/test/firmware.bin
Segmentation fault (core dumped)
*** [.pioenvs/test/firmware.bin] Error 139
Some of my ESP's are running on battery. It would be nice do add a sensor which returns the voltage of the power supply.
More info on; https://arduino-esp8266.readthedocs.io/en/2.4.1/libraries.html?highlight=getVcc#esp-specific-apis
According to documentation we can use both parameters:
To use deep_sleep first specify how long the node should be active, i.e. how long it should check sensor values and report them, using the run_duration and run_cycles options. If you use both in your configuration, any time either one of them is finished, the node will go into deep sleep mode.
In my case:
esphomeyaml:
name: capteur_piscine
platform: ESP32
board: lolin32
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
mqtt:
broker: '192.168.1.28'
username: !secret mqtt_username
password: !secret mqtt_password
# Enable logging
logger:
ota:
password: !secret ota_password
# Example configuration entry
dallas:
- id: dallas_hub1
pin: 4
update_interval: 1s
# Individual sensors
sensor:
- platform: dallas
dallas_id: "dallas_hub1"
address: 0x9C0417C1A988FF28
name: "Température Piscine"
icon: "mdi:oil-temperature"
expire_after: "1:02"
availability:
deep_sleep:
run_duration: 20s
run_cycles: 15
sleep_duration: 1h
Seems to not work, the node go to deep sleep before the first cycle.
Hi,
I’m trying to use a JSON string in Birth and LWT payloads but getting an error regarding
Mqtt: - Invalid config for [mqtt]: string value cannot be dictionary or list.
Is there some way of getting this to work?
Using a BME280 with the following configuration is not able to retrieve the humidity.
i2c:
sda: 21
scl: 22
scan: False
sensor:
- platform: bme280
temperature:
name: "Temperature"
oversampling: 16x
pressure:
name: "Pressure"
humidity:
name: "Humidity"
address: 0x76
update_interval: 15s
Debug:
[C][sensor.bme280:095]: Setting up BME280...
[C][sensor.bme280:096]: Address: 0x76
[C][sensor.bme280:126]: Temperature Oversampling: 16x
[C][sensor.bme280:127]: Pressure Oversampling: 16x
[C][sensor.bme280:128]: Humidity Oversampling: 16x
[C][sensor.bme280:129]: IIR Filter: OFF
[...]
[D][sensor.bme280:177]: Got temperature=26.0°C pressure=952.6hPa humidity=0.0
[D][sensor.mqtt:038]: 'Temperature': Pushing out value 25.980000 with accuracy 1
[D][sensor.mqtt:038]: 'Pressure': Pushing out value 952.551331 with accuracy 1
[D][sensor.mqtt:038]: 'Humidity': Pushing out value 0.000000 with accuracy 1
Sorry, I have only one of those sensors at hand at the moment.
Just updated to 1.6.0 and tried to start the dashboard. Got a stack trace instead:
Traceback (most recent call last):
File "/home/media/django/bin/esphomeyaml", line 11, in <module>
sys.exit(main())
File "/home/media/django/local/lib/python2.7/site-packages/esphomeyaml/__main__.py", line 437, in main
return run_esphomeyaml(sys.argv)
File "/home/media/django/local/lib/python2.7/site-packages/esphomeyaml/__main__.py", line 414, in run_esphomeyaml
return PRE_CONFIG_ACTIONS[args.command](args)
File "/home/media/django/local/lib/python2.7/site-packages/esphomeyaml/__main__.py", line 318, in command_dashboard
from esphomeyaml.dashboard import dashboard
File "/home/media/django/local/lib/python2.7/site-packages/esphomeyaml/dashboard/dashboard.py", line 30, in <module>
class EsphomeyamlCommandWebSocket(tornado.websocket.WebSocketHandler):
NameError: name 'tornado' is not defined
Works fine after installing tornado.
I realized that some Arilux devices run on ESP8285 (like my Arilux AL-LC03) and not on ESP8266. Is there any support on the roadmap ?
IM running Home Assistant on Raspberry PI, and Ive carried out the install, using the command
pip install esphomeyaml
When i run esphomeyaml livingroom.yaml wizard
I recieve a notification that esphomeyaml cannot be found.
I know this is probably a basic issue, but its not one i know how to resolve.
Hi
I'm using these Wifi LED strips controler based on ESP:
It's fairly basic and use one GPIO for each color (R/G/B). Is it me or it's a little overcomplicated for basic control as I need to declare each color output like that:
output:
- platform: gpio
pin: 25
id: 'color_red'
and then:
light:
- platform: rgb
name: "Living Room Lights"
red: color_red
green: color_green
blue: color_blue
Isn't it possible to directly declare GPIO in light platform ?
Thanks
Vincèn
Would be nice if one could make REST calls to directly send commands to devices which accept those (e.g. hue bridge).
Using hassio addon 1.6.2 after run the wizard for nodemmcu esp8266 12e i get the following error
esphomeyaml:
name: termoacumulador
platform: ESP8266
board: esp12e
[API] ConnectionError: HTTPConnectionPool(host='api.platformio.org', port=80): Max retries exceeded with url: /v2/lib/search?query=name%3A%22ArduinoOTA%22 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f6a96761150>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution',)) (incremented retry: max=5, total=5)
Hi, i've installed new 1.7 release but when i configure availability in mqtt as documented:
mqtt:
broker: 'xxx.xxx.xxx.xxx'
username: 'xxxx'
password: 'xxxxx'
availability:
when i compile it returns me the following error:
Failed config
mqtt:
- Invalid config for [mqtt]: [availability] is an invalid option for [mqtt]. Check: mqtt->availability.
It would be super awesome if esphomeyaml
could announce itself as an iBeacon via BLE.
This would allow iOS (Owntracks, mostly) to track positions in greater detail
The name.local doesn't work for me unless I add my sensors to the hosts file of the docker container. It would be nice to specify the IP address of the device as a fallback when that doesn't work.
Hi
Simple question!
Can you put some kind off authentication on esphomeyaml Dashboard ?
Thanks
First off thank you for your amazing work in creating this.
Secondly I have a slight issue/feature recommendation. I am using an esp8266 to control the led drivers powering my reef lights over mqtt using HA, but the issue is the wifi signal there is pretty weak. So if the Esp loses wifi it turns off the lights within seconds.
So is it possible to just keep the last mqtt value until it gets wifi instead of turning the leds off.
Also was not entirely sure if to post this here or esphomelib.
Home Assistant running in python virtual enviroment on Hassbian on PI3, Python 3.5.3
how to install??
I have some problems with setting up a DHT22 sensor. After making sure that the hardware is fine, it is definitely a software issue. I dug into some files, and noticed the following. This is the sensor definition in the YAML:
sensor:
- platform: dht
pin: D4
model: DHT22
temperature:
name: "Schlafzimmer Temperatur"
humidity:
name: "Schlafzimmer Luftfeuchtigkeit"
update_interval: 15s
The pin ist set to D4, as this is the official D1 mini DHT22 shield. Unfortunately, after compiling the firmware, i only get NaN
values, so i looked in the generated code. The DHT22 sensor is set up like following:
auto dht_sensor = App.make_dht_sensor("Schlafzimmer Temperatur", "Schlafzimmer Luftfeuchtigkeit", 0, 15000);
dht_sensor.dht->set_dht_model(DHT::DHT22);
If i interpret esphomelib's API documentation correctly, the third argument of make_dht_sensor
should be the sensor's pin - which is set to 0, contrary to the YAML's definition of D4. The documentation of esphomeyaml looks like that one has to specify D4
and not only 4
. However, i have noticed that, if i specify 4
as the pin, it is correctly parsed and written in the source file - but, of course, the ESP fails to communicate with the DHT due to the wrong pin.
So, either i have not fully understood the config file format (especially after taking a look at pins.py
) or there is a bug...?
I am running ephomeyaml in docker and upload using native platformio:
docker run --rm -v "`pwd`":/config -it ottowinter/esphomeyaml livingroom.yaml compile
platformio run -d livingroom -t upload
The first step compiles everything while the second compiles it again. It would be nice to have a 'generate' command that only generates the cpp code in the first step.
To simplify OTA updates when node is not easy reachable (for using usb or clicking reset button), let the commands esphomeyaml config.yaml run/upload
wait at least the duration of deep sleep mode to be sure to catch the wake up window.
Alternative solution: using a mqtt message to disable deep sleep mode and wait for OTA.
Hi
I get the following error every time with the dht.
[21:37:51][C][sensor.mqtt:025]: Setting up MQTT Sensor '2'...
[21:37:51][C][sensor.mqtt:027]: Expire After: 675s
Traceback (most recent call last):
File "/usr/local/bin/esphomeyaml", line 11, in
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/main.py", line 458, in main
return run_esphomeyaml(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/main.py", line 448, in run_esphomeyaml
return POST_CONFIG_ACTIONS[args.command](args, config)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/main.py", line 320, in command_run
return show_logs(config, args, port, escape=args.escape)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/main.py", line 216, in show_logs
escape=escape)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/mqtt.py", line 65, in show_logs
return initialize(config, [topic], on_message, username, password, client_id)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/mqtt.py", line 36, in initialize
client.loop_forever()
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 1481, in loop_forever
rc = self.loop(timeout, max_packets)
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 1003, in loop
rc = self.loop_read(max_packets)
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 1284, in loop_read
rc = self._packet_read()
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 1849, in _packet_read
rc = self._packet_handle()
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 2305, in _packet_handle
return self._handle_publish()
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 2500, in _handle_publish
self._handle_on_message(message)
File "/usr/local/lib/python2.7/dist-packages/paho/mqtt/client.py", line 2647, in _handle_on_message
self.on_message(self, self._userdata, message)
File "/usr/local/lib/python2.7/dist-packages/esphomeyaml/mqtt.py", line 63, in on_message
print(time + message)
File "/usr/local/lib/python2.7/dist-packages/colorama/ansitowin32.py", line 40, in write
self.__convertor.write(text)
File "/usr/local/lib/python2.7/dist-packages/colorama/ansitowin32.py", line 141, in write
self.write_and_convert(text)
File "/usr/local/lib/python2.7/dist-packages/colorama/ansitowin32.py", line 169, in write_and_convert
self.write_plain_text(text, cursor, len(text))
File "/usr/local/lib/python2.7/dist-packages/colorama/ansitowin32.py", line 174, in write_plain_text
self.wrapped.write(text[start:end])
UnicodeEncodeError: 'ascii' codec can't encode character u'\xb0' in position 68: ordinal not in range(128)
Thanks for the great library! I think this is awesome.
Anyways, I see that the current suggested way for doing momentary switches (the "garage door opener" example) has Home Assistant doing the momentary logic. It might be nicer if the momentary logic was implemented on the ESP itself.
My thoughts:
In my case, I have an ESP wired up to my apartments door buzzer. That thing is definitely not rated for continuous duty - I really don't want to ever have it stuck on! I currently have some custom code on my ESP for this, but I'd love to migrate.
If you think this is a good idea, I'm happy to implement this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.