Merge pull request #1527 from esphome/bump-2021.10.0b1

2021.10.0b1
This commit is contained in:
Jesse Hills 2021-10-13 21:40:31 +13:00 committed by GitHub
commit e101d65aae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
77 changed files with 4255 additions and 245 deletions

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "ESPHome"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 2021.9.3
PROJECT_NUMBER = 2021.10.0b1
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -1,7 +1,7 @@
ESPHOME_PATH = ../esphome
ESPHOME_REF = 2021.9.3
ESPHOME_REF = 2021.10.0b1
.PHONY: html html-strict cleanhtml deploy help webserver Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png
.PHONY: html html-strict cleanhtml deploy help webserver Makefile netlify netlify-api api netlify-dependencies svg2png copy-svg2png minify
html:
sphinx-build -M html . _build -j auto -n $(O)
@ -9,6 +9,10 @@ html:
html-strict:
sphinx-build -M html . _build -W -j auto -n $(O)
minify:
minify -o _static/webserver-v1.min.js _static/webserver-v1.js
minify -o _static/webserver-v1.min.css _static/webserver-v1.css
cleanhtml:
rm -rf "_build/html/*"

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

View File

@ -1 +1 @@
2021.9.3
2021.10.0b1

View File

@ -29,6 +29,10 @@ source.addEventListener('state', function (e) {
const states = document.getElementById("states");
let i = 0, row;
for (; row = states.rows[i]; i++) {
if (!row.children[2].children.length) {
continue;
}
if (row.classList.contains("switch")) {
(function(id) {
row.children[2].children[0].addEventListener('click', function () {
@ -70,4 +74,13 @@ for (; row = states.rows[i]; i++) {
});
})(row.id);
}
if (row.classList.contains("select")) {
(function(id) {
row.children[2].children[0].addEventListener('change', function () {
const xhr = new XMLHttpRequest();
xhr.open("POST", '/select/' + id.substr(7) + '/set?option=' + encodeURIComponent(this.value), true);
xhr.send();
});
})(row.id);
}
}

View File

@ -1 +1,7 @@
const source=new EventSource("/events");source.addEventListener("log",function(a){const b=document.getElementById("log");let c="";a.data.startsWith("\x1B[1;31m")?c="e":a.data.startsWith("\x1B[0;33m")?c="w":a.data.startsWith("\x1B[0;32m")?c="i":a.data.startsWith("\x1B[0;35m")?c="c":a.data.startsWith("\x1B[0;36m")?c="d":a.data.startsWith("\x1B[0;37m")?c="v":b.innerHTML+=a.data+"\n",b.innerHTML+="<span class=\""+c+"\">"+a.data.substr(7,a.data.length-10)+"</span>\n"}),source.addEventListener("state",function(a){const b=JSON.parse(a.data);document.getElementById(b.id).children[1].innerText=b.state});const states=document.getElementById("states");for(let a,b=0;a=states.rows[b];b++)a.classList.contains("switch")&&function(b){a.children[2].children[0].addEventListener("click",function(){const a=new XMLHttpRequest;a.open("POST","/switch/"+b.substr(7)+"/toggle",!0),a.send()})}(a.id),a.classList.contains("fan")&&function(b){a.children[2].children[0].addEventListener("click",function(){const a=new XMLHttpRequest;a.open("POST","/fan/"+b.substr(4)+"/toggle",!0),a.send()})}(a.id),a.classList.contains("light")&&function(b){a.children[2].children[0].addEventListener("click",function(){const a=new XMLHttpRequest;a.open("POST","/light/"+b.substr(6)+"/toggle",!0),a.send()})}(a.id),a.classList.contains("cover")&&function(b){a.children[2].children[0].addEventListener("click",function(){const a=new XMLHttpRequest;a.open("POST","/cover/"+b.substr(6)+"/open",!0),a.send()}),a.children[2].children[1].addEventListener("click",function(){const a=new XMLHttpRequest;a.open("POST","/cover/"+b.substr(6)+"/close",!0),a.send()})}(a.id);
const source=new EventSource("/events");source.addEventListener('log',function(e){const log=document.getElementById("log");let klass='';if(e.data.startsWith("")){klass='e';}else if(e.data.startsWith("")){klass='w';}else if(e.data.startsWith("")){klass='i';}else if(e.data.startsWith("")){klass='c';}else if(e.data.startsWith("")){klass='d';}else if(e.data.startsWith("")){klass='v';}else{log.innerHTML+=e.data+'\n';}
log.innerHTML+='<span class="'+klass+'">'+e.data.substr(7,e.data.length-10)+"</span>\n";});source.addEventListener('state',function(e){const data=JSON.parse(e.data);document.getElementById(data.id).children[1].innerText=data.state;});const states=document.getElementById("states");let i=0,row;for(;row=states.rows[i];i++){if(!row.children[2].children.length){continue;}
if(row.classList.contains("switch")){(function(id){row.children[2].children[0].addEventListener('click',function(){const xhr=new XMLHttpRequest();xhr.open("POST",'/switch/'+id.substr(7)+'/toggle',true);xhr.send();});})(row.id);}
if(row.classList.contains("fan")){(function(id){row.children[2].children[0].addEventListener('click',function(){const xhr=new XMLHttpRequest();xhr.open("POST",'/fan/'+id.substr(4)+'/toggle',true);xhr.send();});})(row.id);}
if(row.classList.contains("light")){(function(id){row.children[2].children[0].addEventListener('click',function(){const xhr=new XMLHttpRequest();xhr.open("POST",'/light/'+id.substr(6)+'/toggle',true);xhr.send();});})(row.id);}
if(row.classList.contains("cover")){(function(id){row.children[2].children[0].addEventListener('click',function(){const xhr=new XMLHttpRequest();xhr.open("POST",'/cover/'+id.substr(6)+'/open',true);xhr.send();});row.children[2].children[1].addEventListener('click',function(){const xhr=new XMLHttpRequest();xhr.open("POST",'/cover/'+id.substr(6)+'/close',true);xhr.send();});})(row.id);}
if(row.classList.contains("select")){(function(id){row.children[2].children[0].addEventListener('change',function(){const xhr=new XMLHttpRequest();xhr.open("POST",'/select/'+id.substr(7)+'/set?option='+encodeURIComponent(this.value),true);xhr.send();});})(row.id);}}

351
changelog/2021.10.0.rst Normal file
View File

@ -0,0 +1,351 @@
ESPHome 2021.10.0 - 20th October 2021
=====================================
.. seo::
:description: Changelog for ESPHome 2021.10.0.
:image: /_static/changelog-2021.10.0.png
:author: ESPHome
:author_twitter: @esphome_
.. imgtable::
:columns: 3
AirThings Wave Mini, components/sensor/airthings_ble, airthings_logo.png
Current-Based Cover, components/cover/current_based, flash.svg
Daly BMS, components/sensor/daly_bms, daly_bms.png
EPEVER Tracer, cookbook/tracer-an, tracer-an.jpg
LTR390, components/sensor/ltr390, ltr390.jpg
Modbus Controller, components/modbus_controller, modbus.png
Safe Mode Switch, components/switch/safe_mode, restart-alert.svg
SCD4X, components/sensor/scd4x, scd4x.jpg
Tuya Cover, components/cover/tuya, tuya.png
ESP-IDF
-------
Docs still to be written before release on how to use ESP-IDF, but here is a quick example:
.. code-block:: yaml
esphome:
name: livingroom
esp32:
board: <BOARD_TYPE>
framework:
type: esp-idf
A huge effort has been put into reorganising, restructuring and rewriting a whole lot of code
to allow ESP32 based boards to be compiled using ESP-IDF as the framework instead of Arduino.
This allows ESPHome to keep up with new features and support for new ESP32 based chips
that Espressif add to the ESP-IDF, such as the ESP32-C3 that a lot of people had been asking about.
There are known issues and specific components that are missing support for ESP-IDF as those ones rely
on an Arduino library and need more time to be rewritten in a compatible way.
If you come across an issue while switching to ESP-IDF, please file an
`issue on GitHub <https://github.com/esphome/issues/issues/new?assignees=&labels=&template=bug_report.yml>`__
using the ``ESP32-IDF`` option as the platform.
Dashboard Node Import
---------------------
To be written...
Modbus Controller
-----------------
Support for generic modbus device data has been added. This allows you as a user
to get data and control a modbus device without a native ESPHome component. Although a
native component is still better and preferred if it exists.
- :doc:`Modbus Controller </components/modbus_controller>`
- :doc:`Sensors </components/sensor/modbus_controller>`
- :doc:`Binary Sensors </components/binary_sensor/modbus_controller>`
- :doc:`Text Sensors </components/text_sensor/modbus_controller>`
- :doc:`Numbers </components/number/modbus_controller>`
- :doc:`Switches </components/switch/modbus_controller>`
- :doc:`Outputs </components/output/modbus_controller>`
Text Sensor filters
-------------------
``text_sensors`` now have ``filters`` that allow you to do string manipulation before the value is
given to the frontend. Check out the :ref:`docs here <text_sensor-filters>`.
Lighting
--------
The Tuya light platform now supports RGB and HSV datapoints for those TuyaMCU based lights.
Partitions now support adding non-addressable lights into the sequence. As an example you
could build a "fake" addressable light from regular rgb leds.
Graphs
------
There is new :ref:`Graph <display-graphs>` building functions for displays that will allow you to
draw the history of sensors over time. See the docs for examples and images on what this looks like.
``wait_until``
--------------
The ``wait_until`` action now has an optional ``timeout`` option that lets you continue or cancel (using an
if action afterwards) your automations if the condition does not become true after a period of time.
Combination of MiScale 1 & 2
----------------------------
:esphomepr:`2266` combines the two miscale platforms into one as the code was mostly the
same and autodetection could be done to detemine which one you are using.
Float Output state changes
--------------------------
When using a float output with both invert and min/max values, prevously
the end resut value was being calculated incorrectly. :esphomepr:`2368` fixed this.
Full list of changes
--------------------
New Features
^^^^^^^^^^^^
- Added graphing component :esphomepr:`2109` by :ghuser:`synco` (new-integration) (new-feature)
- Add deep sleep wakeup from touch (#1238) :esphomepr:`2281` by :ghuser:`chrta` (new-feature)
- Allow non-addressable lights in light partitions :esphomepr:`2256` by :ghuser:`paulmonigatti` (new-feature)
- Add support for Waveshare 7.5 inch (C) bichromatic display (black-and-white only for now) :esphomepr:`1844` by :ghuser:`pixelspark` (new-feature)
- Wifi scan results :esphomepr:`1605` by :ghuser:`gpambrozio` (new-feature)
- Add SSD1305 support to SSD1306 integration along with few new options :esphomepr:`1902` by :ghuser:`zhangjingye03` (new-feature) (breaking-change)
- Adds light sensor support for b-parasites :esphomepr:`2391` by :ghuser:`rbaron` (new-feature)
- Tuya rgb support :esphomepr:`2278` by :ghuser:`irtimaled` (new-feature)
- add fan.cycle_speed action :esphomepr:`2329` by :ghuser:`WeekendWarrior1` (new-feature)
- Add cover toggle support :esphomepr:`1809` by :ghuser:`dtmuller` (new-feature)
- Support HSV-based color support on tuya light :esphomepr:`2400` by :ghuser:`irtimaled` (new-feature)
- String manipulation filters for text sensors! :esphomepr:`2393` by :ghuser:`WeekendWarrior1` (new-feature)
- Add optional timeout for wait_until action :esphomepr:`2282` by :ghuser:`jesserockz` (new-feature)
New Components
^^^^^^^^^^^^^^
- Added graphing component :esphomepr:`2109` by :ghuser:`synco` (new-integration) (new-feature)
- Configurable Flash Write Interval :esphomepr:`2119` by :ghuser:`alexyao2015` (new-integration)
- Add support for Daly Smart BMS :esphomepr:`2156` by :ghuser:`s1lvi0` (new-integration)
- Add support for LTR390 :esphomepr:`1505` by :ghuser:`sjtrny` (new-integration)
- Modbus controller :esphomepr:`1779` by :ghuser:`martgras` (new-integration)
- Dashboard node import and render in browser :esphomepr:`2374` by :ghuser:`OttoWinter` (new-integration)
- Add Current based cover :esphomepr:`1439` by :ghuser:`djwmarcx` (new-integration)
- Add support for SCD4X :esphomepr:`2217` by :ghuser:`sjtrny` (new-integration)
- Add support for Airthing Wave Mini :esphomepr:`2440` by :ghuser:`ncareau` (new-integration)
- Add Safe Mode Restart Switch :esphomepr:`2437` by :ghuser:`paulmonigatti` (new-integration)
- Added heatpumpir support :esphomepr:`1343` by :ghuser:`rob-deutsch` (new-integration)
Breaking Changes
^^^^^^^^^^^^^^^^
- Combine code of xiaomi_miscale and xiaomi_miscale2 :esphomepr:`2266` by :ghuser:`edenhaus` (breaking-change)
- Correctly invert the float output state :esphomepr:`2368` by :ghuser:`jesserockz` (breaking-change)
- Add SSD1305 support to SSD1306 integration along with few new options :esphomepr:`1902` by :ghuser:`zhangjingye03` (new-feature) (breaking-change)
All changes
^^^^^^^^^^^
- Drop obsolete comments from CONTRIBUTING.md :esphomepr:`2271` by :ghuser:`oxan`
- Support inverting color temperature on tuya lights :esphomepr:`2277` by :ghuser:`irtimaled`
- Untangle core headers (part 1) :esphomepr:`2276` by :ghuser:`oxan`
- Compatibility with clang-tidy v14 :esphomepr:`2272` by :ghuser:`oxan`
- Store strings only used for logging in flash :esphomepr:`2274` by :ghuser:`oxan`
- Expose select on Frontend `web_server:` :esphomepr:`2245` by :ghuser:`ayufan`
- Fix devcontainer scripts on Windows :esphomepr:`2239` by :ghuser:`alexyao2015`
- Fix SM300D2 sensor component routines so they correctly read the sensor output :esphomepr:`2159` by :ghuser:`jamesbraid`
- Bump tzlocal from 2.1 to 3.0 :esphomepr:`2154` by :ghuser:`dependabot[bot]`
- Activate owning-memory clang-tidy check :esphomepr:`1891` by :ghuser:`OttoWinter`
- Fix issue #2054. PZEM004T Component doesn't set the module address. :esphomepr:`1784` by :ghuser:`0x3333`
- Convert st7735.h to use LF line endings :esphomepr:`2287` by :ghuser:`oxan`
- Add esphal.h include to inkplate6 component :esphomepr:`2286` by :ghuser:`oxan`
- Revert "Bump tzlocal from 2.1 to 3.0 (#2154)" :esphomepr:`2289` by :ghuser:`OttoWinter`
- Run clang-tidy against ESP32 :esphomepr:`2147` by :ghuser:`oxan`
- Run clang-tidy against Arduino 3 :esphomepr:`2146` by :ghuser:`oxan`
- Bump click from 7.1.2 to 8.0.1 :esphomepr:`1824` by :ghuser:`dependabot[bot]`
- Add stale/lock bots :esphomepr:`2299` by :ghuser:`OttoWinter`
- Use standard version of make_unique when available :esphomepr:`2292` by :ghuser:`oxan`
- Bug fix of NFC message & records becoming inaccessible in on_tag lambdas :esphomepr:`2309` by :ghuser:`JonasEr`
- Dsmr updates :esphomepr:`2157` by :ghuser:`glmnet`
- Support direct relay state feedback for tuya climate component :esphomepr:`1668` by :ghuser:`kroimon`
- ac_dimmer increase gate time for robotdyn :esphomepr:`1708` by :ghuser:`glmnet`
- Bump aioesphomeapi from 9.0.0 to 9.1.0 :esphomepr:`2306` by :ghuser:`dependabot[bot]`
- Bump black from 21.8b0 to 21.9b0 :esphomepr:`2305` by :ghuser:`dependabot[bot]`
- Add namespace to all PlatformIO library references :esphomepr:`2296` by :ghuser:`oxan`
- Allow transforms and flashes to not update remote_values :esphomepr:`2313` by :ghuser:`matthewmazzanti`
- Reduce stale/lock gh actions interval :esphomepr:`2341` by :ghuser:`OttoWinter`
- Add `esp8266_disable_ssl_support:` config option :esphomepr:`2236` by :ghuser:`ayufan`
- Bump pylint from 2.10.2 to 2.11.1 :esphomepr:`2334` by :ghuser:`dependabot[bot]`
- Add eco mode to tuya climate component :esphomepr:`1860` by :ghuser:`kroimon`
- Fix SPIDevice::write_byte16 to actually take a 16 bit argument :esphomepr:`2345` by :ghuser:`lgugelmann`
- Redo docker build system with buildkit+multi-stage and cache pio packages :esphomepr:`2338` by :ghuser:`OttoWinter`
- Calculating the AC only component of the samples :esphomepr:`1906` by :ghuser:`synco`
- Fix error reporting for DHT bit read loop :esphomepr:`2344` by :ghuser:`besteru`
- Also run docker CI when requirements change :esphomepr:`2347` by :ghuser:`OttoWinter`
- Added graphing component :esphomepr:`2109` by :ghuser:`synco` (new-integration) (new-feature)
- Properly calculate negative temperatures in sm300d2 :esphomepr:`2335` by :ghuser:`poptix`
- Fix docker release deploy push flag :esphomepr:`2348` by :ghuser:`OttoWinter`
- Add invert_colors option for st7735 :esphomepr:`2327` by :ghuser:`g5pw`
- Add deep sleep wakeup from touch (#1238) :esphomepr:`2281` by :ghuser:`chrta` (new-feature)
- Add ESPHOME_VERSION_CODE define :esphomepr:`2324` by :ghuser:`oxan`
- Install python requirements after apt ones for better caching :esphomepr:`2349` by :ghuser:`OttoWinter`
- Introduce call_dump_config() indirection :esphomepr:`2325` by :ghuser:`oxan`
- ESP-IDF support and generic target platforms :esphomepr:`2303` by :ghuser:`OttoWinter`
- CI cache only restore from direct matches :esphomepr:`2351` by :ghuser:`OttoWinter`
- fixes compilation error in rtttl :esphomepr:`2357` by :ghuser:`martgras`
- Fix MDNS not registered :esphomepr:`2359` by :ghuser:`OttoWinter`
- Fix src_filter in platformio.ini after src_dir change :esphomepr:`2353` by :ghuser:`OttoWinter`
- Fix duplicate defines and restore alphabetical order :esphomepr:`2352` by :ghuser:`oxan`
- Configurable Flash Write Interval :esphomepr:`2119` by :ghuser:`alexyao2015` (new-integration)
- Fix OTA password mismatch error. :esphomepr:`2363` by :ghuser:`mmakaay`
- Allow compilation against IDF from repository :esphomepr:`2355` by :ghuser:`oxan`
- Fix ESP8266 preferences not set up :esphomepr:`2362` by :ghuser:`OttoWinter`
- Fix ESP8266 preference loading :esphomepr:`2367` by :ghuser:`paulmonigatti`
- Allow non-addressable lights in light partitions :esphomepr:`2256` by :ghuser:`paulmonigatti` (new-feature)
- add = to default font glpyh list :esphomepr:`2361` by :ghuser:`WeekendWarrior1`
- Fix docker pio settings not applied :esphomepr:`2370` by :ghuser:`OttoWinter`
- Fix OTA crash during reading of new bin file. :esphomepr:`2366` by :ghuser:`mmakaay`
- Fix Dallas parent not being set :esphomepr:`2369` by :ghuser:`paulmonigatti`
- Discard SenseAir S8 commands echoes & fix calibration result check :esphomepr:`2358` by :ghuser:`nmaggioni`
- Add support for Daly Smart BMS :esphomepr:`2156` by :ghuser:`s1lvi0` (new-integration)
- Combine code of xiaomi_miscale and xiaomi_miscale2 :esphomepr:`2266` by :ghuser:`edenhaus` (breaking-change)
- Add support for Waveshare 7.5 inch (C) bichromatic display (black-and-white only for now) :esphomepr:`1844` by :ghuser:`pixelspark` (new-feature)
- ili9341: use larger SPI transfers :esphomepr:`1628` by :ghuser:`numo68`
- Correctly invert the float output state :esphomepr:`2368` by :ghuser:`jesserockz` (breaking-change)
- Add support for LTR390 :esphomepr:`1505` by :ghuser:`sjtrny` (new-integration)
- Allow sloppy Tuya datapoint message length :esphomepr:`1982` by :ghuser:`trvrnrth`
- Mqtt topics to support numeric fan speed :esphomepr:`1859` by :ghuser:`wifwucite`
- Wifi scan results :esphomepr:`1605` by :ghuser:`gpambrozio` (new-feature)
- Add SSD1305 support to SSD1306 integration along with few new options :esphomepr:`1902` by :ghuser:`zhangjingye03` (new-feature) (breaking-change)
- Fix broken compilation due to conflict between #1237 and IDF changes :esphomepr:`2372` by :ghuser:`oxan`
- Don't generate IDs with the name of loaded integrations :esphomepr:`2373` by :ghuser:`oxan`
- fix i2c scanning eror for Arduino :esphomepr:`2364` by :ghuser:`martgras`
- Bump tzlocal from 2.1 to 3.0 :esphomepr:`2294` by :ghuser:`dependabot[bot]`
- ledc: do not try to write_state to an uninitialized output :esphomepr:`1732` by :ghuser:`toelke`
- Fix two i2c error code return errors :esphomepr:`2375` by :ghuser:`OttoWinter`
- Fix ir_climate on ESP32-C3 :esphomepr:`2314` by :ghuser:`stintel`
- Fix ESP8266 ADC :esphomepr:`2376` by :ghuser:`paulmonigatti`
- Fix: Pin flags code generation returning FLAG_NONE :esphomepr:`2377` by :ghuser:`paulmonigatti`
- Add missing MockObj operators :esphomepr:`2378` by :ghuser:`OttoWinter`
- Fix esp-idf pinmask bit-shift overflow :esphomepr:`2380` by :ghuser:`chrta`
- Add i2c bus recovery during initialization :esphomepr:`2379` by :ghuser:`chrta`
- Bump voluptuous from 0.12.1 to 0.12.2 :esphomepr:`2381` by :ghuser:`dependabot[bot]`
- Read unencrypted DSMR telegrams in chunks :esphomepr:`2382` by :ghuser:`mmakaay`
- Fix clang-tidy header filter :esphomepr:`2385` by :ghuser:`OttoWinter`
- Fix InterruptLock on ESP-IDF :esphomepr:`2388` by :ghuser:`OttoWinter`
- Fix some issues with wifi driver after IDF refactor :esphomepr:`2387` by :ghuser:`OttoWinter`
- Fix arduino esp32 wifi v2 :esphomepr:`2389` by :ghuser:`OttoWinter`
- Misc fixes for esp-idf :esphomepr:`2386` by :ghuser:`OttoWinter`
- Adds light sensor support for b-parasites :esphomepr:`2391` by :ghuser:`rbaron` (new-feature)
- fix: Setting Tuya string DP value :esphomepr:`2394` by :ghuser:`irtimaled`
- Tuya rgb support :esphomepr:`2278` by :ghuser:`irtimaled` (new-feature)
- add fan.cycle_speed action :esphomepr:`2329` by :ghuser:`WeekendWarrior1` (new-feature)
- Modbus controller :esphomepr:`1779` by :ghuser:`martgras` (new-integration)
- Extend nfc ndef records with Text :esphomepr:`2191` by :ghuser:`JonasEr`
- Fix NDEF URI casing :esphomepr:`2397` by :ghuser:`jesserockz`
- Dashboard node import and render in browser :esphomepr:`2374` by :ghuser:`OttoWinter` (new-integration)
- ccs811: Skip reading data if it is not available/ready :esphomepr:`2404` by :ghuser:`chrta`
- Add missing include for component bme680_bsec :esphomepr:`2403` by :ghuser:`mmakaay`
- fix: stop tuya light state getting reset :esphomepr:`2401` by :ghuser:`irtimaled`
- Add Current based cover :esphomepr:`1439` by :ghuser:`djwmarcx` (new-integration)
- Add cover toggle support :esphomepr:`1809` by :ghuser:`dtmuller` (new-feature)
- Fix handling of timestamps in Teleinfo component. :esphomepr:`2392` by :ghuser:`0hax`
- bump dashboard to 20210927.0 :esphomepr:`2405` by :ghuser:`balloob`
- Add str_sprintf function that returns std::string :esphomepr:`2408` by :ghuser:`oxan`
- Fix lint issues in web_server_base :esphomepr:`2409` by :ghuser:`jesserockz`
- Fix uninitialised use of ESPPreferenceObject.backend :esphomepr:`2411` by :ghuser:`paulmonigatti`
- Add support for SCD4X :esphomepr:`2217` by :ghuser:`sjtrny` (new-integration)
- Support HSV-based color support on tuya light :esphomepr:`2400` by :ghuser:`irtimaled` (new-feature)
- Tuya: add cover component :esphomepr:`2279` by :ghuser:`marmarek`
- Fix tuya cover lint checks :esphomepr:`2414` by :ghuser:`OttoWinter`
- Bump debian base to 5.1.0 / 20210902 :esphomepr:`2413` by :ghuser:`OttoWinter`
- Remove default initializations from tuya cover :esphomepr:`2415` by :ghuser:`jesserockz`
- Move #ifdef to after header include :esphomepr:`2417` by :ghuser:`oxan`
- String manipulation filters for text sensors! :esphomepr:`2393` by :ghuser:`WeekendWarrior1` (new-feature)
- Update web_server.cpp :esphomepr:`2419` by :ghuser:`arallsopp`
- Fix default environment for clang-tidy :esphomepr:`2420` by :ghuser:`oxan`
- Replace std::move() with const references where possible :esphomepr:`2421` by :ghuser:`oxan`
- Fix line endings normalization :esphomepr:`2407` by :ghuser:`oxan`
- Option to ignore CRC for EFuse MAC address :esphomepr:`2399` by :ghuser:`mmakaay`
- Fix attach_interrupt(...) for esp-idf framework :esphomepr:`2416` by :ghuser:`mmakaay`
- Fix I2C recovery on Arduino :esphomepr:`2412` by :ghuser:`mmakaay`
- Fix ESP32 esp-idf OTA updates :esphomepr:`2424` by :ghuser:`mmakaay`
- Add local MAC address to WiFi info :esphomepr:`2428` by :ghuser:`cvwillegen`
- Thermostat publish state fix :esphomepr:`2427` by :ghuser:`kbx81`
- Convert time to use tzdata :esphomepr:`2425` by :ghuser:`OttoWinter`
- Hotfix for ESP8266 OTA issue: ERROR Error binary size :esphomepr:`2432` by :ghuser:`mmakaay`
- Disable dependency finder on ESP32 :esphomepr:`2435` by :ghuser:`agners`
- Use size_t to fix comparision using RISC-V toolchain :esphomepr:`2436` by :ghuser:`agners`
- Fix I2C recovery ESP32 esp-idf :esphomepr:`2438` by :ghuser:`mmakaay`
- Fix esp32 no longer has Hash internal lib :esphomepr:`2441` by :ghuser:`OttoWinter`
- Fix restoring globals :esphomepr:`2442` by :ghuser:`OttoWinter`
- Always upload using esptool :esphomepr:`2433` by :ghuser:`OttoWinter`
- Add support for Airthing Wave Mini :esphomepr:`2440` by :ghuser:`ncareau` (new-integration)
- Improved validation for Addressable Light Partition Segments :esphomepr:`2439` by :ghuser:`paulmonigatti`
- Bump pytest-cov from 2.12.1 to 3.0.0 :esphomepr:`2444` by :ghuser:`dependabot[bot]`
- Fix compilation error for shutdown component :esphomepr:`2447` by :ghuser:`martgras`
- Bump aioesphomeapi from 9.1.4 to 9.1.5 :esphomepr:`2449` by :ghuser:`dependabot[bot]`
- Only ping once every two seconds :esphomepr:`2448` by :ghuser:`alexiri`
- Bump esphome-dashboard to 20211006.0 :esphomepr:`2451` by :ghuser:`jesserockz`
- I2C re-introduce very verbose logging :esphomepr:`2446` by :ghuser:`OttoWinter`
- Add Safe Mode Restart Switch :esphomepr:`2437` by :ghuser:`paulmonigatti` (new-integration)
- Add id() for restoring global :esphomepr:`2454` by :ghuser:`jesserockz`
- Add timestamp to ESPHome dashboard/cli logs :esphomepr:`2455` by :ghuser:`alexiri`
- I2c fix :esphomepr:`2460` by :ghuser:`martgras`
- Correct I2C read() return val check in bh1750 component. :esphomepr:`2465` by :ghuser:`mmakaay`
- atm90e32: make the total_increasing class sensors actually be increasing totals. :esphomepr:`2459` by :ghuser:`davidmonro`
- Use enum for Tuya fan direction datapoint :esphomepr:`2471` by :ghuser:`rmounce`
- Fix MQTT cover state when position is supported :esphomepr:`2468` by :ghuser:`definitio`
- Sgp40 fix :esphomepr:`2462` by :ghuser:`natelust`
- EntityBase Refactor :esphomepr:`2418` by :ghuser:`paulmonigatti`
- Fix below freezing temperature for Inkbird sensors :esphomepr:`2466` by :ghuser:`nuttytree`
- Add configuration for cover topics :esphomepr:`2472` by :ghuser:`definitio`
- Add configuration for climate topics :esphomepr:`2473` by :ghuser:`definitio`
- Use arduino btStart for arduino framework :esphomepr:`2457` by :ghuser:`jesserockz`
- Bump click from 8.0.1 to 8.0.3 :esphomepr:`2481` by :ghuser:`dependabot[bot]`
- Bump flake8 from 3.9.2 to 4.0.1 :esphomepr:`2483` by :ghuser:`dependabot[bot]`
- Bump platformio from 5.2.0 to 5.2.1 :esphomepr:`2482` by :ghuser:`dependabot[bot]`
- Bump esphome-dashboard from 20211006.0 to 20211011.1 :esphomepr:`2484` by :ghuser:`dependabot[bot]`
- Replace deprecated COLOR_BLACK constant :esphomepr:`2487` by :ghuser:`davet2001`
- Fix color temperature persistence on CWWW lights :esphomepr:`2486` by :ghuser:`sairon`
- Fix reset on http_request without network connection :esphomepr:`2474` by :ghuser:`niklasweber`
- Consolidate CONF_RAW_DATA_ID to const.py :esphomepr:`2491` by :ghuser:`davet2001`
- Update Airthings BLE :esphomepr:`2453` by :ghuser:`jesserockz`
- Add on_open and on_closed triggers to cover :esphomepr:`2488` by :ghuser:`nuttytree`
- Fix LoadProhibited crash for logger baud_rate 0 on esp-idf :esphomepr:`2498` by :ghuser:`mmakaay`
- Added heatpumpir support :esphomepr:`1343` by :ghuser:`rob-deutsch` (new-integration)
- Reduce IRAM usage in test3 :esphomepr:`2499` by :ghuser:`oxan`
- Add optional timeout for wait_until action :esphomepr:`2282` by :ghuser:`jesserockz` (new-feature)
- Improves ct_clamp component accuracy :esphomepr:`2283` by :ghuser:`skasi7`
- Allow multiple pn532_spi entries :esphomepr:`2489` by :ghuser:`jesserockz`
- Add throttle_average sensor filter :esphomepr:`2485` by :ghuser:`sermayoral`
Past Changelogs
---------------
.. toctree::
:maxdepth: 1
2021.9.0
2021.8.0
v1.20.0
v1.19.0
v1.18.0
v1.17.0
v1.16.0
v1.15.0
v1.14.0
v1.13.0
v1.12.0
v1.11.0
v1.10.0
v1.9.0
v1.8.0
v1.7.0

View File

@ -2,7 +2,7 @@ Changelog
=========
.. redirect::
:url: /changelog/2021.9.0.html
:url: /changelog/2021.10.0.html
.. toctree::
:glob:

View File

@ -95,6 +95,10 @@ Configuration variables:
- **id** (*Optional*,
:ref:`config-id`): Manually specify
the ID used for code generation.
- **wakeup_threshold** (*Optional*, int): The threshold to use to detect touch events to wakeup from deep
sleep. Smaller values mean a higher probability that the pad is being touched. All touch pad sensors that
should trigger a wakeup from deep sleep must specify this value. The :ref:`deep_sleep-component` must also
be configured to enable a wakeup from a touch event. Note that no filter is active during deep sleep.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`.
Touch Pad Pins

View File

@ -30,6 +30,7 @@ Configuration variables:
- **device_class** (*Optional*, string): The device class for the
sensor. See https://www.home-assistant.io/components/binary_sensor/
for a list of available options.
- **icon** (*Optional*, icon): Manually set the icon to use for the binary sensor in the frontend.
- **filters** (*Optional*, list): A list of filters to apply on the binary sensor values such as
inverting signals. See :ref:`binary_sensor-filters`.

View File

@ -0,0 +1,69 @@
Modbus Binary Sensor
====================
.. seo::
:description: Instructions for setting up a modbus_controller device binary sensor.
:image: modbus.png
The ``modbus_controller`` binary sensor platform creates a binary sensor from a modbus_controller component
and requires :doc:`/components/modbus_controller` to be configured.
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the sensor.
- **modbus_functioncode** (**Required**): type of the modbus register.
- "read_coils": Function 01 (01hex) Read Coils - Reads the ON/OFF status of discrete coils in the device.
- "read_discrete_inputs": Function 02(02hex) - Reads the ON/OFF status of discrete inputs in the device.
- "read_holding_registers": Function 03 (03hex) Read Holding Registers - Read the binary contents of holding registers in the device.
- "read_input_registers": Function 04 (04hex) Read Input Registers - Read the binary contents of input registers in the device.
- **address**: (**Required**, integer): start address of the first register in a range
- **bitmask** : some values are packed in a response. The bitmask is used to determined if the result is true or false
- **skip_updates**: (*Optional*, integer): By default all sensors of of a modbus_controller are updated together. For data points that don't change very frequently updates can be skipped. A value of 5 would only update this sensor range in every 5th update cycle
- **force_new_range**: (*Optional*, boolean): If possible sensors with sequential addresses are grouped together and requested in one range. Setting `foce_new_range: true` enforces the start of a new range at that address.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`):
Lambda to be evaluated every update interval to get the new value of the sensor
- **offset**: (*Optional*, integer): not required for most cases
offset from start address in bytes. If more than one register is read a modbus read registers command this value is used to find the start of this datapoint relative to start address. The component calculates the size of the range based on offset and size of the value type
The value for offset depends on the register type. If a binary_sensor is created from an input register the offset is in bytes. For coil and discrete input resisters the LSB of the first data byte contains the coil addressed in the request. The other coils follow toward the high-order end of this byte and from low order to high order in subsequent bytes. For the registers offset is the position of the relevant bit.
To get the value of the coil register 2 can be retrived using address: 2 / offset: 0 or address: 0 / offset 2
Example
.. code-block:: yaml
binary_sensor:
- platform: modbus_controller
modbus_controller_id: epever
id: battery_internal_resistance_abnormal
name: "Battery internal resistance abnormal"
register_type: read
address: 0x3200
bitmask: 0x80 #(bit 8)
Parameters passed into the lambda
- **x** (bool): The parsed float value of the modbus data
- **data** (std::vector<uint8_t): vector containing the complete raw modbus response bytes for this sensor
- **item** (const pointer to a ModbusBinarySensor object): The sensor object itself.
Possible return values for the lambda:
- ``return true/false;`` the new value for the sensor.
See Also
--------
- :apiclass:`:modbus_controller::ModbusBinarySensor`
- :doc:`/components/modbus_controller`
- :doc:`/components/switch/modbus_controller`
- :doc:`/components/output/modbus_controller`
- :doc:`/components/sensor/modbus_controller`
- :doc:`/components/text_sensor/modbus_controller`
- https://www.modbustools.com/modbus.html
- :ghedit:`Edit`

View File

@ -33,6 +33,7 @@ All climate platforms in ESPHome inherit from the climate configuration schema.
Configuration variables:
- **icon** (*Optional*, icon): Manually set the icon to use for the climate device in the frontend.
- **visual** (*Optional*): Visual settings for the climate device - these do not
affect operation and are solely for controlling how the climate device shows up in the
frontend.
@ -52,7 +53,42 @@ Advanced options:
- **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend,
(usually Home Assistant) without the user manually enabling it (via the Home Assistant UI).
Requires Home Assistant 2021.9 or newer. Defaults to ``false``.
- If MQTT enabled, all other options from :ref:`MQTT Component <config-mqtt-component>`.
MQTT options:
- **action_state_topic** (*Optional*, string): The topic to publish
climate device action changes to.
- **away_state_topic** (*Optional*, string): The topic to publish
away mode changes on.
- **away_command_topic** (*Optional*, string): The topic to receive
away mode commands on.
- **current_temperature_state_topic** (*Optional*, string): The topic to publish
current temperature changes to.
- **fan_mode_state_topic** (*Optional*, string): The topic to publish
fan mode changes to.
- **fan_mode_command_topic** (*Optional*, string): The topic to receive
fan mode commands on.
- **mode_state_topic** (*Optional*, string): The topic to publish
climate device mode changes to.
- **mode_command_topic** (*Optional*, string): The topic to receive
climate device mode commands on.
- **swing_mode_state_topic** (*Optional*, string): The topic to publish
swing mode changes to.
- **swing_mode_command_topic** (*Optional*, string): The topic to receive
swing mode commands on.
- **target_temperature_state_topic** (*Optional*, string): The topic to publish
target temperature changes to.
- **target_temperature_command_topic** (*Optional*, string): The topic to receive
target temperature commands on.
- **target_temperature_high_state_topic** (*Optional*, string): The topic to publish
higher target temperature changes to.
- **target_temperature_high_command_topic** (*Optional*, string): The topic to receive
higher target temperature commands on.
- **target_temperature_low_state_topic** (*Optional*, string): The topic to publish
lower target temperature changes to.
- **target_temperature_low_command_topic** (*Optional*, string): The topic to receive
lower target temperature commands on.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
Climate Automation
------------------

View File

@ -19,6 +19,8 @@ submit a feature request (see FAQ).
| Name | Platform name | Supports receiver |
| | | |
+=======================================+=====================+======================+
| :ref:`Arduino-HeatpumpIR<heatpumpir>` | ``heatpumpir`` | |
+---------------------------------------+---------------------+----------------------+
| Ballu | ``ballu`` | yes |
+---------------------------------------+---------------------+----------------------+
| Coolix | ``coolix`` | yes |
@ -81,6 +83,25 @@ Advanced Options
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **transmitter_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the remote transmitter.
.. _heatpumpir:
Arduino-HeatpumpIR
------------------
The ``heatpumpir`` platform supports dozens of manufacturers and hundreds of AC units by utilising the `Arduino-HeatpumpIR library <https://github.com/ToniA/arduino-heatpumpir>`__.
This platform should only be used if your AC unit is not supported by any of the other (native) platforms. No support can be provided for Arduino-HeatpumpIR, because it is a third party library.
This platform utilises the library's generic one-size-fits-all API, which might not line up perfectly with all of the supported AC units. For example, some AC units have more fan speed options than what the generic API supports.
Additional configuration must be specified for this platform:
- **protocol** (**Required**, string): Choose one of Arduino-HeatpumpIR's supported protcols: ``aux``, ``ballu``, ``carrier_mca``, ``carrier_nqv``, ``daikin_arc417``, ``daikin_arc480``, ``daikin``, ``fuego``, ``fujitsu_awyz``, ``gree``, ``greeya``, ``greeyan``, ``hisense_aud``, ``hitachi``, ``hyundai``, ``ivt``, ``midea``, ``mitsubishi_fa``, ``mitsubishi_fd``, ``mitsubishi_fe``, ``mitsubishi_heavy_fdtc``, ``mitsubishi_heavy_zj``, ``mitsubishi_heavy_zm``, ``mitsubishi_heavy_zmp``, ``mitsubishi_heavy_kj``, ``mitsubishi_msc``, ``mitsubishi_msy``, ``mitsubishi_sez``, ``panasonic_ckp``, ``panasonic_dke``, ``panasonic_jke``, ``panasonic_lke``, ``panasonic_nke``, ``samsung_aqv``, ``samsung_fjm``, ``sharp``, ``toshiba_daiseikai``, ``toshiba``
- **horizontal_default** (**Required**, string): What to default to when the AC unit's horizontal direction is *not* set to swing. Options are: ``left``, ``mleft``, ``middle``, ``mright``, ``right``, ``auto``
- **vertical_default** (**Required**, string): What to default to when the AC unit's vertical direction is *not* set to swing. Options are: ``down``, ``mdown``, ``middle``, ``mup``, ``up``, ``auto``
- **max_temperature** (**Required**, float): The maximum temperature that the AC unit supports being set to.
- **min_temperature** (**Required**, float): The minimum temperature that the AC unit supports being set to.
.. _ir-receiver_id:
Using a Receiver

View File

@ -27,7 +27,7 @@ On this controller, the data points are:
- 3 represents the target temperature.
- 4 represents the current temperature.
- 5 represents the timer but is not yet available to be used in ESPHome.
- 7 represents the eco mode switch. (use the :doc:`/components/switch/tuya` component to control this)
- 7 represents the eco mode switch.
Based on this, you can create the climate device as follows:
@ -39,6 +39,8 @@ Based on this, you can create the climate device as follows:
switch_datapoint: 1
target_temperature_datapoint: 3
current_temperature_datapoint: 4
eco_datapoint: 7
eco_temperature: 20 °C
Configuration variables:
------------------------
@ -47,13 +49,17 @@ Configuration variables:
- **name** (**Required**, string): The name of the climate device.
- **supports_heat** (*Optional*, boolean): Specifies if the device has a heating mode. Defaults to ``true``.
- **supports_cool** (*Optional*, boolean): Specifies if the device has a cooling mode. Defaults to ``false``.
- **switch_datapoint** (**Required**, int): The datapoint id number of the climate switch.
- **active_state_datapoint** (*Optional*, int): The datapoint id number of the active state.
- **active_state_heating_value** (*Optional*, int): The active state datapoint value the device reports when heating. Defaults to ``1``.
- **active_state_cooling_value** (*Optional*, int): The active state datapoint value the device reports when cooling.
- **switch_datapoint** (**Required**, int): The datapoint id number of the climate switch (device on/off).
- **active_state_datapoint** (*Optional*, int): The datapoint id number of the active state - :ref:`see below <active_state_detection>`.
- **active_state_heating_value** (*Optional*, int): The active state datapoint value the device reports when heating. Defaults to ``1`` - :ref:`see below <active_state_detection>`.
- **active_state_cooling_value** (*Optional*, int): The active state datapoint value the device reports when cooling - :ref:`see below <active_state_detection>`.
- **heating_state_pin** (*Optional*, :ref:`config-pin`): The input pin indicating that the device is heating - :ref:`see below <active_state_detection>`. Only used if **active_state_datapoint** is not configured.
- **cooling_state_pin** (*Optional*, :ref:`config-pin`): The input pin indicating that the device is cooling - :ref:`see below <active_state_detection>`. Only used if **active_state_datapoint** is not configured.
- **target_temperature_datapoint** (**Required**, int): The datapoint id number of the target temperature.
- **current_temperature_datapoint** (**Required**, int): The datapoint id number of the current temperature.
- **temperature_multiplier** (*Optional*, float): A multiplier to modify the incoming and outgoing temperature values - :ref:`see below <temperature-multiplier>`.
- **eco_datapoint** (*Optional*, int): The datapoint id number of the eco mode state.
- **eco_temperature** (*Optional*, float): The target temperature the controller uses while the eco mode is active.
If the device has different multipliers for current and target temperatures, **temperature_multiplier** can be replaced with both of:
@ -62,6 +68,19 @@ If the device has different multipliers for current and target temperatures, **t
- All other options from :ref:`Climate <config-climate>`.
.. _active_state_detection:
Active state detection
----------------------
Some Tuya climate devices report the active state (idle/heating/cooling) via a tuya data point. In this case, you can use the **active_state_datapoint** variable together with **active_state_heating_value** and **active_state_cooling_value**.
If your device does not make a data point available for this, it is possible to modify the hardware so that the relay outputs can be read by the ESP. Please refer to `this discussion <https://github.com/klausahrenberg/WThermostatBeca/issues/17>` for more details on the required modifications. You can then use the **heating_state_pin** and/or **cooling_state_pin** configuration variables to detect the current state.
If none of the above variables are set, the current state is inferred from the difference between the current and target temperatures.
If **supports_heat** is ``True`` and the current temperature is more than 1 °C below the target temperature, the device is expected to be heating.
If **supports_cool** is ``True`` and the current temperature is more than 1 °C above the target temperature, the device is expected to be cooling.
.. _temperature-multiplier:
Temperature multiplier

View File

@ -0,0 +1,265 @@
Current Based Cover
===================
.. seo::
:description: Instructions for setting up current-based covers in ESPHome.
:image: window-open.jpg
The ``current_based`` cover platform allows you to create covers with position control by using current
sensors to detect the fully-open and fully-closed states. This is pretty useful when using motors with
integrated mechanical endstops. During cover operation, the component monitors the current consumption
to detect when the motor has stopped.
When fully open or close is requested, the corresponding relay will stay on until the current the motor is
consuming goes below a certain amount. The amount of current needs to be specified in the configuration.
Open and close durations can be specified to allow ESPHome to approximate the current position of the cover.
.. figure:: images/more-info-ui.png
:align: center
:width: 75.0%
This type of cover also provides safety features like current-based obstacle detection with automatic configurable
rollback as well as relay malfunction detection: operation cancels if there's a current flowing in the opposite
operation circuit (typically caused by welded relays).
.. warning::
Depending on the cover and motor type, obstacles can physically damage the cover before being detectable.
Verify your setup to ensure the current consumption will increase enough to be detectable before causing
any physical damage. Use it at your own risk.
.. code-block:: yaml
# Example configuration entry
cover:
- platform: current_based
name: "Current Based Cover"
open_sensor: open_current_sensor
open_moving_current_threshold: 0.5
open_obstacle_current_threshold: 0.8
open_duration: 12s
open_action:
- switch.turn_on: open_cover_switch
close_sensor: close_current_sensor
close_moving_current_threshold: 0.5
close_obstacle_current_threshold: 0.8
close_duration: 10s
close_action:
- switch.turn_on: close_cover_switch
stop_action:
- switch.turn_off: close_cover_switch
- switch.turn_off: open_cover_switch
obstacle_rollback: 30%
start_sensing_delay: 0.8s
Configuration variables:
------------------------
- **name** (**Required**, string): The name of the cover.
- **open_sensor** (**Required**, :ref:`config-id`): The open current sensor.
- **open_action** (**Required**, :ref:`Action <config-action>`): The action that should
be performed when the remote requests the cover to be opened.
- **open_duration** (**Required**, :ref:`config-time`): The amount of time it takes the cover
to open up from the fully-closed state.
- **open_moving_current_threshold** (**Required**, float): The amount of current in Amps the motor
should drain to consider the cover is opening.
- **open_obstacle_current_threshold** (**Required**, float): The amount of current in Amps the motor
should drain to consider the cover is blocked during opening.
- **close_sensor** (**Required**, :ref:`config-id`): The close current sensor.
- **close_action** (*Optional*, :ref:`Action <config-action>`): The action that should
be performed when the remote requests the cover to be closed.
- **close_duration** (**Required**, :ref:`config-time`): The amount of time it takes the cover
to close from the fully-open state.
- **close_moving_current_threshold** (**Required**, float): The amount of current in Amps the motor
should drain to consider the cover is closing.
- **close_obstacle_current_threshold** (**Required**, float): The amount of current in Amps the motor
should drain to consider the cover is blocked during closing.
- **stop_action** (**Required**, :ref:`Action <config-action>`): The action that should
be performed to stop the cover.
- **max_duration** (*Optional*, :ref:`config-time`): The maximum duration the cover should be opening
or closing. Useful for protecting from dysfunctional motor integrated endstops.
- **start_sensing_delay** (*Optional*, :ref:`config-time`): The amount of time the current sensing will be
disabled when the movement starts. Motors can take some time before reaching their average consumption.
Low values can cause an immediate stop because of the first current reading happening in the current-rising period.
Defaults to ``500ms``.
- **obstacle_rollback** (*Optional*, percentage): The percentage of rollback the cover will perform in case of
obstacle detection. Defaults to ``10%``.
- **malfunction_detection** (*Optional*, boolean): Enable to detect malfunction detection (Tipically welded realys). Defaults to ``True``.
- **malfunction_action** (*Optional*, :ref:`Action <config-action>`): The action that should
be performed when relay malfunction is detected. Malfunction may require device servicing. You can use this action
to notify other systems about this situation
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Cover <config-cover>`.
Use with Shelly 2.5
-------------------
.. seo::
:description: Instructions for setting up current-based covers in ESPHome using a Shelly 2.5.
:image: shelly2.5.png
The Shelly 2.5 is the perfect hardware for this platform. It features two outputs with current monitoring
(thanks to an embedded :doc:`ADE7953 </components/sensor/ade7953>`) in a very small form factor (39mm x 36mm x 17 mm).
It also features an :doc:`NTC temperature sensor </components/sensor/ntc>`.
.. figure:: images/shelly2.5.png
:align: center
:width: 30.0%
These devices typically run hot (~55Cº at 20ºC room temperature). Long-term heavy loads (near to its rated limit) can overheat the device.
It is strongly recommended to monitor the device temperature using the NTC temperature sensor, shutting down the device if it exceeds 90ºC.
This safety feature is also present in the original firmware.
.. warning::
The ADE7953 IRQ line is connected to the GPIO16. The ``irq_pin`` parameter for the :doc:`ADE7953 </components/sensor/ade7953>` MUST be
set to GPIO16 to prevent device overheat (>70ºC idling).
Configuration example:
.. code-block:: yaml
esphome:
name: Shelly 2.5
platform: ESP8266
board: esp01_1m
esp8266_restore_from_flash: true
i2c:
sda: GPIO12
scl: GPIO14
sensor:
- platform: ade7953
irq_pin: GPIO16
voltage:
name: Shelly 2.5 Mains Voltage
internal: true
filters:
- throttle: 5s
current_a:
name: Shelly 2.5 Open Current
id: open_current
internal: true
current_b:
name: Shelly 2.5 Close Current
id: close_current
internal: true
update_interval: 0.5s
# NTC Temperature
- platform: ntc
sensor: temp_resistance_reading
name: Shelly 2.5 Temperature
unit_of_measurement: "°C"
accuracy_decimals: 1
calibration:
b_constant: 3350
reference_resistance: 10kOhm
reference_temperature: 298.15K
on_value_range:
above: 90
then: # Security shutdown by overheating
- switch.turn_on: _shutdown
- platform: resistance
id: temp_resistance_reading
sensor: temp_analog_reading
configuration: DOWNSTREAM
resistor: 32kOhm
internal: true
- platform: adc
id: temp_analog_reading
pin: A0
update_interval: 30s
internal: true
binary_sensor:
- platform: gpio
pin:
number: GPIO13
name: Shelly 2.5 Open Button
on_press:
then:
cover.open: blind
- platform: gpio
pin:
number: GPIO5
name: Shelly 2.5 Close Button
on_press:
then:
cover.close: blind
switch:
- platform: shutdown
id: _shutdown
name: Shelly 2.5 Shutdown
- platform: gpio
id: open_relay
name: Shelly 2.5 Open Relay
pin: GPIO15
restore_mode: RESTORE_DEFAULT_OFF
interlock: &interlock [open_relay, close_relay]
interlock_wait_time: 200ms
- platform: gpio
id: close_relay
name: Shelly 2.5 Close Relay
pin: GPIO4
restore_mode: RESTORE_DEFAULT_OFF
interlock: *interlock
interlock_wait_time: 200ms
# Example configuration entry
cover:
- platform: current_based
name: Blind
id: blind
open_sensor: open_current
open_moving_current_threshold: 0.5
open_duration: 12s
open_action:
- switch.turn_on: open_relay
close_sensor: close_current
close_moving_current_threshold: 0.5
close_duration: 10s
close_action:
- switch.turn_on: close_relay
stop_action:
- switch.turn_off: close_relay
- switch.turn_off: open_relay
obstacle_rollback: 30%
start_sensing_delay: 0.8s
malfunction_detection: true
malfunction_action:
then:
- logger.log: "Malfunction detected. Relay welded."
status_led:
pin:
number: GPIO0
inverted: yes
See Also
--------
- :doc:`index`
- :doc:`/components/cover/template`
- :doc:`/components/sensor/ade7953`
- :ref:`automation`
- :apiref:`current_based/current_based_cover.h`
- :ghedit:`Edit`

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

View File

@ -30,6 +30,7 @@ Configuration variables:
- **device_class** (*Optional*, string): The device class for the
sensor. See https://www.home-assistant.io/components/cover/ for a list of available options.
- **icon** (*Optional*, icon): Manually set the icon to use for the cover in the frontend.
Advanced options:
@ -39,7 +40,19 @@ Advanced options:
- **disabled_by_default** (*Optional*, boolean): If true, then this entity should not be added to any client's frontend,
(usually Home Assistant) without the user manually enabling it (via the Home Assistant UI).
Requires Home Assistant 2021.9 or newer. Defaults to ``false``.
- If MQTT enabled, all other options from :ref:`MQTT Component <config-mqtt-component>`.
MQTT options:
- **position_state_topic** (*Optional*, string): The topic to publish
cover position changes to.
- **position_command_topic** (*Optional*, string): The topic to receive
cover position commands on.
- **tilt_state_topic** (*Optional*, string): The topic to publish cover
cover tilt state changes to.
- **tilt_command_topic** (*Optional*, string): The topic to receive
cover tilt commands on.
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
.. _cover-open_action:
@ -110,6 +123,31 @@ This :ref:`action <config-action>` stops the cover with the given ID when execut
call.set_command_stop();
call.perform();
.. _cover-toggle_action:
``cover.toggle`` Action
-----------------------
This :ref:`action <config-action>` toggles the cover with the given ID when executed,
cycling through the states close/stop/open/stop... This allows the cover to be controlled
by a single push button.
.. code-block:: yaml
on_...:
then:
- cover.toggle: cover_1
.. note::
This action can also be expressed in :ref:`lambdas <config-lambda>`:
.. code-block:: cpp
auto call = id(cover_1).make_call();
call.set_command_toggle();
call.perform();
.. _cover-control_action:
``cover.control`` Action
@ -169,7 +207,7 @@ fields are read-only, if you want to act on the cover, use the ``make_call()`` m
} else {
// Cover is in-between open and closed
}
- ``tilt``: Retrieve the current tilt position of the cover, as a value between ``0.0`` and ``1.0``.
- ``current_operation``: The operation the cover is currently performing:
@ -184,6 +222,36 @@ fields are read-only, if you want to act on the cover, use the ``make_call()`` m
// Cover is currently closing
}
.. _cover-on_open_trigger:
``cover.on_open`` Trigger
*************************
This trigger is activated each time the cover reaches a fully open state.
.. code-block:: yaml
cover:
- platform: template # or any other platform
# ...
on_open:
- logger.log: "Cover is Open!"
.. _cover-on_closed_trigger:
``cover.on_closed`` Trigger
***************************
This trigger is activated each time the cover reaches a fully closed state.
.. code-block:: yaml
cover:
- platform: template # or any other platform
# ...
on_closed:
- logger.log: "Cover is Closed!"
See Also
--------

80
components/cover/tuya.rst Normal file
View File

@ -0,0 +1,80 @@
Tuya Cover
==========
.. seo::
:description: Instructions for setting up a Tuya cover motor.
The ``tuya`` cover platform creates a simple position-only cover from a
tuya serial component.
There are two components, the Tuya bus and the cover that uses it. The :doc:`/components/tuya`
component requires a :ref:`UART bus <uart>` to be configured. Put the ``tuya`` component in
the config and it will list the possible devices for you in the config log.
.. code-block:: yaml
# Example configuration entry
# Make sure your WiFi will connect
wifi:
ssid: "ssid"
password: "password"
# Make sure logging is not using the serial port
logger:
baud_rate: 0
# Enable Home Assistant API
api:
# Make sure you can upload new firmware OTA
ota:
# My dimmer used the hardware serial port on the alternate pins
uart:
rx_pin: GPIO13
tx_pin: GPIO15
baud_rate: 9600
# Register the Tuya MCU connection
tuya:
Here is an example output for a Tuya dimmer:
.. code-block:: text
[21:50:28][C][tuya:024]: Tuya:
[21:50:28][C][tuya:031]: Datapoint 2: int value (value: 53)
[21:50:28][C][tuya:029]: Datapoint 5: switch (value: OFF)
On this cover motor, the position control is datapoint 2.
Now you can create the cover.
.. code-block:: yaml
# Create a cover using the dimmer
cover:
- platform: "tuya"
name: "motor1"
position_datapoint: 2
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the cover.
- **position_datapoint** (**Required**, int): The datapoint id number of the cover position value.
- **min_value** (*Optional*, int, default 0): The lowest position value, meaning cover closed.
- **max_value** (*optional*, int, default 255): the highest position value, meaning cover opened.
- **invert_position** (*optional*, boolean): invert the meaning of ``min_value`` and ``max_value``.
When set to ``true``, ``min_value`` will mean opened and ``max_value`` is closed.
- All other options from :ref:`Cover <config-cover>`.
See Also
--------
- :doc:`/components/tuya`
- :doc:`/components/cover/index`
- :apiref:`tuya/cover/tuya_cover.h`
- :ghedit:`Edit`

View File

@ -1,3 +1,5 @@
.. _deep_sleep-component:
Deep Sleep Component
====================
@ -33,6 +35,8 @@ Configuration variables:
- **run_duration** (*Optional*, :ref:`config-time`): The time duration the node should be active, i.e. run code.
- **sleep_duration** (*Optional*, :ref:`config-time`): The time duration to stay in deep sleep mode.
- **touch_wakeup** (*Optional*, boolean): Only on ESP32. Use a touch event to wakeup from deep sleep. To be able
to wakeup from a touch event, :ref:`esp32-touch-binary-sensor` must be configured properly.
- **wakeup_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): Only on ESP32. A pin to wake up to once
in deep sleep mode. Use the inverted property to wake up to LOW signals.
- **wakeup_pin_mode** (*Optional*): Only on ESP32. Specify how to handle waking up from a ``wakeup_pin`` if

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -177,7 +177,7 @@ Configuration variables:
here will be compiled into the binary. Adjust this if you need some special characters or want to
reduce the size of the binary if you don't plan to use some glyphs. The items in the list can also
be more than one character long if you for example want to use font ligatures. Defaults to
``!"%()+,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz``.
``!"%()+=,-_.:°0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz``.
.. note::
@ -305,7 +305,7 @@ To display a text string from a ``text_sensor``, append ``.c_str()`` to the end
# ...
lambda: |-
it.printf(0, 0, id(my_font), "Text to follow: %s", id(template_text).state.c_str());
The last printf tip for use in displays I will discuss here is how to display binary sensor values. You
*could* of course just check the state with an ``if`` statement as the first few lines in the example below, but if
you want to be efficient you can use an *inline if* too. With the ``%s`` print specifier you can tell it to
@ -370,6 +370,116 @@ Configuration variables:
RGB displays use red, green, and blue, while grayscale displays may use white.
.. _display-graphs:
Graphs
******
You can display a graph of a sensor value(s) using this component. Examples:
.. figure:: images/graph_screen.png
:align: center
:width: 60.0%
.. figure:: images/graph_dualtrace.png
:align: center
:width: 60.0%
Graph component with options for grids, border and line-types.
.. code-block:: yaml
graph:
# Show bare-minimum auto-ranged graph
- id: single_temperature_graph
sensor: my_temperature
duration: 1h
width: 151
height: 51
# Show multi-trace graph
- id: multi_temperature_graph
duration: 1h
x_grid: 10min
y_grid: 1.0 # degC/div
width: 151
height: 51
traces:
- sensor: my_inside_temperature
line_type: DASHED
line_thickness: 2
color: my_red
- sensor: my_outside_temperature
line_type: SOLID
line_thickness: 3
color: my_blue
- sensor: my_beer_temperature
line_type: DOTTED
line_thickness: 2
color: my_green
Configuration variables:
- **id** (**Required**, :ref:`config-id`): The ID with which you will be able to reference the graph later
in your display code.
- **width** (**Required**, integer): The graph width in pixels
- **height** (**Required**, integer): The graph height in pixels
- **duration** (**Required**, seconds): The total graph history duration.
- **border** (*Optional*, boolean): Specifics if a border will be draw around the graph. Default is True.
- **x_grid** (*Optional*): Specifies the time per division. If not specified, no vertical grid will be drawn.
- **y_grid** (*Optional*, float): Specifics the number of units per division. If not specified, no horizontal grid will be drawn.
- **max_range** (*Optional*): Specifies the maximum Y-axis range.
- **min_range** (*Optional*): Specifies the minimum Y-axis range.
- **max_value** (*Optional*): Specifies the maximum Y-axis value.
- **min_value** (*Optional*): Specifies the minimum Y-axis value.
- **traces** (*Optional*): Use this to specify more than a single trace.
Trace specific fields:
- **sensor** (*Optional*, id): The sensor value to plot
- **line_thickness** (*Optional*): Defaults to 3
- **line_type** (*Optional*): Specifies the plot line-type. Can be one of the following: ``SOLID``, ``DOTTED``, ``DASHED``. Defaults to ``SOLID``.
- **color** (*Optional*): Sets the color of the sensor trace.
And then later in code:
.. code-block:: yaml
display:
- platform: ...
# ...
pages:
- id: page1
lambda: |-
// Draw the graph at position [x=10,y=20]
it.graph(10, 20, id(simple_temperature_graph));
- id: page2
lambda: |-
// Draw the graph at position [x=10,y=20]
it.graph(10, 20, id(multi_temperature_graph), my_yellow);
color:
- id: my_red
red: 100%
green: 0%
blue: 0%
- id: my_green
red: 0%
green: 100%
blue: 0%
- id: my_blue
red: 0%
green: 0%
blue: 100%
- id: my_yellow
red: 100%
green: 100%
blue: 0%
.. note::
Here are some things to note:
- Setting ``y_grid`` will expand any specified range to the nearest multiple of grid spacings.
- Axis labels are currently not possible without manually placing them.
- The grid and border color is set with it.graph(), while the traces are defined separately.
Images
******
@ -609,7 +719,7 @@ You can then switch between these with three different actions:
- **to** (*Optional*, :ref:`config-id`): A page id. If set the automation is only triggered if changing to this page. Defaults to all pages.
Additionally the old page will be given as the variable ``from`` and the new one as the variable ``to``.
See Also
--------

View File

@ -12,11 +12,11 @@ Over I²C
The ``ssd1306_i2c`` display platform allows you to use
SSD1306 (`datasheet <https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf>`__,
`Adafruit <https://www.adafruit.com/product/326>`__)
`Adafruit <https://www.adafruit.com/product/326>`__), SSD1305 (`datasheet <https://cdn-shop.adafruit.com/datasheets/SSD1305.pdf>`__)
and SH1106 (`datasheet <https://www.elecrow.com/download/SH1106%20datasheet.pdf>`__,
`electrodragon <https://www.electrodragon.com/product/1-3-12864-blue-oled-display-iicspi/>`__)
displays with ESPHome. Note that this component is for displays that are connected via the :ref:`I²C Bus <i2c>`.
If your SSD1306 or SH1106 is connected via the 4-Wire :ref:`SPI bus <spi>`, see :ref:`ssd1306-spi`.
If your SSD1306/SSD1305 or SH1106 is connected via the 4-Wire :ref:`SPI bus <spi>`, see :ref:`ssd1306-spi`.
.. figure:: images/ssd1306-full.jpg
:align: center
@ -56,14 +56,22 @@ Configuration variables:
- ``SH1106 128x64``
- ``SH1106 96x16``
- ``SH1106 64x48``
- ``SSD1305 128x32``
- ``SSD1305 128x64``
- **reset_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The RESET pin. Defaults to not connected.
- **address** (*Optional*, int): Manually specify the :ref:`I²C <i2c>` address of the display. Defaults to 0x3C.
- **rotation** (*Optional*): Set the rotation of the display. Everything you draw in ``lambda:`` will be rotated
by this option. One of ```` (default), ``90°``, ``180°``, ``270°``.
- **brightness** (*Optional*, percentage): Set display brightness in %. Defaults to ``100%``
- **contrast** (*Optional*, percentage): Set display contrast in %. Defaults to ``100%``.
- **brightness** (*Optional*, percentage): Set display brightness in %. Only can be used with SSD1305. Defaults to ``100%``.
- **external_vcc** (*Optional*, boolean): Set this to true if you have the VCC pin connected to an external power supply.
Defaults to ``false``.
- **flip_x** (*Optional*, boolean): Flip the horizontal axis on the screen. Defaults to ``true``.
- **flip_y** (*Optional*, boolean): Flip the vertical axis on the screen. Defaults to ``true``.
- **offset_x** (*Optional*, int): Set this option if some horizontal pixel is missing. Numbers are only allowed between ``0~15``. Defaults to ``0``.
- **offset_y** (*Optional*, int): Set this option if some vertical pixel is missing. Numbers are only allowed between ``0~15``. Defaults to ``0``.
- **invert** (*Optional*, boolean): Invert all pixel state on the display. Defaults to ``false``.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`): The lambda to use for rendering the content on the display.
See :ref:`display-engine` for more information.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``5s``.
@ -126,15 +134,23 @@ Configuration variables:
- ``SH1106 128x64``
- ``SH1106 96x16``
- ``SH1106 64x48``
- ``SSD1305 128x32``
- ``SSD1305 128x64``
- **cs_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The Chip Select (CS) pin.
- **dc_pin** (**Required**, :ref:`Pin Schema <config-pin_schema>`): The DC pin.
- **reset_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The RESET pin. Defaults to not connected.
- **rotation** (*Optional*): Set the rotation of the display. Everything you draw in ``lambda:`` will be rotated
by this option. One of ```` (default), ``90°``, ``180°``, ``270°``.
- **brightness** (*Optional*, percentage): Set display brightness in %. Defaults to ``100%``
- **contrast** (*Optional*, percentage): Set display contrast in %. Defaults to ``100%``.
- **brightness** (*Optional*, percentage): Set display brightness in %. Only can be used with SSD1305. Defaults to ``100%``.
- **external_vcc** (*Optional*, boolean): Set this to true if you have the VCC pin connected to an external power supply.
Defaults to ``false``.
- **flip_x** (*Optional*, boolean): Flip the horizontal axis on the screen. Defaults to ``true``.
- **flip_y** (*Optional*, boolean): Flip the vertical axis on the screen. Defaults to ``true``.
- **offset_x** (*Optional*, int): Set this option if some horizontal pixel is missing. Numbers are only allowed between ``0~15``. Defaults to ``0``.
- **offset_y** (*Optional*, int): Set this option if some vertical pixel is missing. Numbers are only allowed between ``0~15``. Defaults to ``0``.
- **invert** (*Optional*, boolean): Invert all pixel state on the display. Defaults to ``false``.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`): The lambda to use for rendering the content on the display.
See :ref:`display-engine` for more information.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to re-draw the screen. Defaults to ``5s``.
@ -149,4 +165,5 @@ See Also
- :doc:`index`
- :apiref:`ssd1306_base/ssd1306_base.h`
- `SSD1306 Library <https://github.com/adafruit/Adafruit_SSD1306>`__ by `Adafruit <https://www.adafruit.com/>`__
- `SSD1305 Library <https://github.com/adafruit/Adafruit_SSD1305>`__ by `Adafruit <https://www.adafruit.com/>`__
- :ghedit:`Edit`

View File

@ -52,6 +52,7 @@ Configuration variables:
- **col_start** (**Required**, int): The starting column offset. Default value depends on **model**.
- **row_start** (**Required**, int): The starting row offset. Default value depends on **model**.
- **use_bgr** (*Optional*, "true/false"): Use BGR mode. Default is false.
- **invert_colors** (*Optional*, "true/false"): Invert LCD colors. Default is false.
- **eight_bit_color** (*Optional*, "true/false" ): 8bit mode. Default is false. This saves 50% of the buffer required for the display.
- **reset_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The RESET pin.

View File

@ -92,6 +92,7 @@ Configuration variables:
- ``4.20in-bV2`` (B/W rendering only)
- ``5.83in``
- ``7.50in``
- ``7.50in-bc`` (display with version sticker '(C)' on the back, B/W rendering only)
- ``7.50inV2`` (Can't use with an ESP8266 as it runs out of RAM)
- **busy_pin** (*Optional*, :ref:`Pin Schema <config-pin_schema>`): The BUSY pin. Defaults to not connected.

View File

@ -276,6 +276,35 @@ This option behaves differently depending on what the included file is pointing
AND compiled into the binary. This way implementation of classes and functions in header files can
be provided.
.. _preferences-flash_write_interval:
Adjusting flash writes
------------------------
.. code-block:: yaml
# Example configuration entry
preferences:
flash_write_interval: 1min
- **flash_write_interval** (*Optional*, :ref:`config-time`): Customize the frequency in which data is
flushed to the flash. This setting helps to prevent rapid changes to a component from being quickly
written to the flash and wearing it out. Defaults to ``1min``.
As all devices have a limited number of flash write cycles, this setting helps to reduce the number of flash writes
due to quickly changing components. In the past, when components such as ``light``, ``switch``, ``fan`` and ``globals``
were changed, the state was immediately committed to flash. The result of this was that the last state of these
components would always restore to its last state on power loss, however, this has the cost of potentially quickly
damaging the flash if these components are quickly changed.
A safety feature has thus been implemented to mitigate issues resulting from the limited number of flash write cycles,
the state is first stored in memory before being flushed to flash after the ``flash_write_interval`` has passed. This
results in fewer flash writes, preserving the flash health.
This behavior can be disabled by setting ``flash_write_interval`` to ``0s`` to immediately commit the state to flash,
however, be aware that this may lead to increased flash wearing and a shortened device lifespan!
For ESP8266, :ref:`esphome-esp8266_restore_from_flash` must also be set to true for states to be written to flash.
.. _esphome-changing_node_name:

View File

@ -5,7 +5,7 @@ H-bridge Fan
:description: Instructions for setting up hbridge controlled fans (or motors).
:image: fan.png
The `'hbridge`' fan platform allows you to use a compatible `h-bridge` (L298N, DRV8871, MX1508, BTS7960, L9110S, DRV8833, TB6612, etc.) to control a fan (or motor).
The `'hbridge`' fan platform allows you to use a compatible `h-bridge` (L298N, DRV8871, MX1508, BTS7960, L9110S, DRV8833, TB6612, etc.) to control a fan (or motor/solenoid).
.. figure:: images/L298N_module.jpg
:align: center
@ -25,7 +25,7 @@ The `'hbridge`' fan platform allows you to use a compatible `h-bridge` (L298N, D
# Example configuration entry
fan:
- platform: hbridge
output: my_output_1
id: my_fan
name: "Living Room Fan"
pin_a: motor_forward_pin
pin_b: motor_reverse_pin
@ -39,9 +39,9 @@ Configuration variables:
:ref:`float output <output>` connected to Pin A (alternatively IN1, etc.) of the h-bridge.
- **pin_b** (**Required**, :ref:`config-id`): The id of the
:ref:`float output <output>` connected to Pin B (alternatively IN2, etc.) of the h-bridge.
- **enable_pin** (**Optional**, :ref:`config-id`): The id of the
- **enable_pin** (*Optional*, :ref:`config-id`): The id of the
:ref:`float output <output>` connected to the Enable pin of the h-bridge (if h-bridge uses enable).
- **decay_mode** (**Optional**, string): The decay mode you want to use with
- **decay_mode** (*Optional*, string): The decay mode you want to use with
the h-bridge. Either ``slow`` (braking) or ``fast`` (coasting). Defaults to ``slow``.
- **name** (**Required**, string): The name for this fan.
- **oscillation_output** (*Optional*, :ref:`config-id`): The id of the
@ -63,7 +63,7 @@ Set all h-bridge pins high, shorting the fan/motor's windings and forcing the mo
on_...:
then:
- fan.hbridge.brake: fan_1
- fan.hbridge.brake: my_fan
See Also
--------

View File

@ -29,6 +29,7 @@ Base Fan Configuration
Configuration variables:
- **name** (**Required**, string): The name of the fan.
- **icon** (*Optional*, icon): Manually set the icon to use for the fan in the frontend.
- **internal** (*Optional*, boolean): Mark this component as internal. Internal components will
not be exposed to the frontend (like Home Assistant). Only specifying an ``id`` without
a ``name`` will implicitly set this to true.
@ -42,10 +43,14 @@ MQTT options:
publish fan oscillation state changes to.
- **oscillation_command_topic** (*Optional*, string): The topic to
receive oscillation commands on.
- **speed_level_state_topic** (*Optional*, int): The topic to publish
numeric fan speed state changes to (range: 0 to speed count).
- **speed_level_command_topic** (*Optional*, int): The topic to receive
numeric speed commands on (range: 0 to speed count).
- **speed_state_topic** (*Optional*, string): The topic to publish fan
speed state changes to.
speed state changes to (options: LOW, MEDIUM, HIGH).
- **speed_command_topic** (*Optional*, string): The topic to receive
speed commands on.
speed commands on (options: LOW, MEDIUM, HIGH).
- All other options from :ref:`MQTT Component <config-mqtt-component>`.
Automation triggers:
@ -109,6 +114,20 @@ Configuration options:
- **direction** (*Optional*, string, :ref:`templatable <config-templatable>`):
Set the diretion of the fan. Can be either ``forward`` or ``reverse``. Defaults to not changing the direction.
.. _fan-cycle_speed_action:
``fan.cycle_speed`` Action
--------------------------
Increments through speed levels of the fan with the given ID when executed. If the fan's speed level is set to maximum when executed, turns fan off.
.. code-block:: yaml
on_...:
then:
- fan.cycle_speed: fan_1
.. _fan-is_on_condition:
.. _fan-is_off_condition:

View File

@ -29,6 +29,21 @@ Configuration variables:
- **timeout** (*Optional*, :ref:`time <config-time>`): Timeout for request. Defaults to ``5s``.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
ESP8266 Options:
- **esp8266_disable_ssl_support** (*Optional*, boolean): Whether to include SSL support on ESP8266s.
Defaults to ``no``. See :ref:`esphome-esp8266_disable_ssl_support` for more info
.. _esphome-esp8266_disable_ssl_support:
``esp8266_disable_ssl_support``
-------------------------------
This options allows you to disable inclusion of SSL libraries. This is required on a flash
constrained devices (512k or 1M) which does not have enough space to support
SSL and OTA concurrently. The flashing will fail with the following error
``Error: ESP does not have enough space to store OTA file``.
HTTP Request Actions
--------------------

View File

@ -26,6 +26,7 @@ All light configuration schemas inherit these options.
Configuration variables:
- **icon** (*Optional*, icon): Manually set the icon to use for the light in the frontend.
- **effects** (*Optional*, list): A list of :ref:`light effects <light-effects>` to use for this light.
- **gamma_correct** (*Optional*, float): Apply a `gamma correction
factor <https://en.wikipedia.org/wiki/Gamma_correction>`__ to the light channels.

View File

@ -6,8 +6,8 @@ Light Partition
:image: color_lens.png
The ``partition`` light platform allows you to combine multiple addressable light segments
(like :doc:`fastled` or :doc:`neopixelbus`) into a single addressable light.
This platform also allows splitting up an addressable lights into multiple segments, so that
(like :doc:`fastled` or :doc:`neopixelbus`) and/or individual lights (like :doc:`rgb`) into a single addressable light.
This platform also allows splitting up an addressable light into multiple segments, so that
segments can be individually controlled.
Splitting a single LED strip
@ -44,7 +44,7 @@ mark the original ``light`` as ``internal: true``.
internal: true
# Other settings
Joining multiple LED strips into one
Joining multiple LED lights into one
------------------------------------
.. code-block:: yaml
@ -63,6 +63,8 @@ Joining multiple LED strips into one
- id: light2
from: 0
to: 9
# Use light3 as the 21st light in the partition
- single_light_id: light3
# Example for light segment source
- platform: fastled_clockless
@ -78,17 +80,31 @@ Joining multiple LED strips into one
internal: true
# Other settings
# Example for non-addressable light source
- platform: rgb
id: light3
# You may want (but don't need) this
internal: true
# Other settings
Configuration variables:
------------------------
- **name** (**Required**, string): The name of the light.
- **segments** (**Required**, list): The segments this light partition controls
- **segments** (**Required**, list): A list of segments included in this partition.
*For addressable segments:*
- **id** (**Required**, :ref:`config-id`): The ID of the light this segment belongs to.
- **from** (**Required**, int): The first LED to address in the segment. Counting starts with 0,
- **id** (**Required**, :ref:`config-id`): The ID of the addressable light to be controlled by this segment.
- **from** (**Required**, int): The index of the first LED to address in the segment. Counting starts with 0,
so first LED is 0.
- **to** (**Required**, int): The index of the last LED to address in this segment.
- **reversed** (**Required**, int): Whether to reverse the LEDs in this segment.
- **reversed** (**Optional**, boolean): Whether to reverse the order of LEDs in this segment. Defaults to ``false``.
*For single light segments:*
- **single_light_id** (**required**, :ref:`config-id`): The ID of a single addressable or non-addressable light.
If an addressable light is specified, it will be treated as a single light in the partition.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **effects** (*Optional*, list): A list of :ref:`light effects <light-effects>` to use for this light.

View File

@ -81,18 +81,26 @@ Configuration variables:
change the brightness and would have to toggle the light using the physical buttons.
- **color_temperature_datapoint** (*Optional*, int): The datapoint id number of the color
temperature value.
- **rgb_datapoint** (*Optional*, int): The datapoint id number of the RGB (red/green/blue) value.
If this is set then ESPHome will set the color using a 6 digit hex RGB value.
- **hsv_datapoint** (*Optional*, int): The datapoint id number of the HSV (hue/saturation/value) value.
If this is set then ESPHome will set the color using a 12 digit hex HSV value.
- **min_value** (*Optional*, int, default 0): The lowest dimmer value allowed. My dimmer had a
minimum of 25 and wouldn't even accept anything lower, but this option is available if necessary.
- **max_value** (*Optional*, int, default 255): The highest dimmer value allowed. Most dimmers have a
maximum of 255, but dimmers with a maximum of 1000 can also be found. Try what works best.
- **color_temperature_max_value** (*Optional*, int, default 255): The highest color temperature
value allowed. Some ceiling fans have a value of 100 (also for `max_value`).
- **color_temperature_invert** (*Optional*, boolean, default false): Control how color temperature
values are sent to the MCU. If this is set to true ESPHome will treat 0 as warm white and
**color_temperature_max_value** as cool white when setting **color_temperature_datapoint**.
- **cold_white_color_temperature** (*Optional*, float): The color temperature (in `mireds
<https://en.wikipedia.org/wiki/Mired>`__ or Kelvin) of the cold white channel.
- **warm_white_color_temperature** (*Optional*, float): The color temperature (in `mireds
<https://en.wikipedia.org/wiki/Mired>`__ or Kelvin) of the warm white channel.
- All other options from :ref:`Light <config-light>`.
- At least one of *dimmer_datapoint* or *switch_datapoint* must be provided.
- At least one of *dimmer_datapoint*, *switch_datapoint*, *rgb_datapoint*, or *hsv_datapoint* must be provided.
- Only one of *rgb_datapoint* or *hsv_datapoint* can be provided for one light.
.. note::

View File

@ -24,8 +24,14 @@ Configuration variables:
------------------------
- **flow_control_pin** (*Optional*, :ref:`config-pin`): The pin used to switch flow control.
This is useful for RS485 transeivers that do not have automatic flow control switching,
like the common MAX485.
This is useful for RS485 transeivers that do not have automatic flow control switching,
like the common MAX485.
- **send_wait_time** (*Optional*, :ref:`time`): Time in milliseconds before a new modbus command is sent if an answer from a previous command is pending. Defaults to 250 ms.
If multiple modbus devices are attached increasing this value can help avoiding to to overlapping reads.
When 2 devices are sending a command at the same the the response read from uart can't be assigend to the proper design.
This value defines the maximumm queuing time for a command before it is send anyways.
See Also
--------

View File

@ -0,0 +1,464 @@
Modbus Controller
=================
.. seo::
:description: Instructions for setting up the Modbus Controller component.
:image: modbus.png
The ``modbus_controller`` component creates a RS485 connection to control a modbus device
.. warning::
If you are using the :doc:`logger` uart logging might interfere especially on esp8266. You can disable the uart logging with the ``baud_rate: 0`` option.
.. figure:: /images/modbus.png
:align: center
:width: 25%
The ``modbus_controller`` component uses the modbus component
Hardware setup
--------------
I'm using a RS 485 module connected to an ESP32
.. figure:: /images/rs485.jpg
See [How is this RS485 Module Working?](https://electronics.stackexchange.com/questions/244425/how-is-this-rs485-module-working) on stackexchange for more details
The controller connects to the UART of the MCU. For ESP32 GPIO PIN 16 to TXD PIN 17 to RXD are the default ports but any other pins can be used as well . 3.3V to VCC and GND to GND.
Configuration variables:
------------------------
- **modbus_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the modbus hub.
- **address** (*Required*, :ref:`config-id`): The modbus address of the device
Specify the modbus device address of the.
- **command_throttle** (*Optional*, int): minimum time in milliseconds between 2 requests to the device. Default is 0ms
Because some modbus devices limit the rate of requests the interval between sending requests to the device can be modified.
Getting started with Home Assistant
-----------------------------------
The following code create a modbus_controller hub talking to a modbus device at address 1 with 115200 bps
Modbus sensors can be directly defined (inline) under the modbus_controller hub or as standalone components
Technically there is no difference between the "inline" and the standard definitions approach.
.. code-block:: yaml
esphome:
name: solarstation
platform: ESP32
board: esp32dev
substitutions:
updates: 30s
wifi:
ssid: !secret wifi_sid
password: !secret wifi_password
reboot_timeout: 2min
logger:
level: INFO
baud_rate: 0
api:
password: !secret api_password
uart:
id: mod_bus
tx_pin: 17
rx_pin: 16
baud_rate: 115200
stop_bits: 1
modbus:
flow_control_pin: 5
id: modbus1
modbus_controller:
- id: epever
## the Modbus device addr
address: 0x1
modbus_id: modbus1
setup_priority: -10
text_sensor:
- name: "rtc_clock"
platform: modbus_controller
modbus_controller_id: epever
id: rtc_clock
internal: true
register_type: holding
address: 0x9013
register_count: 3
raw_encode: HEXBYTES
response_size: 6
switch:
- platform: modbus_controller
modbus_controller_id: epever
id: reset_to_fabric_default
name: "Reset to Factory Default"
register_type: coil
address: 0x15
bitmask: 1
sensor:
- platform: modbus_controller
modbus_controller_id: epever
name: "Battery Capacity"
id: battery_capacity
register_type: holding
address: 0x9001
unit_of_measurement: "AH"
value_type: U_WORD
Protocol decoding example
-------------------------
.. code-block:: yaml
sensors:
- platform: modbus_controller
modbus_controller_id: epever
id: array_rated_voltage
name: "array_rated_voltage"
address: 0x3000
unit_of_measurement: "V"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
skip_updates: 60
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: array_rated_current
name: "array_rated_current"
address: 0x3001
unit_of_measurement: "V"
register_type: read
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: array_rated_power
name: "array_rated_power"
address: 0x3002
unit_of_measurement: "W"
register_type: read
value_type: U_DWORD_R
accuracy_decimals: 1
filters:
- multiply: 0.01
-platform: modbus_controller
modbus_controller_id: epever
id: battery_rated_voltage
name: "battery_rated_voltage"
address: 0x3004
unit_of_measurement: "V"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: battery_rated_current
name: "battery_rated_current"
address: 0x3005
unit_of_measurement: "A"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: battery_rated_power
name: "battery_rated_power"
address: 0x3006
unit_of_measurement: "W"
register_type: read
value_type: U_DWORD_R
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever id: charging_mode
name: "charging_mode"
address: 0x3008
unit_of_measurement: ""
register_type: read
value_type: U_WORD
accuracy_decimals: 0
To minimize the required transactions all registers with the same base address are read in one request.
The response is mapped to the sensor based on register_count and offset in bytes.
**Request**
+-----------+-----------------------------------------+
| data | description |
+===========+=========================================+
| 0x1 (01) | device address |
+-----------+-----------------------------------------+
| 0x4 (04) | function code 4 (Read Input Registers) |
+-----------+-----------------------------------------+
| 0x30 (48) | start address high byte |
+-----------+-----------------------------------------+
| 0x0 (00) | start address low byte |
+-----------+-----------------------------------------+
| 0x0 (00) | number of registers to read high byte |
+-----------+-----------------------------------------+
| 0x9 (09) | number of registers to read low byte |
+-----------+-----------------------------------------+
| 0x3f (63) | crc |
+-----------+-----------------------------------------+
| 0xc (12) | crc |
+-----------+-----------------------------------------+
**Response**
+--------+------------+--------------------+--------------------------------------------+
| offset | data | value (type) | description |
+========+============+====================+============================================+
| H | 0x1 (01) | | device address |
+--------+------------+--------------------+--------------------------------------------+
| H | 0x4 (04) | | function code |
+--------+------------+--------------------+--------------------------------------------+
| H | 0x12 (18) | | byte count |
+--------+------------+--------------------+--------------------------------------------+
| 0 | 0x27 (39) | U_WORD | array_rated_voltage high byte |
+--------+------------+--------------------+--------------------------------------------+
| 1 | 0x10 (16) | 0x2710 (100000) | array_rated_voltage low byte |
+--------+------------+--------------------+--------------------------------------------+
| 2 | 0x7 (7) | U_WORD | array_rated_current high byte |
+--------+------------+--------------------+--------------------------------------------+
| 3 | 0xd0 (208) | 0x7d0 (2000) | array_rated_current low byte |
+--------+------------+--------------------+--------------------------------------------+
| 4 | 0xcb (203) | U_DWORD_R | array_rated_power high byte of low word |
+--------+------------+--------------------+--------------------------------------------+
| 5 | 0x20 (32) | spans 2 register | array_rated_power low byte of low word |
+--------+------------+--------------------+--------------------------------------------+
| 6 | 0x0 (0) | | array_rated_power high byte of high word |
+--------+------------+--------------------+--------------------------------------------+
| 7 | 0x0 (0) | 0x0000CB20 (52000) | array_rated_power low byte of high word |
+--------+------------+--------------------+--------------------------------------------+
| 8 | 0x9 (09) | U_WORD | battery_rated_voltage high byte |
+--------+------------+--------------------+--------------------------------------------+
| 9 | 0x60 (96) | 0x960 (2400) | battery_rated_voltage low byte |
+--------+------------+--------------------+--------------------------------------------+
| 10 | 0x7 (07) | U_WORD | battery_rated_current high word |
+--------+------------+--------------------+--------------------------------------------+
| 11 | 0xd0 (208) | 0x7d0 (2000) | battery_rated_current high word |
+--------+------------+--------------------+--------------------------------------------+
| 12 | 0xcb (203) | U_DWORD_R | battery_rated_power high byte of low word |
+--------+------------+--------------------+--------------------------------------------+
| 13 | 0x20 (32) | spans 2 register | battery_rated_power low byte of low word |
+--------+------------+--------------------+--------------------------------------------+
| 14 | 0x0 (0) | | battery_rated_power high byte of high word |
+--------+------------+--------------------+--------------------------------------------+
| 15 | 0x0 (0) | 0x0000CB20 (52000) | battery_rated_power low byte of high word |
+--------+------------+--------------------+--------------------------------------------+
| 16 | 0x0 (0) | U_WORD | charging_mode high byte |
+--------+------------+--------------------+--------------------------------------------+
| 17 | 0x2 (02) | 0x2 (MPPT) | charging_mode low byte |
+--------+------------+--------------------+--------------------------------------------+
| C | 0x2f (47) | | crc |
+--------+------------+--------------------+--------------------------------------------+
| C | 0x31 (49) | | crc |
+--------+------------+--------------------+--------------------------------------------+
Note
----
Write support is only implemented for switches.
However the C++ code provides the required API to write to a modbus device.
These methods can be called from a lambda.
Here is an example how to set config values to for an EPEVER Trace AN controller.
The code synchronizes the localtime of MCU to the epever controller
The time is set by writing 12 bytes to register 0x9013.
Then battery charge settings are sent.
.. code-block:: yaml
esphome:
name: solarstation-test
platform: ESP32
board: esp32dev
## send config values at startup
## configure rtc clock and battery charge settings
on_boot:
priority: -100
then:
- lambda: |-
on_boot:
## configure controller settings at setup
## make sure priority is lower than setup_priority of modbus_controller
priority: -100
then:
- lambda: |-
// get local time and sync to controller
time_t now = ::time(nullptr);
struct tm *time_info = ::localtime(&now);
int seconds = time_info->tm_sec;
int minutes = time_info->tm_min;
int hour = time_info->tm_hour;
int day = time_info->tm_mday;
int month = time_info->tm_mon + 1;
int year = time_info->tm_year % 100;
esphome::modbus_controller::ModbusController *controller = id(epever);
// if there is no internet connection localtime returns year 70
if (year != 70) {
// create the payload
std::vector<uint16_t> rtc_data = {uint16_t((minutes << 8) | seconds), uint16_t((day << 8) | hour),
uint16_t((year << 8) | month)};
// Create a modbus command item with the time information as the payload
esphome::modbus_controller::ModbusCommandItem set_rtc_command =
esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller, 0x9013, 3, rtc_data);
// Submit the command to the send queue
epever->queue_command(set_rtc_command);
ESP_LOGI("ModbusLambda", "EPSOLAR RTC set to %02d:%02d:%02d %02d.%02d.%04d", hour, minutes, seconds, day, month,
year + 2000);
}
// Battery settings
// Note: these values are examples only and apply my AGM Battery
std::vector<uint16_t> battery_settings1 = {
0, // 9000 Battery Type 0 = User
0x0073, // 9001 Battery Cap 0x55 == 115AH
0x012C, // 9002 Temp compensation -3V /°C/2V
0x05DC, // 9003 0x5DC == 1500 Over Voltage Disconnect Voltage 15,0
0x058C, // 9004 0x58C == 1480 Charging Limit Voltage 14,8
0x058C, // 9005 Over Voltage Reconnect Voltage 14,8
0x05BF, // 9006 Equalize Charging Voltage 14,6
0x05BE, // 9007 Boost Charging Voltage 14,7
0x0550, // 9008 Float Charging Voltage 13,6
0x0528, // 9009 Boost Reconnect Charging Voltage 13,2
0x04C4, // 900A Low Voltage Reconnect Voltage 12,2
0x04B0, // 900B Under Voltage Warning Reconnect Voltage 12,0
0x04BA, // 900c Under Volt. Warning Volt 12,1
0x04BA, // 900d Low Volt. Disconnect Volt. 11.8
0x04BA // 900E Discharging Limit Voltage 11.8
};
// Boost and equalization periods
std::vector<uint16_t> battery_settings2 = {
0x0000, // 906B Equalize Duration (min.) 0
0x0075 // 906C Boost Duration (aka absorb) 117 mins
};
esphome::modbus_controller::ModbusCommandItem set_battery1_command =
esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller, 0x9000, battery_settings1.size() ,
battery_settings1);
esphome::modbus_controller::ModbusCommandItem set_battery2_command =
esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller, 0x906B, battery_settings3.size(),
battery_settings2);
delay(200) ;
controller->queue_command(set_battery1_command);
delay(200) ;
controller->queue_command(set_battery2_command);
ESP_LOGI("ModbusLambda", "EPSOLAR Battery set");
uart:
id: mod_bus
tx_pin: 19
rx_pin: 18
baud_rate: 115200
stop_bits: 1
modbus:
#flow_control_pin: 23
send_wait_time: 200ms
id: mod_bus_epever
modbus_controller:
- id: epever
## the Modbus device addr
address: 0x1
modbus_id: mod_bus_epever
command_throttle: 0ms
setup_priority: -10
update_interval: ${updates}
sensor:
- platform: modbus_controller
modbus_controller_id: epever
id: array_rated_voltage
name: "array_rated_voltage"
address: 0x3000
unit_of_measurement: "V"
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: array_rated_current
name: "array_rated_current"
address: 0x3001
unit_of_measurement: "A"
register_type: read
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: epever
id: array_rated_power
name: "array_rated_power"
address: 0x3002
unit_of_measurement: "W"
register_type: read
value_type: U_DWORD_R
accuracy_decimals: 1
filters:
- multiply: 0.01
See Also
--------
- :doc:`/components/sensor/modbus_controller`
- :doc:`/components/binary_sensor/modbus_controller`
- :doc:`/components/text_sensor/modbus_controller`
- :doc:`/components/switch/modbus_controller`
- :doc:`/components/number/modbus_controller`
- :doc:`/components/output/modbus_controller`
- :doc:`EPEVER MPPT Solar Charge Controller Tracer-AN Series</cookbook/tracer-an>`
- `Modbus RTU Protocol Description <https://www.modbustools.com/modbus.html>`__
- :ghedit:`Edit`

View File

@ -6,15 +6,13 @@ MQTT Client Component
:image: mqtt.png
:keywords: MQTT
The MQTT Client Component sets up the MQTT connection to your broker and
is currently required for ESPHome to work. In most cases, you will
just be able to copy over the `MQTT
section <https://www.home-assistant.io/components/mqtt/>`__ of your Home
Assistant configuration.
The MQTT Client Component sets up the MQTT connection to your broker.
If you are connecting to Home Assistant, you may prefer to use the native API,
in which case this is not needed.
.. warning::
When enabling MQTT and you do *not* use the "native API" for Home Assistant, you must
If you enable MQTT and you do *not* use the "native API" for Home Assistant, you must
remove the ``api:`` line from your ESPHome configuration, otherwise the ESP will
reboot every 15 minutes because no client connected to the native API.

View File

@ -0,0 +1,112 @@
Modbus Controller Number
========================
.. seo::
:description: Instructions for setting up a modbus_controller device sensor.
:image: modbus_controller.png
The ``modbus_controller`` platform creates a Number from a modbus_controller.
When the Number is updated a modbus write command is created sent to the device.
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the sensor.
- coil: coils are also called discrete outout. Coils are 1-bit registers (on/off values) that are used to control discrete outputs. Read and Write access
- discrete_input: discrete input register (read only coil) are similar to coils but can only be read.
- holding: Holding Registers - Holding registers are the most universal 16-bit register. Read and Write access
- read: Read Input Registers - registers are 16-bit registers used for input, and may only be read
- **address**: (**Required**, int): start address of the first register in a range
- **value_type**: (**Required**): datatype of the mod_bus register data. The default data type for modbus is a 16 bit integer in big endian format (MSB first)
- U_WORD (unsigned float from 1 register =16bit
- S_WORD (signed float from one register)
- U_DWORD (unsigned float from 2 registers = 32bit)
- S_DWORD (unsigned float from 2 registers = 32bit)
- U_DWORD_R (unsigend float from 2 registers low word first )
- S_DWORD_R (sigend float from 2 registers low word first )
- U_QWORD (unsigned float from 4 registers = 64bit
- S_QWORD (signed float from 4 registers = 64bit
- U_QWORD_R (unsigend float from 4 registers low word first )
- S_QWORD_R (sigend float from 4 registers low word first )
- **skip_updates**: (*Optional*, integer): By default all sensors of of a modbus_controller are updated together. For data points that don't change very frequently updates can be skipped. A value of 5 would only update this sensor range in every 5th update cycle
Note: The modbus_controller groups component by address ranges to reduce number of transactions. All compoents with the same address will be updated in one request. skip_updates applies for all components in the same range.
- **register_count**: (*Optional*): only required for uncommon response encodings
The number of registers this data point spans. Default is 1
- **force_new_range**: (*Optional*, boolean): If possible sensors with sequential addresses are grouped together and requested in one range. Setting `foce_new_range: true` enforces the start of a new range at that address.
- **offset**: (*Optional*, int): only required for uncommon response encodings
offset from start address in bytes. If more than one register is read a modbus read registers command this value is used to find the start of this datapoint relative to start address. The component calculates the size of the range based on offset and size of the value type
- **min_value** (*Optional*, float): The minimum value this number can be.
- **max_value** (*Optional*, float): The maximum value this number can be.
- **step** (*Optional*, float): The granularity with which the number can be set. Defaults to 1
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`):
Lambda to be evaluated every update interval to get the new value of the sensor.
- **write_lambda** (*Optional*, :ref:`lambda <config-lambda>`): Lambda called before send.
Lambda is evaluated before the modbus write command is created.
- **multiply** (*Optional*, float): multiply the new value with this factor before sending the requests. Ignored if lambda is defined.
All other options from :ref:`Number <config-number>`.
Parameters passed into the lambda
- **x** (float): The parsed float value of the modbus data
- **data** (std::vector<uint8_t): vector containing the complete raw modbus response bytes for this sensor
note: because the response contains data for all registers in the same range you have to use `data[item->offset]` to get the first response byte for your sensor.
- **item** (const pointer to a SensorItem derived object): The sensor object itself.
Possible return values for the lambda:
- ``return <FLOATING_POINT_NUMBER>;`` the new value for the sensor.
- ``return NAN;`` if the state should be considered invalid to indicate an error (advanced).
**Parameters passed into write_lambda**
- **x** (float): The float value to be sent to the modbus device
- **payload** (`std::vector<uint16_t>&payload`): empty vector for the payload. The lamdba can add 16 bit raw modbus register words.
note: because the response contains data for all registers in the same range you have to use `data[item->offset]` to get the first response byte for your sensor.
- **item** (const pointer to a SensorItem derived object): The sensor object itself.
Possible return values for the lambda:
- ``return <FLOATING_POINT_NUMBER>;`` the new value for the sensor.
- ``return <anything>; and fill payload with data`` if the payload is added from the lambda then these 16 bit words will be sent
- ``return {};`` if you don't want write the command to the device (or do it from the lambda).
**Example**
.. code-block:: yaml
number:
- platform: modbus_controller
modbus_controller_id: epever
id: battery_capacity_number
name: "Battery Cap Number"
address: 0x9001
register_type: holding
value_type: U_WORD
lambda: "return x * 1.0; "
write_lambda: |-
ESP_LOGD("main","Modbus Number incoming value = %f",x);
uint16_t b_capacity = x ;
payload.push_back(b_capacity);
return x * 1.0 ;
## multiply is ignored because lamdba is used
multiply: 1.0
See Also
--------
- :doc:`/components/modbus_controller`
- :doc:`/components/sensor/modbus_controller`
- :doc:`/components/binary_sensor/modbus_controller`
- :doc:`/components/switch/modbus_controller`
- :doc:`/components/text_sensor/modbus_controller`
- :doc:`/components/output/modbus_controller`
- https://www.modbustools.com/modbus.html
- :ghedit:`Edit`

View File

@ -5,6 +5,8 @@ OTA Update Component
:description: Instructions for setting up Over-The-Air (OTA) updates for ESPs to upload firmwares remotely.
:image: system-update.png
.. _config-ota:
With the OTA (Over The Air) update component you can upload your
firmware binaries to your node without having to use a USB cable for
uploads. ESPHome natively supports this through its ``run`` and

View File

@ -0,0 +1,82 @@
Modbus Controller Output
========================
.. seo::
:description: Instructions for setting up a modbus_controller device sensor.
:image: modbus_controller.png
The ``modbus_controller`` platform creates a output from a modbus_controller.
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the sensor.
- **address**: (**Required**, int): start address of the first register in a range
- **value_type**: (**Required**): datatype of the mod_bus register data. The default data type for modbus is a 16 bit integer in big endian format (MSB first)
- U_WORD (unsigned float from 1 register =16bit
- S_WORD (signed float from one register)
- U_DWORD (unsigned float from 2 registers = 32bit)
- S_DWORD (unsigned float from 2 registers = 32bit)
- U_DWORD_R (unsigend float from 2 registers low word first )
- S_DWORD_R (sigend float from 2 registers low word first )
- U_QWORD (unsigned float from 4 registers = 64bit
- S_QWORD (signed float from 4 registers = 64bit
- U_QWORD_R (unsigend float from 4 registers low word first )
- S_QWORD_R (sigend float from 4 registers low word first )
- **register_count**: (*Optional*): only required for uncommon response encodings
The number of registers this data point spans. Default is 1
- **write_lambda** (*Optional*, :ref:`lambda <config-lambda>`):
Lambda is evaluated before the modbus write command is created. The value is passed in as `float x` and an empty vector is passed in as `std::vector<uint16_t>&payload`
You can directly define the payload by adding data to payload then the return value is ignored and the content of payload is used.
- **multiply** (*Optional*, float): multiply the new value with this factor before sending the requests. Ignored if lambda is defined.
- **offset**: (*Optional*, int): only required for uncommon response encodings
offset from start address in bytes. If more than one register is read a modbus read registers command this value is used to find the start of this datapoint relative to start address. The component calculates the size of the range based on offset and size of the value type
All other options from :ref:`Output <config-output>`.
**Parameters passed into the lambda**
- **x** (float): The float value to be sent to the modbus device
- **payload** (`std::vector<uint16_t>&payload`): empty vector for the payload. The lamdba can add 16 bit raw modbus register words.
note: because the response contains data for all registers in the same range you have to use `data[item->offset]` to get the first response byte for your sensor.
- **item** (const pointer to a SensorItem derived object): The sensor object itself.
Possible return values for the lambda:
- ``return <FLOATING_POINT_NUMBER>;`` the new value for the sensor.
- ``return <anything>; and fill payload with data`` if the payload is added from the lambda then these 16 bit words will be sent
- ``return {};`` if you don't want write the command to the device (or do it from the lambda).
**Example**
.. code-block:: yaml
output:
- platform: modbus_controller
modbus_controller_id: epever
id: battery_capacity_output
lambda: |-
ESP_LOGD("main","Modbus Output incoming value = %f",x);
uint16_t b_capacity = x ;
payload.push_back(b_capacity);
return x * 1.0 ;
address: 0x9001
value_type: U_WORD
See Also
--------
- :doc:`/components/modbus_controller`
- :doc:`/components/sensor/modbus_controller`
- :doc:`/components/binary_sensor/modbus_controller`
- :doc:`/components/switch/modbus_controller`
- :doc:`/components/text_sensor/modbus_controller`
- :doc:`/components/number/modbus_controller`
- https://www.modbustools.com/modbus.html
- :ghedit:`Edit`

View File

@ -3,9 +3,9 @@ AirThings BLE Sensors
.. seo::
:description: Instructions for setting up AirThings bluetooth-based sensors in ESPHome.
:keywords: AirThings, BLE, Bluetooth, Wave Plus
:keywords: AirThings, BLE, Bluetooth, Wave Plus, Wave Mini
The ``airthings_wave_plus`` sensor platform lets you track the output of AirThings Bluetooth Low Energy devices.
The ``airthings_wave_plus`` and ``airthings_wave_mini`` sensor platforms lets you track the output of AirThings Bluetooth Low Energy devices.
This component will track radon, airborne chemicals, CO2, temperature and humidity and others depending on the device sensors.
@ -76,6 +76,38 @@ Configuration example:
esp32_ble_tracker:
Wave Mini
*********
AirThings Wave Mini tracks airborne chemicals, temperature, pressure and humidity.
.. figure:: images/airthings_wave_mini.jpg
:align: center
:width: 60.0%
Configuration example:
.. code-block:: yaml
sensor:
- platform: airthings_wave_mini
ble_client_id: airthingsmini
update_interval: 5min # default
temperature:
name: "WaveMini Temperature"
pressure:
name: "WaveMini Pressure"
humidity:
name: "WaveMini Humidity"
tvoc:
name: "WaveMini VOC"
ble_client:
- mac_address: 01:02:03:04:05:06
id: airthingsmini
esp32_ble_tracker:
.. note::
The sensor uses active polling of devices every 5 minutes as per the device reported internal refresh timeout.

View File

@ -7,9 +7,9 @@ b-parasite
:keywords: b-parasite, parasite, BLE, Bluetooth, soil moisture
`b-parasite <https://github.com/rbaron/b-parasite>`__ is an open source soil moisture and ambient temperature/humidity sensor.
`b-parasite <https://github.com/rbaron/b-parasite>`__ is an open source soil moisture and ambient temperature/humidity/light sensor.
The ``b_parasite`` sensor platform tracks b-parasite's Bluetooth Low Energy (BLE) advertisement packets. These packets contains soil moisture, air temperature/humidity and battery voltage data.
The ``b_parasite`` sensor platform tracks b-parasite's Bluetooth Low Energy (BLE) advertisement packets. These packets contain soil moisture, air temperature/humidity and battery voltage data. Some b-parasite versions have light sensors, in which case the ambient illuminance is also present in the BLE advertisement data.
.. figure:: images/b_parasite.jpg
:align: center
@ -33,6 +33,8 @@ The ``b_parasite`` sensor platform tracks b-parasite's Bluetooth Low Energy (BLE
name: 'b-parasite Soil Moisture'
battery_voltage:
name: 'b-parasite Battery Voltage'
illuminance:
name: 'b-parasite Illuminance'
Configuration variables
-----------------------
@ -54,6 +56,10 @@ Configuration variables
- **name** (**Required**): Sensor name.
- All other options from :ref:`Sensor <config-sensor>`.
- **illuminance** (*Optional*): Illuminance in lux.
- **name** (**Required**): Sensor name.
- All other options from :ref:`Sensor <config-sensor>`.
See Also
--------

View File

@ -0,0 +1,227 @@
Daly BMS
========
.. seo::
:description: Instructions for setting up a Daly Smart BMS
:image: daly_bms.png
The ``daly_bms`` sensor platform allows you to use a Daly Smart BMS
(`more info <https://dalyelec.en.made-in-china.com/>`__)
with ESPHome.
The BMS communicates via :ref:`UART <uart>`.
.. figure:: images/daly_bms_example.png
:align: center
:width: 100.0%
.. code-block:: yaml
# Example configuration entry (ESP8266)
uart:
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
daly_bms:
update_interval: 20s
sensor:
- platform: daly_bms
voltage:
name: "Battery Voltage"
current:
name: "Battery Current"
battery_level:
name: "Battery Level"
max_cell_voltage:
name: "Max Cell Voltage"
max_cell_voltage_number:
name: "Max Cell Voltage Number"
min_cell_voltage:
name: "Min Cell Voltage"
min_cell_voltage_number:
name: "Min Cell Voltage Number"
max_temperature:
name: "Max Temperature"
max_temperature_probe_number:
name: "Max Temperature Probe Number"
min_temperature:
name: "Min Temperature"
min_temperature_probe_number:
name: "Min Temperature Probe Number"
remaining_capacity:
name: "Remaining Capacity"
cells_number:
name: "Cells Number"
temperature_1:
name: "Temperature 1"
temperature_2:
name: "Temperature 2"
text_sensor:
- platform: daly_bms
status:
name: "BMS Status"
binary_sensor:
- platform: daly_bms
charging_mos_enabled:
name: "Charging MOS"
discharging_mos_enabled:
name: "Discharging MOS"
Component/Hub
-------------
- **update_interval** (*Optional*, :ref:`config-time`): Delay between data requests.
Configuration variables:
************************
Sensor:
-------
A sensor platform to read BMS data
Configuration variables:
************************
- **voltage** (*Optional*): Voltage of the battery pack connected to Daly BMS.
- **name** (**Required**, string): The name for the voltage sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **current** (*Optional*): Current flowing trough the BMS (input or output from batttery).
- **name** (**Required**, string): The name for the current sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **battery_level** (*Optional*): Battery level in % (SoC).
- **name** (**Required**, string): The name for the SoC sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **max_cell_voltage** (*Optional*): The cell of the battery with the higher voltage.
- **name** (**Required**, string): The name for the Max Cell Voltage sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **max_cell_voltage_number** (*Optional*): The cell number of the battery with the higher voltage.
- **name** (**Required**, string): The name for the Max Cell Voltage Number sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **min_cell_voltage** (*Optional*): The cell of the battery with the lower voltage.
- **name** (**Required**, string): The name for the Min Cell Voltage sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **min_cell_voltage_number** (*Optional*): The cell number of the battery with the lower voltage.
- **name** (**Required**, string): The name for the Min Cell Voltage Number sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **max_temperature** (*Optional*): The higher temperature measured from the temperature sensors.
- **name** (**Required**, string): The name for the Max Temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **max_temperature_probe_number** (*Optional*): The sensor number which has measured the higher temperature.
- **name** (**Required**, string): The name for the Max Temperature Probe Number sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **min_temperature** (*Optional*): The lower temperature measured from the temperature sensors.
- **name** (**Required**, string): The name for the Min Temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **min_temperature_probe_number** (*Optional*): The sensor number which has measured the lower temperature.
- **name** (**Required**, string): The name for the Min Temperature Probe Number sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **remaining_capacity** (*Optional*): The capacity in Ah left in the battery.
- **name** (**Required**, string): The name for the Remaining Capacity sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **cells_number** (*Optional*): The number of cells in series in the battery pack.
- **name** (**Required**, string): The name for the Cells Number sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **temperature_1** (*Optional*): The first temperature sensor.
- **name** (**Required**, string): The name for the first temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **temperature_2** (*Optional*): The second temperature sensor.
- **name** (**Required**, string): The name for the second temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
Text Sensor:
------------
Text sensor that indicates the status of BMS.
Configuration variables:
************************
- **status** (*Optional*): The BMS Status (Charging, Discharging, Stationary).
- **name** (**Required**, string): The name for the BMS status text sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Text Sensor <config-text_sensor>`.
Binary Sensor:
--------------
Binary sensor that indicates the status of MOS.
Configuration variables:
************************
- **charging_mos_enabled** (*Optional*): The BMS charging MOS status to enable the recharge of the battery.
- **name** (**Required**, string): The name for the charging MOS binary sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`.
- **discharging_mos_enabled** (*Optional*): The BMS discharging mos status to enable the load.
- **name** (**Required**, string): The name for the discharging MOS binary sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Binary Sensor <config-binary_sensor>`.
UART Connection:
----------------
Connect RX from BMS to TX in ESP board and TX from BMS to RX in ESP board
.. figure:: images/daly_bms_pinout.png
:align: center
:width: 100.0%
Uart Pinout.
See Also
--------
- :ref:`sensor-filters`
- :apiref:`daly_bms/daly_bms.h`
- :ghedit:`Edit`

View File

@ -43,6 +43,9 @@ Configuration variables:
- **decryption_key** (*Optional*, string, :ref:`templatable <config-templatable>`, 32 characters, case insensitive): The key to decrypt the
telegrams. Used in Lux only.
- **gas_mbus_id** (*Optional*, integer): The id of the gas meter. Defaults to ``1``.
- **crc_check** (*Optional*, boolean): Specifies if the CRC check must be done. This is required to be set to false for
older DSMR versions as they do not provide a CRC. Defaults to ``true``.
- **uart_id** (*Optional*, :ref:`config-id`): Manually specify the ID of the UART hub.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID of the DSMR if you have multiple components.
@ -221,6 +224,13 @@ Configuration variables:
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Text Sensor <config-text_sensor>`.
- **gas_delivered_text** (*Optional*): A text sensor which unformatted gas data. You need to
apply a custom parsing of this value depending on your meter format.
- **name** (**Required**, string): The name for the p1_version text sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Text Sensor <config-text_sensor>`.
Belgium
- **p1_version_be** (*Optional*): DSMR Version Belgium
@ -229,6 +239,40 @@ Belgium
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Text Sensor <config-text_sensor>`.
Older DSMR meters support
*************************
Version 2.2 is supported with the following configuration:
.. code-block:: yaml
# Custom uart settings for DSMR v2.2
uart:
baud_rate: 9600
data_bits: 7
parity: NONE
stop_bits: 1
dsmr:
crc_check: false
sensor:
- platform: dsmr
energy_delivered_tariff1:
name: dsmr_energy_delivered_tariff1
energy_delivered_lux:
name: dsmr_energy_delivered_tarifflux
text_sensor:
- platform: dsmr
identification:
name: "dsmr_identification"
p1_version:
name: "dsmr_p1_version"
gas_delivered_text:
name: "gas delivered raw"
See Also
--------

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

View File

@ -48,8 +48,7 @@ Configuration variables:
- **state_class** (*Optional*, string): The state class for the
sensor. See https://developers.home-assistant.io/docs/core/entity/sensor/#available-state-classes
for a list of available options. Set to ``""`` to remove the default state class of a sensor.
- **icon** (*Optional*, icon): Manually set the icon to use for the sensor in the frontend. The icon set here
is ignored by Home Assistant, if a device class is already set.
- **icon** (*Optional*, icon): Manually set the icon to use for the sensor in the frontend.
- **accuracy_decimals** (*Optional*, int): Manually set the accuracy of decimals to use when reporting values.
- **filters** (*Optional*): Specify filters to use for some basic
transforming of values. See :ref:`Sensor Filters <sensor-filters>` for more information.
@ -133,6 +132,7 @@ Filters are processed in the order they are defined in your configuration.
alpha: 0.1
send_every: 15
- throttle: 1s
- throttle_average: 1s
- heartbeat: 5s
- debounce: 0.1s
- delta: 5.0
@ -370,6 +370,17 @@ If it is not older than the configured value, the value is not passed forward.
- delta: 5.0
- lambda: return x * (9.0/5.0) + 32.0;
``throttle_average``
********************
An average over the ``specified time period``, potentially throttling incoming values. When this filter gets incoming values, it sums up all values and pushes out the average after the ``specified time period`` passed. There are two edge cases to consider within the ``specified time period``:
* no value(s) received: ``NaN`` is returned - add the ``heartbeat`` filter if periodical pushes are required and/or ``filter_out: nan`` if required
* one value received: the value is pushed out after the ``specified time period`` passed, without calculating an average
For example a ``throttle_average: 60s`` will push out a value every 60 seconds, in case at least one sensor value is received within these 60 seconds.
In comparison to the ``throttle`` filter it won't discard any values. In comparison to the ``sliding_window_moving_average`` filter it supports variable sensor reporting rates without influencing the filter reporting interval (except for the first edge case).
``heartbeat``
*************

View File

@ -0,0 +1,117 @@
LTR390 UV and Ambient Light Sensor
==================================================
.. seo::
:description: Instructions for setting up LTR390 UV and light sensor
:image: images/ltr390-full.jpg
The ``ltr390`` sensor platform allows you to use your LTR390 UV and ambient
light sensor
(`datasheet <https://optoelectronics.liteon.com/upload/download/DS86-2015-0004/LTR-390UV_Final_%20DS_V1%201.pdf>`__, `Adafruit`_) with ESPHome.
The :ref:`I²C Bus <i2c>` is required to be set up in your configuration for this sensor to work.
.. figure:: images/ltr390-full.jpg
:align: center
:width: 80.0%
.. _Adafruit: https://www.adafruit.com/product/4831
.. code-block:: yaml
sensor:
- platform: ltr390
uvi:
name: "UV Index"
light:
name: "Light"
Configuration variables:
------------------------
- **uv_index** (**Optional**): UV index (UVI). All options from :ref:`Sensor <config-sensor>`.
- **uv** (**Optional**): Sensor counts for the UV sensor (#). All options from :ref:`Sensor <config-sensor>`.
- **light** (**Optional**): Lux of ambient light (lx). All options from :ref:`Sensor <config-sensor>`.
- **ambient_light** (**Optional**): Sensor counts for the Ambient light sensor (#). All options from :ref:`Sensor <config-sensor>`.
- **gain** (**Optional**, string): Adjusts the sensitivity of the sensor. A larger value means higher sensitivity. See table below for details. Default is ``"X3"``.
- **resolution** (**Optional**, int): ADC resolution. Higher resolutions require longer sensor integration times. See table below for details. Default is ``18``.
- **window_correction_factor** (**Optional**, float): Window correction factor. Use larger values when using under tinted windows. Default is ``1.0``, must be ``>= 1.0``.
- **address** (**Optional**, int): Manually specify the I²C address of the sensor. Default is `0x53`.
- **update_interval** (**Optional**, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``. It is recommended that the update interval is at least 1 second since updates can take up to 800ms when using a high resolution value.
Lux and UVI Formulas
--------------------
.. math::
\text{lux} = \frac{0.6 \times \text{als}}{\text{gain} \times \text{int}} \times \text{wfac}
.. math::
\text{UVI} = \frac{\text{uv}}{\text{sensitivity}} \times \text{wfac}
where:
- ``als`` and ``uv`` are the sensor values
- ``gain`` is the amount of gain, see the table below for details
- ``int`` is the integration time in 100s of ms and is tied to the resolution, see the table below for details
- ``sensitivity`` has the value ``2300`` and is the sensor's count per UVI
- ``wfac`` is the window correction factor
Gain
----
.. list-table::
:widths: 25 25
:header-rows: 1
* - Gain Parameter
- gain
* - X1
- 1
* - X3
- 3
* - X6
- 6
* - X9
- 9
* - X18
- 18
Resolution
----------
.. list-table:: Resolution
:widths: 25 25 10
:header-rows: 1
* - Resolution Parameter (bits)
- Integration Time (ms)
- int
* - 16
- 25
- 0.25
* - 17
- 50
- 0.5
* - 18
- 100
- 1
* - 19
- 200
- 2
* - 20
- 400
- 4
See Also
--------
- :doc:`/components/sensor/bh1750`
- :doc:`/components/sensor/tsl2561`
- :doc:`/cookbook/temt6000`
- :ref:`sensor-filters`
- :apiref:`ltr390/ltr390.h`
- :ghedit:`Edit`

View File

@ -0,0 +1,138 @@
Modbus Sensor
=============
.. seo::
:description: Instructions for setting up a modbus_controller device sensor.
:image: modbus.png
The ``modbus_controller`` sensor platform creates a sensor from a modbus_controller component
and requires :doc:`/components/modbus_controller` to be configured.
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the sensor.
- **register_type** (**Required**): type of the modbus register.
- coil: coils are also called discrete outout. Coils are 1-bit registers (on/off values) that are used to control discrete outputs. Read and Write access
- discrete_input: discrete input register (read only coil) are similar to coils but can only be read.
- holding: Holding Registers - Holding registers are the most universal 16-bit register. Read and Write access
- read: Read Input Registers - registers are 16-bit registers used for input, and may only be read
- **address**: (**Required**, int): start address of the first register in a range
- **value_type**: (**Required**): datatype of the mod_bus register data. The default data type for modbus is a 16 bit integer in big endian format (MSB first)
- U_WORD (unsigned float from 1 register =16bit
- S_WORD (signed float from one register)
- U_DWORD (unsigned float from 2 registers = 32bit)
- S_DWORD (unsigned float from 2 registers = 32bit)
- U_DWORD_R (unsigend float from 2 registers low word first )
- S_DWORD_R (sigend float from 2 registers low word first )
- U_QWORD (unsigned float from 4 registers = 64bit
- S_QWORD (signed float from 4 registers = 64bit
- U_QWORD_R (unsigend float from 4 registers low word first )
- S_QWORD_R (sigend float from 4 registers low word first )
- **bitmask**: (*Optional*) some values are packed in a response. The bitmask can be used to extract a value from the response. For example, if the high byte value register 0x9013 contains the minute value of the current time. To only exctract this value use bitmask: 0xFF00. The result will be automatically right shifted by the number of 0 before the first 1 in the bitmask. For 0xFF00 (0b1111111100000000) the result is shifted 8 posistions. More than one sensor can use the same address/offset if the bitmask is different.
- **skip_updates**: (*Optional*, integer): By default all sensors of of a modbus_controller are updated together. For data points that don't change very frequently updates can be skipped. A value of 5 would only update this sensor range in every 5th update cycle
Note: The modbus_controller groups component by address ranges to reduce number of transactions. All compoents with the same address will be updated in one request. skip_updates applies for all components in the same range.
- **register_count**: (*Optional*): only required for uncommon response encodings
The number of registers this data point spans. Default is 1
- **force_new_range**: (*Optional*, boolean): If possible sensors with sequential addresses are grouped together and requested in one range. Setting `foce_new_range: true` enforces the start of a new range at that address.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`):
Lambda to be evaluated every update interval to get the new value of the sensor.
- **offset**: (*Optional*, int): only required for uncommon response encodings
offset from start address in bytes. If more than one register is read a modbus read registers command this value is used to find the start of this datapoint relative to start address. The component calculates the size of the range based on offset and size of the value type
For coil or discrete input registers offset is the position of the coil/register because these registers encode 8 coils in one byte.
- All other options from :ref:`Sensor <config-sensor>`.
This example will send 2 modbus commands (device address 1 assumed)
0x1 0x4 0x31 0x0 0x0 0x02 x7f 0x37 ( read 2 registers starting at 0x3100)
0x1 0x3 0x90 0x1 0x0 0x1 0xf8 0xca ( read 1 holding resister from 0x9001 )
.. code-block:: yaml
- platform: modbus_controller
modbus_controller_id: traceran
id: pv_input_voltage
name: "PV array input voltage"
address: 0x3100
unit_of_measurement: "V" ## for any other unit the value is returned in minutes
register_type: read
value_type: U_WORD
accuracy_decimals: 1
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: traceran
id: pv_input_current
name: "PV array input current"
address: 0x3101
unit_of_measurement: "A" ## for any other unit the value is returned in minutes
register_type: read
value_type: U_WORD
accuracy_decimals: 2
filters:
- multiply: 0.01
- platform: modbus_controller
modbus_controller_id: traceran
name: "Battery Capacity"
id: battery_capacity
register_type: holding
address: 0x9001
unit_of_measurement: "AH"
value_type: U_WORD
The ``modbus`` sensor platform allows you use a lambda that gets called before data is published
using :ref:`lambdas <config-lambda>`.
This example logs the value as parsed and the raw modbus bytes received for this register range
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: modbus_controller
modbus_controller_id: epever
id: battery_capacity
address: 0x9001
name: "Battery Capacity"
register_type: holding
value_type: U_WORD
lambda: |-
ESP_LOGI("","Lambda incoming value=%f - data array size is %d",x,data.size());
ESP_LOGI("","Sensor properties: adress = 0x%X, offset = 0x%X value type=%d",item->start_address,item->offset,item->sensor_value_type);
int i=0 ;
for (auto val : data) {
ESP_LOGI("","data[%d]=0x%02X (%d)",i++ ,data[i],data[i]);
}
return x ;
Parameters passed into the lambda
- **x** (float): The parsed float value of the modbus data
- **data** (std::vector<uint8_t): vector containing the complete raw modbus response bytes for this sensor
note: because the response contains data for all registers in the same range you have to use `data[item->offset]` to get the first response byte for your sensor.
- **item** (const pointer to a SensorItem derived object): The sensor object itself.
Possible return values for the lambda:
- ``return <FLOATING_POINT_NUMBER>;`` the new value for the sensor.
- ``return NAN;`` if the state should be considered invalid to indicate an error (advanced).
See Also
--------
- :doc:`/components/modbus_controller`
- :doc:`/components/number/modbus_controller`
- :doc:`/components/binary_sensor/modbus_controller`
- :doc:`/components/text_sensor/modbus_controller`
- :doc:`/components/switch/modbus_controller`
- :doc:`EPEVER MPPT Solar Charge Controller Tracer-AN Series</cookbook/tracer-an>`
- :ghedit:`Edit`

View File

@ -0,0 +1,82 @@
SCD4X CO₂, Temperature and Relative Humidity Sensor
===================================================
.. seo::
:description: Instructions for setting up SCD4X CO₂ Temperature and Relative Humidity Sensor
:image: scd4x.jpg
The ``scd4x`` sensor platform allows you to use your Sensirion SCD4X CO₂
(`datasheet <https://www.sensirion.com/fileadmin/user_upload/customers/sensirion/Dokumente/9.5_CO2/Sensirion_CO2_Sensors_SCD4x_Datasheet.pdf>`__) sensors with ESPHome.
The :ref:`I²C Bus <i2c>` is required to be set up in your configuration for this sensor to work.
.. figure:: images/scd4x.jpg
:align: center
:width: 80.0%
.. code-block:: yaml
# Example configuration entry
sensor:
- platform: scd4x
co2:
name: "Workshop CO2"
temperature:
name: "Workshop Temperature"
humidity:
name: "Workshop Humidity"
Configuration variables:
------------------------
- **co2** (*Optional*): The information for the CO₂ sensor.
- **name** (**Required**, string): The name for the CO₂eq sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **temperature** (*Optional*): The information for the Temperature sensor.
- **name** (**Required**, string): The name for the temperature sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **humidity** (*Optional*): The information for the Humidity sensor.
- **name** (**Required**, string): The name for the humidity sensor.
- **id** (*Optional*, :ref:`config-id`): Set the ID of this sensor for use in lambdas.
- All other options from :ref:`Sensor <config-sensor>`.
- **temperature_offset** (*Optional*, float): The temperature offset can depend
on various factors such as the SCD4x measurement mode, self-heating of close
components, the ambient temperature and air flow. This variable allows the
compensation of those effects by setting a temperature offset. Defaults to
``4°C``.
- **automatic_self_calibration** (*Optional*, bool): Whether to enable
automatic self calibration (ASC). Defaults to ``true``.
- **ambient_pressure_compensation** (*Optional*, int): Enable compensation
of measured CO₂ values based on given ambient pressure in mBar.
- **altitude_compensation** (*Optional*, int): Enable compensating
deviations due to current altitude (in metres). Notice: setting
*altitude_compensation* is ignored if *ambient_pressure_compensation*
is set.
- **address** (*Optional*, int): Manually specify the I²C address of the sensor.
Defaults to ``0x62``.
- **update_interval** (*Optional*, :ref:`config-time`): The interval to check the
sensor. Defaults to ``60s``.
See Also
--------
- :ref:`sensor-filters`
- :doc:`scd30`
- :apiref:`scd4x/scd4x.h`
- :ghedit:`Edit`

View File

@ -4,7 +4,7 @@ Xiaomi Miscale Sensors
.. seo::
:description: Instructions for setting up Xiaomi Miscale bluetooth-based sensors in ESPHome.
:image: xiaomi_miscale.jpg
:keywords: Xiaomi, BLE, Bluetooth, XMTZC01HM, XMTZC04HM
:keywords: Xiaomi, Miscale, BLE, Bluetooth, XMTZC01HM, XMTZC04HM, XMTZC02HM, XMTZC05HM
The ``xiaomi_miscale`` sensor platform lets you track the output of Xiaomi Bluetooth Low Energy devices using the :doc:`/components/esp32_ble_tracker`. This component will track, for example, the weight of the device every time the sensor sends out a BLE broadcast. Contrary to other implementations, ``xiaomi_miscale`` listens passively to advertisement packets and does not pair with the device. Hence ESPHome has no impact on battery life.
@ -13,26 +13,42 @@ To get the body scores using your weight, height, age and gender see the custom_
Supported Devices
-----------------
XMTZC01HM, XMTZC04HM
********************
XMTZC01HM, XMTZC04HM, XMTZC02HM, XMTZC05HM
******************************************
Miscale measures weight.
Miscale (left) measures weight only. Miscale2 (right) measures weight and impedance.
.. figure:: images/xiaomi_miscale.jpg
:align: center
:width: 60.0%
Configuration example:
.. code-block:: yaml
sensor:
- platform: xiaomi_miscale
mac_address: 'C8:47:8C:9F:7B:0A'
mac_address: '5C:CA:D3:70:D4:A2'
weight:
name: "Xiaomi Mi Scale Weight"
impedance:
name: "Xiaomi Mi Scale Impedance"
Configuration example with multiple users :
Configuration variables:
------------------------
- **mac_address** (**Required**, MAC Address): The MAC address of the scale.
- **weight** (*Optional*): The information for the weight sensor.
- **name** (**Required**, string): The name for the weight sensor.
- All other options from :ref:`Sensor <config-sensor>`.
- **impedance** (*Optional*): The information for the impedance sensor. **Only available on MiScale2**
- **name** (**Required**, string): The name for the impedance sensor.
- All other options from :ref:`Sensor <config-sensor>`.
Configuration example with multiple users:
******************************************
You have to replace the numbers in the lambdas to determine your weight which is between X weight and X weight.
@ -40,23 +56,28 @@ You have to replace the numbers in the lambdas to determine your weight which is
sensor:
- platform: xiaomi_miscale
mac_address: 'C8:47:8C:9F:7B:0A'
mac_address: '5C:CA:D3:70:D4:A2'
weight:
name: "Xiaomi Mi Scale Weight"
id: weight_miscale
on_value:
then:
- lambda: |-
if (id(weight_miscale).state >= 69 && id(weight_miscale).state <= 74.49) {
if (id(weight_miscale).state >= 69 && id(weight_miscale).state <= 74.49) {
return id(weight_user1).publish_state(x);}
else if (id(weight_miscale).state >= 74.50 && id(weight_miscale).state <= 83) {
return id(weight_user2).publish_state(x);}
else if (id(weight_miscale).state >= 46 && id(weight_miscale).state <= 65) {
return id(weight_user3).publish_state(x);}
else if (id(weight_miscale).state >= 28 && id(weight_miscale).state <= 45) {
return id(weight_user4).publish_state(x);}
else if (id(weight_miscale).state >= 5 && id(weight_miscale).state <= 20) {
return id(weight_user5).publish_state(x);}
impedance:
name: "Xiaomi Mi Scale Impedance"
id: impedance_xiaomi
on_value:
then:
- lambda: |-
if (id(weight_miscale).state >= 69 && id(weight_miscale).state <= 74.49) {
return id(impedance_user1).publish_state(x);}
else if (id(weight_miscale).state >= 74.50 && id(weight_miscale).state <= 83) {
return id(impedance_user2).publish_state(x);}
- platform: template
name: Weight Aurélien
@ -64,6 +85,12 @@ You have to replace the numbers in the lambdas to determine your weight which is
unit_of_measurement: 'kg'
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Impedance Aurélien
id: impedance_user1
unit_of_measurement: 'ohm'
icon: mdi:omega
accuracy_decimals: 0
- platform: template
name: Weight Siham
id: weight_user2
@ -71,23 +98,11 @@ You have to replace the numbers in the lambdas to determine your weight which is
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Weight Théo
id: weight_user3
unit_of_measurement: 'kg'
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Weight Sacha
id: weight_user4
unit_of_measurement: 'kg'
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Weight Noham
id: weight_user5
unit_of_measurement: 'kg'
icon: mdi:weight-kilogram
accuracy_decimals: 2
name: Impedance Siham
id: impedance_user2
unit_of_measurement: 'ohm'
icon: mdi:omega
accuracy_decimals: 0
See Also

View File

@ -1,150 +1,4 @@
Xiaomi Miscale2 Sensors
========================
Xiaomi Miscale2 combined into Xiaomi Miscale
============================================
.. seo::
:description: Instructions for setting up Xiaomi Miscale2 bluetooth-based sensors in ESPHome.
:image: xiaomi_miscale2.jpg
:keywords: Xiaomi, BLE, Bluetooth, XMTZC02HM, XMTZC05HM
The ``xiaomi_miscale2`` sensor platform lets you track the output of Xiaomi Bluetooth Low Energy devices using the :doc:`/components/esp32_ble_tracker`. This component will track, for example, the weight and the impedance of the device every time the sensor sends out a BLE broadcast. Contrary to other implementations, ``xiaomi_miscale2`` listens passively to advertisement packets and does not pair with the device. Hence ESPHome has no impact on battery life.
To get the body scores using your weight, height, age and gender see the custom_components `<https://github.com/dckiller51/bodymiscale>`__
Supported Devices
-----------------
XMTZC02HM, XMTZC05HM
********************
Miscale2 measures weight and impedance.
.. figure:: images/xiaomi_miscale2.jpg
:align: center
:width: 60.0%
Configuration example:
.. code-block:: yaml
sensor:
- platform: xiaomi_miscale2
mac_address: '5C:CA:D3:70:D4:A2'
weight:
name: "Xiaomi Mi Scale Weight"
impedance:
name: "Xiaomi Mi Scale Impedance"
Configuration example with multiple users :
You have to replace the numbers in the lambdas to determine your weight which is between X weight and X weight.
.. code-block:: yaml
sensor:
- platform: xiaomi_miscale2
mac_address: '5C:CA:D3:70:D4:A2'
weight:
name: "Xiaomi Mi Scale Weight"
id: weight_miscale
on_value:
then:
- lambda: |-
if (id(weight_miscale).state >= 69 && id(weight_miscale).state <= 74.49) {
return id(weight_user1).publish_state(x);}
else if (id(weight_miscale).state >= 74.50 && id(weight_miscale).state <= 83) {
return id(weight_user2).publish_state(x);}
else if (id(weight_miscale).state >= 46 && id(weight_miscale).state <= 65) {
return id(weight_user3).publish_state(x);}
else if (id(weight_miscale).state >= 28 && id(weight_miscale).state <= 45) {
return id(weight_user4).publish_state(x);}
else if (id(weight_miscale).state >= 5 && id(weight_miscale).state <= 20) {
return id(weight_user5).publish_state(x);}
impedance:
name: "Xiaomi Mi Scale Impedance"
id: impedance_xiaomi
on_value:
then:
- lambda: |-
if (id(weight_miscale).state >= 69 && id(weight_miscale).state <= 74.49) {
return id(impedance_user1).publish_state(x);}
else if (id(weight_miscale).state >= 74.50 && id(weight_miscale).state <= 83) {
return id(impedance_user2).publish_state(x);}
else if (id(weight_miscale).state >= 46 && id(weight_miscale).state <= 65) {
return id(impedance_user3).publish_state(x);}
else if (id(weight_miscale).state >= 28 && id(weight_miscale).state <= 45) {
return id(impedance_user4).publish_state(x);}
else if (id(weight_miscale).state >= 5 && id(weight_miscale).state <= 20) {
return id(impedance_user5).publish_state(x);}
- platform: template
name: Weight Aurélien
id: weight_user1
unit_of_measurement: 'kg'
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Impedance Aurélien
id: impedance_user1
unit_of_measurement: 'ohm'
icon: mdi:omega
accuracy_decimals: 0
- platform: template
name: Weight Siham
id: weight_user2
unit_of_measurement: 'kg'
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Impedance Siham
id: impedance_user2
unit_of_measurement: 'ohm'
icon: mdi:omega
accuracy_decimals: 0
- platform: template
name: Weight Théo
id: weight_user3
unit_of_measurement: 'kg'
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Impedance Théo
id: impedance_user3
unit_of_measurement: 'ohm'
icon: mdi:omega
accuracy_decimals: 0
- platform: template
name: Weight Sacha
id: weight_user4
unit_of_measurement: 'kg'
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Impedance Sacha
id: impedance_user4
unit_of_measurement: 'ohm'
icon: mdi:omega
accuracy_decimals: 0
- platform: template
name: Weight Noham
id: weight_user5
unit_of_measurement: 'kg'
icon: mdi:weight-kilogram
accuracy_decimals: 2
- platform: template
name: Impedance Noham
id: impedance_user5
unit_of_measurement: 'ohm'
icon: mdi:omega
accuracy_decimals: 0
See Also
--------
- :doc:`/components/esp32_ble_tracker`
- :doc:`/components/sensor/index`
- bodymiscale score integration for Home Assistant (bodymiscale custom component) `<https://github.com/dckiller51/bodymiscale>`__
- bodymiscale Lovelace Card `<https://github.com/dckiller51/lovelace-body-miscale-card>`__
- :ghedit:`Edit`
:doc:`/components/sensor/xiaomi_miscale`

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1,54 @@
Modbus Switch
=============
.. seo::
:description: Instructions for setting up a modbus_controller device sensor.
:image: modbus_controller.png
The ``modbus_controller`` sensor platform creates a sensor from a modbus_controller component
and requires :doc:`/components/modbus_controller` to be configured.
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the sensor.
- **modbus_functioncode** (**Required**): type of the modbus register.
- **address**: (**Required**, integer): start address of the first register in a range
- **offset**: (*Optional*, integer): not required in most cases
offset from start address in bytes. If more than one register is read a modbus read registers command this value is used to find the start of this datapoint relative to start address. The component calculates the size of the range based on offset and size of the value type
The value for offset depends on the register type. For holding input registers the offset is in bytes. For coil and discrete input resisters the LSB of the first data byte contains the coil addressed in the request. The other coils follow toward the high-order end of this byte and from low order to high order in subsequent bytes. For the registers offset is the position of the relevant bit.
To get the value of the coil register 2 can be retrived using address: 2 / offset: 0 or address: 0 / offset 2
- **bitmask** : some values are packed in a response. The bitmask is used to determined if the result is true or false
- **skip_updates**: (*Optional*, integer): By default all sensors of of a modbus_controller are updated together. For data points that don't change very frequently updates can be skipped. A value of 5 would only update this sensor range in every 5th update cycle
**Example**
.. code-block:: yaml
switch:
- platform: modbus_controller
modbus_controller_id: epever
id: enable_load_test
register_type: coil
address: 2
name: "enable load test mode"
bitmask: 1
Since offset is not zero the read command is part of a range and will be parsed when the range is updated.
The write command to be constructed uses the function code to determine the write command. For a coil it is write single coil.
Because the write command only touches one register start_address and offset have to be corrected.
The final command will be write_single_coil address 5 (start_address+offset) value 1 or 0
For holding registers the write command will be write_single_register. Because the offset for holding registers is given in bytes and the size of a register is 16 bytes the start_address is calculated as start_address + offset/2
See Also
--------
- :doc:`/components/modbus_controller`
- :doc:`/components/sensor/modbus_controller`
- :doc:`/components/binary_sensor/modbus_controller`
- :doc:`/components/text_sensor/modbus_controller`
- https://www.modbustools.com/modbus.html
- :ghedit:`Edit`

View File

@ -30,6 +30,7 @@ See Also
--------
- :doc:`shutdown`
- :doc:`safe_mode`
- :doc:`template`
- :apiref:`restart/restart_switch.h`
- :ghedit:`Edit`

View File

@ -0,0 +1,38 @@
Safe Mode Switch
================
.. seo::
:description: Instructions for setting up switches that can remotely reboot the ESP in ESPHome into safe mode.
:image: restart.png
The ``safe_mode`` switch allows you to remotely reboot your node into :ref:`Safe Mode <config-ota>`. This is useful in certain situations
where a misbehaving component is preventing Over-The-Air updates from completing successfully.
This component requires :ref:`OTA <config-ota>` to be configured.
.. figure:: images/safemode-ui.png
:align: center
:width: 80.0%
.. code-block:: yaml
# Example configuration entry
switch:
- platform: safe_mode
name: "Living Room Restart (Safe Mode)"
Configuration variables:
------------------------
- **name** (**Required**, string): The name for the switch.
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- All other options from :ref:`Switch <config-switch>`.
See Also
--------
- :doc:`shutdown`
- :doc:`restart`
- :doc:`template`
- :apiref:`safe_mode/safe_mode_switch.h`
- :ghedit:`Edit`

View File

@ -38,6 +38,121 @@ Automations:
- **on_value** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when a new value is published. See :ref:`text_sensor-on_value`.
- **on_raw_value** (*Optional*, :ref:`Automation <automation>`): An automation to perform
when a new value is received that hasn't passed through any filters. See :ref:`text_sensor-on_raw_value`.
.. _text_sensor-filters:
Text Sensor Filters
-------------------
ESPHome allows you to do some basic pre-processing of
text_sensor values before theyre sent to Home Assistant. This is for example
useful if you want to manipulate the text_sensor string in some fashion.
There are a lot of filters that sensors support. You define them by adding a ``filters``
block in the text_sensor configuration (at the same level as ``platform``; or inside each text_sensor block
for platforms with multiple sensors).
Filters are processed in the order they are defined in your configuration.
.. code-block:: yaml
# Example filters:
filters:
- to_upper:
- to_lower:
- append: "_prefix"
- prepend: "suffix_"
- substitute:
- "suf -> foo"
- "pre -> bar"
- lambda: return {"Hello World"};
``to_upper``
************
Converts all characters within a string to uppercase (only the English alphabet is supported at this time).
.. code-block:: yaml
# Example configuration entry
- platform: template
# ...
filters:
- to_upper:
``to_lower``
************
Converts all characters within a string to lowercase (only the English alphabet is supported at this time).
.. code-block:: yaml
# Example configuration entry
- platform: template
# ...
filters:
- to_lower:
``append``
**********
Adds a string to the end of the current string.
.. code-block:: yaml
# Example configuration entry
- platform: template
# ...
filters:
- append: "_prefix"
``prepend``
***********
Adds a string to the start of the current string.
.. code-block:: yaml
# Example configuration entry
- platform: template
# ...
filters:
- prepend: "suffix_"
``substitute``
**************
Search the current value of the text sensor for a string, and replace it with another string.
.. code-block:: yaml
# Example configuration entry
- platform: template
# ...
filters:
- substitute:
- "suf -> foo"
- "pre -> bar"
The arguments are a list of substitutions, each in the form ``TO_FIND -> REPLACEMENT``.
``lambda``
**********
Perform a advanced operations on the text sensor value. The input string is ``x`` and
the result of the lambda is used as the output (use ``return``).
.. code-block:: yaml
filters:
- lambda: |-
if (x == "Hello") {
return x + "bar";
} else {
return x + "foo";
}
Text Sensor Automation
----------------------
@ -65,6 +180,26 @@ In :ref:`Lambdas <config-lambda>` you can get the value from the trigger with ``
Configuration variables: See :ref:`Automation <automation>`.
.. _text_sensor-on_raw_value:
``on_raw_value``
****************
This automation will be triggered when a new value is received that hasn't passed
through any filters. In :ref:`Lambdas <config-lambda>` you can get the value from the trigger with ``x``.
.. code-block:: yaml
text_sensor:
- platform: version
# ...
on_raw_value:
then:
- lambda: |-
ESP_LOGD("main", "The current version is %s", x.c_str());
Configuration variables: See :ref:`Automation <automation>`.
.. _text_sensor-state_condition:
``text_sensor.state`` Condition

View File

@ -0,0 +1,115 @@
Modbus Text Sensor
==================
.. seo::
:description: Instructions for setting up a modbus_controller modbus text sensor.
:image: modbus_controller.png
The ``modbus_controller`` sensor platform creates a text sensor from a modbus_controller component
and requires :doc:`/components/modbus_controller` to be configured.
Configuration variables:
------------------------
- **id** (*Optional*, :ref:`config-id`): Manually specify the ID used for code generation.
- **name** (**Required**, string): The name of the sensor.
- **register_type** (**Required**): type of the modbus register.
- coil: coils are also called discrete outout. Coils are 1-bit registers (on/off values) that are used to control discrete outputs. Read and Write access
- discrete_input: discrete input register (read only coil) are similar to coils but can only be read.
- holding: Holding Registers - Holding registers are the most universal 16-bit register. Read and Write access
- read: Read Input Registers - registers are 16-bit registers used for input, and may only be read
- **address**: (**Required**, integer): start address of the first register in a range
- **bitmask**: (*Optional*) some values are packed in a response. The bitmask can be used to extract a value from the response. For example, if the high byte value register 0x9013 contains the minute value of the current time. To only exctract this value use bitmask: 0xFF00. The result will be automatically right shifted by the number of 0 before the first 1 in the bitmask. For 0xFF00 (0b1111111100000000) the result is shifted 8 posistions. More than one sensor can use the same address/offset if the bitmask is different.
- **skip_updates**: (*Optional*, integer): By default all sensors of of a modbus_controller are updated together. For data points that don't change very frequently updates can be skipped. A value of 5 would only update this sensor range in every 5th update cycle
- **register_count**: (*Optional*): The number of registers this data point spans. Default is 1
- **response_size**: (**Required**):response number of bytes of the response
- **raw_encode**: (*Optional*, NONE , HEXBYTES, COMMA) If the response is binary it can't be published directly. Since a text sensor only publishes strings the binary data can encoded
- HEXBYTES: 2 byte hex string. 0x2011 will be sent as "2011".
- COMMA: Byte values as integers, delimited by a coma. 0x2011 will be sent as "32,17"
- **force_new_range**: (*Optional*, boolean): If possible sensors with sequential addresses are grouped together and requested in one range. Setting `foce_new_range: true` enforces the start of a new range at that address.
- **lambda** (*Optional*, :ref:`lambda <config-lambda>`):
Lambda to be evaluated every update interval to get the new value of the sensor
- **offset**: (*Optional*, integer): not required in most cases
offset from start address in bytes. If more than one register is read a modbus read registers command this value is used to find the start of this datapoint relative to start address. The component calculates the size of the range based on offset and size of the value type
Parameters passed into the lambda
- **x** (std:string): The parsed float value of the modbus data
- **data** (std::vector<uint8_t): vector containing the complete raw modbus response bytes for this sensor
note: because the response contains data for all registers in the same range you have to use `data[item->offset]` to get the first response byte for your sensor.
- **item** (const pointer to a SensorItem derived object): The sensor object itself.
Possible return values for the lambda:
- ``return <FLOATING_POINT_NUMBER>;`` the new value for the sensor.
- ``return NAN;`` if the state should be considered invalid to indicate an error (advanced).
- ``return {};`` if you don't want to publish a new state (advanced).
**Example**
.. code-block:: yaml
text_sensor:
- platform: template
name: "RTC Time Sensor"
id: template_rtc
- platform: modbus_controller
modbus_controller_id: traceranx
name: "rtc clock test"
id: rtc_clock_test
internal: true
register_type: holding
address: 0x9013
register_count: 3
hex_encode: true
response_size: 6
on_value:
then:
- lambda: |-
ESP_LOGV("main", "decoding rtc hex encoded raw data: %s", x.c_str());
uint8_t h=0,m=0,s=0,d=0,month_=0,y = 0 ;
m = esphome::modbus_controller::byte_from_hex_str(x,0);
s = esphome::modbus_controller::byte_from_hex_str(x,1);
d = esphome::modbus_controller::byte_from_hex_str(x,2);
h = esphome::modbus_controller::byte_from_hex_str(x,3);
y = esphome::modbus_controller::byte_from_hex_str(x,4);
month_ = esphome::modbus_controller::byte_from_hex_str(x,5);
// Now check if the rtc time of the controller is ok and correct it
time_t now = ::time(nullptr);
struct tm *time_info = ::localtime(&now);
int seconds = time_info->tm_sec;
int minutes = time_info->tm_min;
int hour = time_info->tm_hour;
int day = time_info->tm_mday;
int month = time_info->tm_mon + 1;
int year = time_info->tm_year - 2000;
// correct time if needed (ignore seconds)
if (d != day || month_ != month || y != year || h != hour || m != minutes) {
// create the payload
std::vector<uint16_t> rtc_data = {uint16_t((minutes << 8) | seconds), uint16_t((day << 8) | hour),
uint16_t((year << 8) | month)};
// Create a modbus command item with the time information as the payload
esphome::modbus_controller::ModbusCommandItem set_rtc_command = esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(traceranx, 0x9013, 3, rtc_data);
// Submit the command to the send queue
traceranx->queue_command(set_rtc_command);
ESP_LOGI("ModbusLambda", "EPSOLAR RTC set to %02d:%02d:%02d %02d.%02d.%04d", hour, minutes, seconds, day, month, year + 2000);
}
char buffer[20];
// format time as YYYY:mm:dd hh:mm:ss
sprintf(buffer,"%04d:%02d:%02d %02d:%02d:%02d",y+2000,month_,d,h,m,s);
id(template_rtc).publish_state(buffer);
See Also
--------
- :doc:`/components/modbus_controller`
- :doc:`/components/sensor/modbus_controller`
- :doc:`/components/binary_sensor/modbus_controller`
- :doc:`/components/switch/modbus_controller`
- https://www.modbustools.com/modbus.html
- :ghedit:`Edit`

View File

@ -21,6 +21,8 @@ via text sensors.
name: ESP Connected BSSID
mac_address:
name: ESP Mac Wifi Address
scan_results:
name: ESP Latest Scan Results
Configuration variables:
------------------------
@ -33,6 +35,8 @@ Configuration variables:
:ref:`Text Sensor <config-text_sensor>`.
- **mac_address** (*Optional*): Expose the Mac Address of the WiFi card. All options from
:ref:`Text Sensor <config-text_sensor>`.
- **scan_results** (*Optional*): Expose the latest networks found during the latest scan. All options from
:ref:`Text Sensor <config-text_sensor>`.
See Also
--------

View File

@ -67,9 +67,9 @@ author = "Otto Winter"
# built documents.
#
# The short X.Y version.
version = "2021.9"
version = "2021.10"
# The full version, including alpha/beta/rc tags.
release = "2021.9.3"
release = "2021.10.0b1"
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

1290
cookbook/tracer-an.rst Normal file

File diff suppressed because it is too large Load Diff

View File

@ -338,6 +338,7 @@ All Triggers
:ref:`ota.on_end <ota-on_end>` / :ref:`ota.on_error <ota-on_error>` /
:ref:`ota.on_state_change <ota-on_state_change>`
- :ref:`display.on_page_change <display-on_page_change-trigger>`
- :ref:`cover.on_open <cover-on_open_trigger>` / :ref:`cover.on_closed <cover-on_closed_trigger>`
All Actions
-----------
@ -577,7 +578,10 @@ a shorthand way of writing a ``while`` action with an empty ``then`` block.)
binary_sensor.is_on: some_binary_sensor
- logger.log: "Binary sensor is ready"
Configuration option: A :ref:`Condition <config-condition>`.
Configuration variables:
- **condition** (**Required**): The condition to wait to become true. See :ref:`Conditions <config-condition>`.
- **timeout** (*Optional*, :ref:`config-time`): Time to wait before timing out. Defaults to never timing out.
.. _component-update_action:

View File

@ -61,7 +61,7 @@ Contributors
- `Andrzej (@andriej) <https://github.com/andriej>`__
- `Andreas (@anduchs) <https://github.com/anduchs>`__
- `anekinloewe (@anekinloewe) <https://github.com/anekinloewe>`__
- `Angel Nunez Mencias (@angelnu) <https://github.com/angelnu>`__
- `Vegetto (@angelnu) <https://github.com/angelnu>`__
- `Sergey Anisimov (@anisimovsergey) <https://github.com/anisimovsergey>`__
- `ankycooper (@ankycooper) <https://github.com/ankycooper>`__
- `Nikolay Vasilchuk (@Anonym-tsk) <https://github.com/Anonym-tsk>`__
@ -152,6 +152,7 @@ Contributors
- `Dave Wongillies (@davewongillies) <https://github.com/davewongillies>`__
- `David De Sloovere (@DavidDeSloovere) <https://github.com/DavidDeSloovere>`__
- `David Beitey (@davidjb) <https://github.com/davidjb>`__
- `davidmonro (@davidmonro) <https://github.com/davidmonro>`__
- `David Zovko (@davidzovko) <https://github.com/davidzovko>`__
- `dckiller51 (@dckiller51) <https://github.com/dckiller51>`__
- `Debashish Sahu (@debsahu) <https://github.com/debsahu>`__
@ -334,7 +335,7 @@ Contributors
- `Jonathan Adams (@jonathanadams) <https://github.com/jonathanadams>`__
- `Jonathan Treffler (@JonathanTreffler) <https://github.com/JonathanTreffler>`__
- `JonnyaiR (@jonnyair) <https://github.com/jonnyair>`__
- `Joppy Furr (@JoppyFurr) <https://github.com/JoppyFurr>`__
- `Joppy (@JoppyFurr) <https://github.com/JoppyFurr>`__
- `jsuanet (@jsuanet) <https://github.com/jsuanet>`__
- `junnikokuki (@junnikokuki) <https://github.com/junnikokuki>`__
- `Justahobby01 (@Justahobby01) <https://github.com/Justahobby01>`__
@ -369,7 +370,7 @@ Contributors
- `Kodey Converse (@krconv) <https://github.com/krconv>`__
- `krikk (@krikk) <https://github.com/krikk>`__
- `KristopherMackowiak (@KristopherMackowiak) <https://github.com/KristopherMackowiak>`__
- `Stefan Rado (@kroimon) <https://github.com/kroimon>`__
- `kroimon (@kroimon) <https://github.com/kroimon>`__
- `krunkel (@krunkel) <https://github.com/krunkel>`__
- `Kendell R (@KTibow) <https://github.com/KTibow>`__
- `Jakub Šimo (@kubik369) <https://github.com/kubik369>`__
@ -469,6 +470,7 @@ Contributors
- `n8detar (@n8detar) <https://github.com/n8detar>`__
- `Erik Näsström (@Naesstrom) <https://github.com/Naesstrom>`__
- `Oskar Napieraj (@napieraj) <https://github.com/napieraj>`__
- `Nate Lust (@natelust) <https://github.com/natelust>`__
- `ueno (@nayuta-ueno) <https://github.com/nayuta-ueno>`__
- `Nazar Mokrynskyi (@nazar-pc) <https://github.com/nazar-pc>`__
- `Bergont Nicolas (@nbergont) <https://github.com/nbergont>`__
@ -480,7 +482,9 @@ Contributors
- `nickrout (@nickrout) <https://github.com/nickrout>`__
- `Nick Whyte (@nickw444) <https://github.com/nickw444>`__
- `nicuh (@nicuh) <https://github.com/nicuh>`__
- `Joakim Vindgard (@nigobo) <https://github.com/nigobo>`__
- `nikito7 (@nikito7) <https://github.com/nikito7>`__
- `niklasweber (@niklasweber) <https://github.com/niklasweber>`__
- `Zvonimir Haramustek (@nitko12) <https://github.com/nitko12>`__
- `Nikolay Kitanov (@nkitanov) <https://github.com/nkitanov>`__
- `nldroid (@nldroid) <https://github.com/nldroid>`__
@ -543,7 +547,7 @@ Contributors
- `Leandro Puerari (@puerari) <https://github.com/puerari>`__
- `puuu (@puuu) <https://github.com/puuu>`__
- `Qc (@qc24) <https://github.com/qc24>`__
- `qqgg231 (@qqgg231) <https://github.com/qqgg231>`__
- `Karol Zlot (@qqgg231) <https://github.com/qqgg231>`__
- `Tommy Jonsson (@quazzie) <https://github.com/quazzie>`__
- `Quinn Hosler (@quinnhosler) <https://github.com/quinnhosler>`__
- `r-jordan (@r-jordan) <https://github.com/r-jordan>`__
@ -590,6 +594,7 @@ Contributors
- `ryanalden (@ryanalden) <https://github.com/ryanalden>`__
- `Ryan Nazaretian (@ryannazaretian) <https://github.com/ryannazaretian>`__
- `Silvio (@s1lvi0) <https://github.com/s1lvi0>`__
- `Jan Čermák (@sairon) <https://github.com/sairon>`__
- `samnewman86 (@samnewman86) <https://github.com/samnewman86>`__
- `sascha lammers (@sascha432) <https://github.com/sascha432>`__
- `Sascha (@Scarbous) <https://github.com/Scarbous>`__
@ -613,6 +618,7 @@ Contributors
- `Derek Hageman (@Sizurka) <https://github.com/Sizurka>`__
- `Stephen Tierney (@sjtrny) <https://github.com/sjtrny>`__
- `Niklas Wagner (@Skaronator) <https://github.com/Skaronator>`__
- `Rafael Treviño (@skasi7) <https://github.com/skasi7>`__
- `Luca Zimmermann (@soundstorm) <https://github.com/soundstorm>`__
- `Sourabh Jaiswal (@sourabhjaiswal) <https://github.com/sourabhjaiswal>`__
- `Philip Allgaier (@spacegaier) <https://github.com/spacegaier>`__
@ -692,7 +698,7 @@ Contributors
- `Thorsten von Eicken (@tve) <https://github.com/tve>`__
- `Tyler Menezes (@tylermenezes) <https://github.com/tylermenezes>`__
- `tyomikh (@tyomikh) <https://github.com/tyomikh>`__
- `wuuker (@ukewea) <https://github.com/ukewea>`__
- `ukewea (@ukewea) <https://github.com/ukewea>`__
- `Vc (@Valcob) <https://github.com/Valcob>`__
- `Nad (@valordk) <https://github.com/valordk>`__
- `Víctor Ferrer García (@vicfergar) <https://github.com/vicfergar>`__
@ -733,4 +739,4 @@ Contributors
- `ZTX18 (@ZTX18) <https://github.com/ZTX18>`__
- `Christian Zufferey (@zuzu59) <https://github.com/zuzu59>`__
*This page was last updated October 7, 2021.*
*This page was last updated October 13, 2021.*

BIN
images/daly_bms.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 186 KiB

BIN
images/esp32-modbus.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

BIN
images/ltr390.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

BIN
images/modbus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

1
images/restart-alert.svg Normal file
View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="mdi-restart-alert" width="24" height="24" viewBox="0 0 24 24"><path d="M10 4.03V.633L5 5.63L10 10.63V6.03C11.5 6.03 13.11 6.63 14.21 7.73C16.5 10.13 16.5 13.93 14.21 16.23C12.91 17.53 11.11 18.13 9.4 17.93L8.9 19.93C11.31 20.23 13.81 19.53 15.61 17.63C18.7 14.53 18.7 9.43 15.61 6.33C14.11 4.83 12.11 4.03 10 4.03M4.31 17.63C5.11 18.43 6 19.03 7 19.43L7.61 17.43C6.91 17.13 6.31 16.73 5.81 16.23C3.91 14.43 3.5 11.63 4.61 9.43L3.11 7.93C1.31 11.03 1.71 15.03 4.31 17.63M20 13H22V7H20V13M20 17H22V15H20V17Z" /></svg>

After

Width:  |  Height:  |  Size: 752 B

BIN
images/rs485.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 KiB

BIN
images/scd4x.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
images/tracer-an.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -180,6 +180,7 @@ Air Quality
SDS011 Sensor, components/sensor/sds011, sds011.jpg, Particulate
SenseAir, components/sensor/senseair, senseair_s8.jpg, CO2
SCD30, components/sensor/scd30, scd30.jpg, CO2 & Temperature & Humidity
SCD4X, components/sensor/scd4x, scd4x.jpg, CO2 & Temperature & Humidity
SGP30, components/sensor/sgp30, sgp30.jpg, CO2 & Volatile organics
SGP40, components/sensor/sgp40, sgp40.jpg, Volatile organics
SM300D2, components/sensor/sm300d2, sm300d2.jpg, Air quality
@ -239,6 +240,7 @@ Electricity
CS5460A, components/sensor/cs5460a, cs5460a.png, Voltage & Current & Power
CSE7766, components/sensor/cse7766, cse7766.svg, Voltage & Current & Power
CT Clamp, components/sensor/ct_clamp, ct_clamp.jpg, AC current
Daly BMS, components/sensor/daly_bms, daly_bms.png, Voltage & Current & Power
DSMR, components/sensor/dsmr, dsmr.svg, Electrical counter
HLW8012, components/sensor/hlw8012, hlw8012.svg, Voltage & Current & Power
INA219, components/sensor/ina219, ina219.jpg, DC current
@ -266,7 +268,7 @@ Environmental
BME680 via BSEC, components/sensor/bme680_bsec, bme680.jpg, Temperature & Humidity & Pressure & Gas
BMP085, components/sensor/bmp085, bmp180.jpg, Temperature & Pressure
BMP280, components/sensor/bmp280, bmp280.jpg, Temperature & Pressure
b-parasite, components/sensor/b_parasite, b_parasite.jpg, Moisture & Temperature & Humidity
b-parasite, components/sensor/b_parasite, b_parasite.jpg, Moisture & Temperature & Humidity & Light
Dallas DS18B20, components/sensor/dallas, dallas.jpg, Temperature
DHT, components/sensor/dht, dht.jpg, Temperature & Humidity
DHT12, components/sensor/dht12, dht12.jpg, Temperature & Humidity
@ -279,6 +281,7 @@ Environmental
NTC Thermistor, components/sensor/ntc, ntc.jpg, Temperature
RuuviTag, components/sensor/ruuvitag, ruuvitag.jpg, Temperature & Humidity & Accelerometer
SCD30, components/sensor/scd30, scd30.jpg, CO2 & Temperature & Humidity
SCD4X, components/sensor/scd4x, scd4x.jpg, CO2 & Temperature & Humidity
SDP3x, components/sensor/sdp3x, sdp31.jpg, Pressure
SHT3X-D, components/sensor/sht3xd, sht3xd.jpg, Temperature & Humidity
SHT4X, components/sensor/sht4x, sht4x.jpg, Temperature & Humidity
@ -295,6 +298,7 @@ Light
AM43, components/sensor/am43, am43.jpg, Lux
APDS9960, components/sensor/apds9960, apds9960.jpg, Colour & Gesture
BH1750, components/sensor/bh1750, bh1750.jpg, Lux
LTR390, components/sensor/ltr390, ltr390.jpg, Lux & UV
TCS34725, components/sensor/tcs34725, tcs34725.jpg, Lux & RGB colour
TSL2561, components/sensor/tsl2561, tsl2561.jpg, Lux
TSL2591, components/sensor/tsl2591, tsl2591.jpg, Lux
@ -315,9 +319,10 @@ Miscellaneous
AS3935, components/sensor/as3935, as3935.jpg, Storm lightning
Binary Sensor Map, components/sensor/binary_sensor_map, binary_sensor_map.jpg, Map binary to value
b-parasite, components/sensor/b_parasite, b_parasite.jpg, Moisture & Temperature & Humidity
b-parasite, components/sensor/b_parasite, b_parasite.jpg, Moisture & Temperature & Humidity & Light
EZO sensor circuits, components/sensor/ezo, ezo-ph-circuit.png, (pH)
Havells Solar, components/sensor/havells_solar, havellsgti5000d_s.jpg, Solar rooftop
Modbus Sensor, components/sensor/modbus_controller, modbus.png
Nextion, components/sensor/nextion, nextion.jpg, Sensors from display
Rotary Encoder, components/sensor/rotary_encoder, rotary_encoder.jpg
Tuya Sensor, components/sensor/tuya, tuya.png
@ -348,8 +353,7 @@ Weight
.. imgtable::
HX711, components/sensor/hx711, hx711.jpg, Load cell amplifier
Xiaomi Miscale, components/sensor/xiaomi_miscale, xiaomi_miscale.jpg
Xiaomi Miscale2, components/sensor/xiaomi_miscale2, xiaomi_miscale2.jpg
Xiaomi Miscale, components/sensor/xiaomi_miscale, xiaomi_miscale1&2.jpg
Looking for a sensor that outputs its values as an analog voltage? Have a look at the
@ -376,6 +380,7 @@ Binary Sensor Components
RDM6300, components/binary_sensor/rdm6300, rdm6300.jpg
TTP229, components/binary_sensor/ttp229, ttp229.jpg
Tuya Binary Sensor, components/binary_sensor/tuya, tuya.png
Modbus Binary Sensor, components/binary_sensor/modbus_controller, modbus.png
XPT2046, components/binary_sensor/xpt2046, xpt2046.jpg
Custom Binary Sensor, components/binary_sensor/custom, language-cpp.svg
@ -398,6 +403,7 @@ Output Components
SM16716, components/output/sm16716, sm16716.svg
SM2135, components/output/sm2135, sm2135.svg
MCP4725, components/output/mcp4725, mcp4725.jpg
Modbus Output, components/output/modbus_controller, modbus.png
Custom Output, components/output/custom, language-cpp.svg
Template Output, components/output/template, description.svg
@ -438,12 +444,14 @@ Switch Components
Switch Core, components/switch/index, folder-open.svg
GPIO Switch, components/switch/gpio, pin.svg
Restart Switch, components/switch/restart, restart.svg
Safe Mode Switch, components/switch/safe_mode, restart-alert.svg
Shutdown Switch, components/switch/shutdown, power_settings.svg
Generic Output Switch, components/switch/output, upload.svg
Template Switch, components/switch/template, description.svg
UART Switch, components/switch/uart, uart.svg
Custom Switch, components/switch/custom, language-cpp.svg
Tuya Switch, components/switch/tuya, tuya.png
Modbus Switch, components/switch/modbus_controller, modbus.png
BLE Client Switch, components/switch/ble_client, bluetooth.svg
Nextion Switch, components/switch/nextion, nextion.jpg
@ -492,9 +500,11 @@ Cover Components
Cover Core, components/cover/index, folder-open.svg
Template Cover, components/cover/template, description.svg
Endstop Cover, components/cover/endstop, electric-switch.svg
Current-Based Cover, components/cover/current_based, flash.svg
Time-Based Cover, components/cover/time_based, timer.svg
Custom Cover, components/cover/custom, language-cpp.svg
AM43 Cover, components/cover/am43, am43.jpg
Tuya Cover, components/cover/tuya, tuya.png
Text Sensor Components
----------------------
@ -507,6 +517,7 @@ Text Sensor Components
Version, components/text_sensor/version, new-box.svg
WiFi Info, components/text_sensor/wifi_info, network-wifi.svg
BLE Scanner, components/text_sensor/ble_scanner, bluetooth.svg
Modbus Text Sensor, components/text_sensor/modbus_controller, modbus.png
Template Text Sensor, components/text_sensor/template, description.svg
Custom Text Sensor, components/text_sensor/custom, language-cpp.svg
Nextion Text Sensor, components/text_sensor/nextion, nextion.jpg
@ -532,6 +543,7 @@ Number Components
.. imgtable::
Number Core, components/number/index, folder-open.svg
Modbus Number, components/number/modbus_controller, modbus.png
Template Number, components/number/template, description.svg
Select Components
@ -579,6 +591,7 @@ Misc Components
TM1651 Battery Display, components/tm1651, tm1651_battery_display.jpg
RF Bridge, components/rf_bridge, rf_bridge.jpg
Tuya MCU, components/tuya, tuya.png
Modbus Controller, components/modbus_controller, modbus.png
Exposure Notifications, components/exposure_notifications, exposure_notifications.png
RTTTL Buzzer, components/rtttl, buzzer.jpg
Prometheus, components/prometheus, prometheus.svg
@ -628,6 +641,7 @@ Cookbook
IAQ (Indoor Air Quality) Board, cookbook/iaq_board, iaq_board2.jpg
Custom UART Text Sensor, cookbook/uart_text_sensor, language-cpp.svg
IWOOLE Table Lamp, cookbook/iwoole_rgbw_table_lamp, iwoole_rgbw_table_lamp.png
EPEVER Tracer, cookbook/tracer-an, tracer-an.jpg
Ilonda Wifi Smart Fish Feeder, cookbook/ilonda-wifi-smart-fish-feeder, ilonda-wifi-smart-fish-feeder-cookbook.jpg
Do you have other awesome automations or cool setups? Please feel free to add them to the