1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-20 01:28:16 +00:00

753 Commits

Author SHA1 Message Date
nur
3fb66fcad6 PR comment fixes 2019-08-03 13:28:32 +08:00
Igor Mammedov
62e7acd280 mhz19: disable autocalibration for MH-Z19B by default
MH-Z19B allows to enable/disable 'automatic baseline calibration',
which is enabled by default (MH-Z19B v1.2 datasheet).
It operates on too short 24hr interval. So if the place
where sensor is located is not ventilated well "every" day, ABC will
make sensor under-report CO2 value, since baseline (400ppm) is moved
to lowest observed value in 24hr.

With such short recalibrartion window, sensor often doesn't show
correct CO2 levels when ABS is left enabled. Disable it on boot
defaut and add 'automatic_baseline_calibration' option to allow
override from config.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
7b8c657b1e mhz19: add detection of B sensor revision
it will allow to report exact sensor type in dump config
and later will be used for turning off autocalibration.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
3545803c87 mhz19: ignore data from sensor while it's booting
Reported CO2 might be not correct while sensor is booting and
while it boots it reports value 15000 in response at offset
6-7. So skip reporting till this value is being reurned.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
a78a98bef5 mhz19: cleanup uart RX buffer before sending command
When sensor is connected to hardware uart, sometimes on boot
uart's RX buffer contains several bytes of junk. Workaround it
by draining all of it before sending command.
Also turn on cleanup logic only if problem is detected (i.e.
when reply from sensor doesn't look correct.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
62e57aeac3 mhz19: report received responce if it's invalid
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
8988d18a99 mhz19: move response checksum check into mhz19_write_command_()
update() is supposed to deal with reading and updating CO2/Temp,
while response checksum verification applies to other responses
as well.
Move check into mhz19_write_command_() that handles communications
with sensor.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
f1ed524884 mhz19: add logging of sent and received PDUs
it should help with debbuging issues if debugging is enabled.
Also it adds buffer dump function that will be used later
to dump invalid responses.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
0e0fae7e02 mhz19: use the same length for request and reply
per spec request and response are of the same length,
simplify code by using the same length buffers. It should
help later when more code that uses buffers are added.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
8d45dff31b mhz19: flush TX queue before reading reply
otherwise there might not be reply to ready since
not all data might be sent over TX line

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
fd6e49f94d mhz19: drop not needed flush() call
flush() is used to flush TX buffer, but there weren't anything
written to TX yet, so it's pointless to call flush() so early.
Remove unnecessary call.

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Igor Mammedov
6bdd0e7f6d uart: add drain() API
it would allow to empty RX buffer when necessary

Signed-off-by: Igor Mammedov <imammedo@redhat.com>
2019-07-24 00:08:02 +08:00
Felix Eckhofer
a783637a7a Restore sending "None" effect type (#667)
This is a regression from 369d175694dcde3545bfc3b04711bd8dca81b2e5.
2019-07-21 13:11:34 +02:00
Otto Winter
7210ad7ed9
Change ESP32 default power_save_mode to light (#661) 2019-07-03 20:42:55 +02:00
Otto Winter
1876c21e3e
WiFi networks priority (#658)
* WiFi networks priority

Fixes https://github.com/esphome/feature-requests/issues/136

* Print priority
2019-07-03 20:42:46 +02:00
Otto Winter
6516a6ff7e
Fix LG nbits 2019-07-03 17:16:46 +02:00
Otto Winter
85195436c1
Work around pytz tzname bug
Fixes https://github.com/esphome/issues/issues/445
2019-07-03 17:13:40 +02:00
Thomas Eckerstorfer
c6512013bb added tx20 wind speed sensor (#275)
* added tx20 wind speed sensor

* added test

* fixed lint errors

* fixed more lint errors

* updated tx20

* updated tx20 sensor

* updated to new structure and removed static variables

* removed content from __init__.py

* fixing lint errors

* resolved issues from review


Co-authored-by: Thomas <thomas.eckerstorfer@mic-cust.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2019-07-03 16:42:32 +02:00
Otto Winter
81a070d03d
ESP32 Use NVS directly (#659) 2019-07-03 16:34:40 +02:00
Otto Winter
0ef1d178d2
Fix deep sleep on_shutdown hooks (#660)
Fixes https://github.com/esphome/feature-requests/issues/294
2019-07-03 16:34:03 +02:00
Nikolay Vasilchuk
762f1b1fc9 ZyAura CO2 / Temperature / Humidity Sensor (#656)
* ZyAura sensors support

* Validation

* Small refactoring

* Some checks

* Small fix

* Use floats, not double

Co-Authored-By: Otto Winter <otto@otto-winter.com>

* uint32_t now

Co-Authored-By: Otto Winter <otto@otto-winter.com>

* A constant for bits in a byte just over-complicates the source code

Co-Authored-By: Otto Winter <otto@otto-winter.com>

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Review fixes

* Travis fixes

* Travis fixes

* Travis fixes
2019-07-03 16:33:18 +02:00
Otto Winter
7ad593d674
Add setup, loop as reserved IDs
Fixes https://github.com/esphome/issues/issues/496
2019-07-03 15:25:38 +02:00
Otto Winter
13522c8f19
WIP: ESP8266 work on connection issues (#648)
* Erase all flash for USB uploads on ESP8266s

Previously, only erased "write regions".

Downside: Config for other FWs like tasmota could be affected

Upside: Potentially fixes some ESP8266 connection issues

Related: https://github.com/esphome/issues/issues/455#issuecomment-503524479

* Clear WiFi settings for ESP8266

Clears wifi settings from retained storage on ESP8266 (if set).

Unsure if this is the actual issue, but it won't cause problems either.

* Update wifi_component_esp8266.cpp

* Revert erase chip for testing

* Improve wait_time calculation
2019-07-02 13:03:11 +02:00
Otto Winter
d2938e82db
Add calibrate_polynomial sensor filter (#642)
* Add calibrate_polynomial sensor filter

* Fix

* Lint

* Format
2019-07-02 13:02:55 +02:00
Otto Winter
f95d4ca106
CT Clamp ADS1115 Improvements (#647)
Fixes https://github.com/esphome/issues/issues/457
2019-07-02 13:02:46 +02:00
Otto Winter
486bafd009
Fix upload_speed must be str 2019-07-01 15:11:11 +02:00
Otto Winter
341c99b4fa
Better DHT error reporting 2019-07-01 11:10:03 +02:00
Otto Winter
83095e8989
Fix climate MQTT HA interop
Fixes https://github.com/esphome/issues/issues/494
2019-07-01 11:09:44 +02:00
Otto Winter
71ba4bc31c
Fix api client disconnect handler 2019-07-01 11:09:20 +02:00
Otto Winter
894ec07cc8
Allow multiple files in CLI syntax 2019-07-01 11:09:06 +02:00
Otto Winter
59091100e4
Fix YAMLError with unicode 2019-06-30 12:19:03 +02:00
Otto Winter
e5485ab650
Fix registry entry value copy 2019-06-30 12:18:41 +02:00
Otto Winter
6c493d10d2
More scheduler fixes 2019-06-30 12:18:27 +02:00
Otto Winter
840f599631
Dallas improve warnings 2019-06-30 09:14:16 +02:00
Otto Winter
5a76e61b1e
Prevent too long fallback AP SSID 2019-06-30 09:14:04 +02:00
Otto Winter
7b4366bfef
Fix scheduler 2019-06-30 09:13:52 +02:00
Otto Winter
8dee5c5fe8
Adjust default reboot timeouts 2019-06-30 09:12:48 +02:00
Otto Winter
b2e6d222cd
Remove unnecessary update_interval from schemas 2019-06-28 11:30:15 +02:00
Otto Winter
2712c44004
Update dependencies (#653)
* Update pio dependencies

* Platformio 4

* Fixes

* Update platformio_api.py

* Lint
2019-06-28 11:29:37 +02:00
Otto Winter
82625a3080
Fix remote_transmitter wait time unit (#654)
Fixes https://github.com/esphome/issues/issues/485
2019-06-26 21:48:00 +02:00
mtl010957
49f9ad66db Adding ignore bits to narrow compare of received codes (#650)
* Adding bitmask to narrow compare of received codes
Updated test to add mask configuration

* Lint

* Handle bitmask as ignore characters per review comment

* Fixed test to cover ignore bits

* Lint

* Eliminate separate set_mask method per review comment
2019-06-26 21:47:34 +02:00
mtl010957
0dfab4d93c Fixed rc_switch dump off by one bit (#652)
* Fixed rc_switch dump off by one bit

* Proper fix per review comments
2019-06-26 21:42:49 +02:00
rnauber
5cd7f23065 Provide the lights current color to the addressable_lambda_effect. (#646)
* Provide the lights current color to the addressable_lambda_effect.

* Fix formatting

* More formatting

* Change the call signature of the lambda

* lint


Co-authored-by: olg <x>
2019-06-19 11:33:14 +02:00
mtl010957
27453afa4e Template tilt cover (#577)
* Enabling tilt control in the template cover
Added test
Add tilt option to publish action

* Added CONF_TILT to alidation schema per comment

* Removed default for CONF_TILT
2019-06-18 19:42:36 +02:00
Otto Winter
369d175694
Create Protobuf Plugin for automatically generating native API stubs (#633)
* Create Protobuf Plugin for automatically generating native API stubs

* Format

* Delete api.proto

* Cleanup, use no_delay conditionally

* Updates

* Update

* Lint

* Lint

* Fixes

* Camera

* CustomAPIDevice

* Fix negative VarInt, Add User-defined services arrays

* Home Assistant Event

* Fixes

* Update custom_api_device.h
2019-06-18 19:31:22 +02:00
Guillermo Ruffino
fc465d6d93 SMS Sender / Receiver (#522)
* add sim800l

* Increse SoftwareSerial Buffer Size

* use auto id on action

* lint

* lint

* add to test3.yaml

* lint


Co-authored-by: Guillermo Ruffino <guillermo.ruffino@pampatech.net>
2019-06-17 20:13:52 +02:00
Otto Winter
904a0b26ea
Make logger string memory usage more efficient (#641)
* Make logger string storing more efficient

* Lint
2019-06-16 19:14:24 +02:00
rnauber
c13f132399 Add set_threshold and get_value methods to ESP32TouchBinarySensor. (#631)
* Add set_threshold and get_value methods to ESP32TouchBinarySensor and add a test.

* esp32_touch_binary_adaptive: fix formatting

* Remove superfluous static from testcase

* Revert "Remove superfluous static from testcase"

This reverts commit 5a6a111aa8351a9719714d2ce7b9ae1d40505235.

* Move into header file

* Update esp32_touch.h


Co-authored-by: olg <x>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2019-06-16 19:14:13 +02:00
Andrew Thompson
db968bc6b0 Atmel M90E32AS Energy Metering IC. Found in CircuitSetup 2chan and 6chan energy meterss (#629)
* Atmel M90E32AS Energy Metering IC. Found in CircuitSetup 2can and 6chan energy meters

* fix style bugs

* Update esphome/components/atm90e32/atm90e32.cpp

Co-Authored-By: Otto Winter <otto@otto-winter.com>

* Properly put atm90e32_reg in namespace

* Use phase grouped config like ina3221

* Log why the component is marked failed, did not read back our register value

* 32bit register reads are 2s compliment

* Fix atm90e32 option name in test

* clang-format changes from travis-ci

* use new protected method names

* Whitespace changes to please Travis

* Update esphome/components/atm90e32/atm90e32.cpp

Co-Authored-By: Otto Winter <otto@otto-winter.com>

* Fix up type change for val_h/val_l

* Remove conditions around values with defaults

* Rename constants to match their value

* Remove 2's complement check


Co-authored-by: Andrew Thompson <andrew@whosonlocation.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2019-06-16 12:00:15 +02:00
Guillermo Ruffino
7abe8875bd Fix home assistant binary sensor initial state (#632)
* Fix home assistant binary sensor initial state

* Fix send state log message

* fix new_state local name

* lint

* Trigger


Co-authored-by: Guillermo Ruffino <guillermo.ruffino@pampatech.net>
2019-06-15 18:02:17 +02:00