diff --git a/components/modbus.rst b/components/modbus.rst index 21f319560..903a0b5b8 100644 --- a/components/modbus.rst +++ b/components/modbus.rst @@ -44,7 +44,7 @@ See Also - :doc:`/components/switch/modbus_controller` - :doc:`/components/number/modbus_controller` - :doc:`/components/output/modbus_controller` -- :doc:`EPEVER MPPT Solar Charge Controller Tracer-AN Series` +- `EPEVER MPPT Solar Charge Controller (Tracer-AN Series) `__ - `Modbus RTU Protocol Description `__ - :ref:`uart` - :apiref:`modbus/modbus.h` diff --git a/components/modbus_controller.rst b/components/modbus_controller.rst index fe8fe9475..88a5fabc0 100644 --- a/components/modbus_controller.rst +++ b/components/modbus_controller.rst @@ -529,6 +529,6 @@ See Also - :doc:`/components/switch/modbus_controller` - :doc:`/components/number/modbus_controller` - :doc:`/components/output/modbus_controller` -- :doc:`EPEVER MPPT Solar Charge Controller Tracer-AN Series` +- `EPEVER MPPT Solar Charge Controller (Tracer-AN Series) `__ - `Modbus RTU Protocol Description `__ - :ghedit:`Edit` diff --git a/components/sensor/ltr390.rst b/components/sensor/ltr390.rst index 867ccff30..3a0a751ed 100644 --- a/components/sensor/ltr390.rst +++ b/components/sensor/ltr390.rst @@ -111,7 +111,7 @@ See Also - :doc:`/components/sensor/bh1750` - :doc:`/components/sensor/tsl2561` -- :doc:`/cookbook/temt6000` +- `TEMT6000 `__ - :ref:`sensor-filters` - :apiref:`ltr390/ltr390.h` - :ghedit:`Edit` diff --git a/components/sensor/modbus_controller.rst b/components/sensor/modbus_controller.rst index e5bd03f9f..cd20e6764 100644 --- a/components/sensor/modbus_controller.rst +++ b/components/sensor/modbus_controller.rst @@ -271,5 +271,5 @@ See Also - :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` +- `EPEVER MPPT Solar Charge Controller (Tracer-AN Series) `__ - :ghedit:`Edit` diff --git a/cookbook/air_gradient_diy_air_quality_sensor.rst b/cookbook/air_gradient_diy_air_quality_sensor.rst deleted file mode 100644 index be0071e60..000000000 --- a/cookbook/air_gradient_diy_air_quality_sensor.rst +++ /dev/null @@ -1,63 +0,0 @@ -.. seo:: - :description: AirGradient DIY Air Quality Sensor - :image: air_gradient_diy_air_quality_sensor.jpg - :keywords: Air Quality Sensor DIY - -AirGradient DIY Air Quality Sensor -================================== - -.. figure:: images/air_gradient_diy_air_quality_sensor.jpg - :align: center - :width: 100.0% - -AirGradient has created a DIY Air Quality sensor. -They offer a PCB, PCB + components kit, etc. -A pretty neat package. -To use this you have to run their software but you can use the kit with ESPHome as well! - -Here is what it can measure: - -- **Temperature** -- **Humidity** -- **Air particles PM2.5** -- **Carbon Dioxide** - -Additionally: - -- There is a display so show off your data or whatever you desire from Home Assistant -- You can download a 3D printable case including a wall mount bracket - - -ESPHome Configuration ---------------------- -Documentation: - -- `Blog Article: Measuring Air Quality in your Home Office `__ -- `ESPHome code with a setup guide for Home Assistant `__ -- `AirGradient Shop for the PCB or PCB plus components `__ -- `AirGradient Setup Guide (3D printeable case, setup guide, etc.) `__ - -`YAML configuration `__ - -Soldering and setup video: - -.. raw:: html - - - -See Also --------- - -- :doc:`/devices/nodemcu_esp8266` -- :doc:`/components/display/ssd1306` -- :doc:`/components/i2c` -- :doc:`/components/uart` -- :doc:`/components/sensor/sht3xd` -- :doc:`/components/sensor/pmsx003` -- :doc:`/components/sensor/senseair` -- :doc:`/components/wifi` -- :doc:`/components/api` -- :doc:`/components/logger` -- :doc:`/components/ota` -- :doc:`/components/switch/safe_mode` -- :ghedit:`Edit` diff --git a/cookbook/ble_itag.rst b/cookbook/ble_itag.rst deleted file mode 100644 index a797ad550..000000000 --- a/cookbook/ble_itag.rst +++ /dev/null @@ -1,121 +0,0 @@ -BLE iTag Button -=============== - -.. seo:: - :description: Receive events from a cheap BLE keyring button. - :image: bluetooth.svg - -This example shows how to use a cheap BLE keyring tag to trigger arbitrary -events. An ESP32 is used, which provides a BLE peripheral. - -.. figure:: images/esp32_ble_itag.png - :align: center - :width: 40% - -These tags can be had for a couple of dollars each and run for several months -on a coin cell. Using the BLE features of ESPHome, you can use these as small -and cheap remotes to control any automation. - -Quickstart ----------- - -Use the configuration block below for a basic setup which will provide a -binary_sensor that is momentarily turned on when the button is pressed. - -You will need to find the MAC address of your tag. See the documentation -for :doc:`/components/ble_client` for how to find this out. You may also -wish to change the name and id fields where appropriate to suit your -device(s). - -Note that a maximum of three devices are supported due to limitations in -the ESP32's BLE stack. - -Configuration example: ------------------------- - -.. code-block:: yaml - - esp32_ble_tracker: - - ble_client: - # Replace with the MAC address of your device. - - mac_address: FF:FF:20:00:0F:15 - id: itag_black - - binary_sensor: - - platform: template - id: black_button - name: "Black iTag Button" - filters: - delayed_off: 200ms - - sensor: - # This entry registers and awaits notifications for the - # characteristic that signals button presses. Each time - # a notification is received, the corresponding binary_sensor - # is briefly toggled. - - platform: ble_client - type: characteristic - ble_client_id: itag_black - name: "Black iTag btn" - service_uuid: 'ffe0' - characteristic_uuid: 'ffe1' - notify: true - update_interval: never - on_notify: - then: - - binary_sensor.template.publish: - id: black_button - state: ON - - binary_sensor.template.publish: - id: black_button - state: OFF - # This entry queries the battery level. Some tags may not - # support this characteristic, you will see 'Unknown' in the - # HA frontend. - - platform: ble_client - type: characteristic - ble_client_id: itag_black - name: "Black iTag Battery" - service_uuid: '180f' - characteristic_uuid: '2a19' - icon: 'mdi:battery' - unit_of_measurement: '%' - # This entry queries polls the RSSI when the tag is connected. - - platform: ble_client - type: rssi - ble_client_id: itag_black - name: "Black iTag RSSI" - -Explanation ------------ - -The first thing enabled is the ``esp32_ble_tracker`` component. This sets up -the BLE stack on the device and listens for available devices. - -Next, the ``ble_client`` component will listen to devices discovered by -the tracker, and establish a connection to the given device when it is -available. - -The ``binary_sensor`` provides a template sensor which will export to the -HA frontend the sensor that's switched by the BLE tag's button. - -The first entry in the ``sensor`` component is used to configure the specific -Service and Characteristic UUIDs for an iTag's button. It also enables BLE -notifications and sets up an automation to toggle the ``binary_sensor`` when -a notification is received from the tag. Automatic updates are disabled, there -is no point querying the tag for the device state, as we will be immediately -notified when the button is pressed. - -The next ``sensor`` entry listens for a well-known Service and Chacteristic -that is used by many BLE devices to give battery level information. This sensor -will be exposed in the HA frontend to determine the state of the tag's battery. -Note that many tags will not provide this service, so you will not see a valid -value. If not, you can remove this from the config. - -See Also --------- - -- :doc:`/components/ble_client` -- :doc:`/components/sensor/ble_client` -- :ghedit:`Edit` diff --git a/cookbook/bruh.rst b/cookbook/bruh.rst deleted file mode 100644 index d15e4b056..000000000 --- a/cookbook/bruh.rst +++ /dev/null @@ -1,89 +0,0 @@ -BRUH Multisensor -================ - -.. seo:: - :description: Instructions for re-creating a BRUH multisensor using ESPHome. - :image: bruh.png - -The BRUH Multisensor is a great introductory project into Home Automation with an -amazing setup tutorial. And fortunately ESPHome has complete support for all the -stuff used by the Multisensor 🎉 - -.. raw:: html - - - -Thank you very much to `@jackjohnsonuk `__ for providing this -configuration file 😀 - -.. code-block:: yaml - - esphome: - name: - - esp8266: - board: nodemcuv2 - - wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - api: - - # Enable logging - logger: - - ota: - - sensor: - - platform: dht - pin: D7 - temperature: - name: "Multisensor Temperature" - humidity: - name: "Multisensor Humidity" - - platform: adc - pin: A0 - name: "Multisensor Brightness" - unit_of_measurement: lux - filters: - - lambda: |- - return (x / 10000.0) * 2000000.0; - - binary_sensor: - - platform: gpio - pin: D5 - name: "Multisensor Motion" - device_class: motion - - output: - - platform: esp8266_pwm - pin: D1 - id: redgpio - - platform: esp8266_pwm - pin: D2 - id: greengpio - - platform: esp8266_pwm - pin: D3 - id: bluegpio - - light: - - platform: rgb - name: "Multisensor Light" - red: redgpio - green: greengpio - blue: bluegpio - - -See Also --------- - -- :doc:`/devices/nodemcu_esp8266` -- :doc:`pir` -- :doc:`temt6000` -- :doc:`/components/light/rgb` -- :doc:`/components/output/esp8266_pwm` -- :doc:`/components/sensor/dht` -- :doc:`/components/sensor/adc` -- :doc:`/components/binary_sensor/gpio` -- :ghedit:`Edit` diff --git a/cookbook/esw01-eu.rst b/cookbook/esw01-eu.rst deleted file mode 100644 index c92b364eb..000000000 --- a/cookbook/esw01-eu.rst +++ /dev/null @@ -1,124 +0,0 @@ -Etekcity Voltson (ESW01-EU) -=========================== - -.. seo:: - :description: Configure an Etekcity Voltson and calculate the missing current sensor - :image: esw01-eu.jpg - :keywords: Etekcity, Voltson, ESW01, ESW01-EU, HLW8012, Home Assistant, ESPHome - - -The Etekcity Voltson brings a 10A relay, two LEDs (blue and yellow), a push button and a :doc:`/components/sensor/hlw8012` -in a very small package and at a reasonable price. - -.. note:: - - There are quite a few hardware revisions out there. Also reginal versions like US, UK and EU are different. - -Flashing --------- - -Opening the case for flashing varies a lot for different hardware revisions. Mine was easy as it had two tiny T5 Torx screws in the front and four Philipps screws inside. -Once you have opened the case, remove the PCB from it and attach your TTL as follows: - -5V and GND go to the bottom: - -.. figure:: images/esw01-eu-pcb-bottom.jpg - :align: center - :width: 75.0% - -On the opposite side, T12 is TX, T13 is RX. During boot you need to connect T11 and T16 pads to GND. Easiest is to flash with pogo pins. - -.. figure:: images/esw01-eu-pcb-top.jpg - :align: center - :width: 75.0% - -Configuration -------------- - -As the Voltson has its SEL pin permanently pulled high, we are unable to switch from voltage measurement to current measurement. -This will be circumvented by defining the initial mode to be voltage measurement (see :doc:`/components/sensor/hlw8012` documentation) -and calculating the current with `Ohm's law `_: ``P (watts) = V (volts) x I (amps)`` - -.. code-block:: yaml - - esphome: - name: voltson - - esp8266: - board: esp01_1m - - ### you wifi and other settings here ### - - ### pins ### - # D1 GPIO5 | LED blue | status_led - # D0 GPIO16 | LED yellow | led1 - # D5 GPIO14 | SW1 | button1 - # D2 GPIO4 | REL1 | relay1 - # D6 GPIO12 | HLW8012/CF1 | cf1_pin - # D7 GPIO13 | HLW8012/CF | cf_pin - - status_led: - pin: - number: GPIO5 - - output: - - platform: gpio - id: relay1 - pin: GPIO4 - - platform: gpio - id: led1 - pin: GPIO16 - - switch: - - platform: output - name: "Voltson Relay" - id: switch1 - output: relay1 - on_turn_on: - - output.turn_on: led1 - on_turn_off: - - output.turn_off: led1 - - binary_sensor: - - platform: gpio - id: button1 - pin: - number: GPIO14 - mode: - input: true - pullup: true - inverted: true - on_press: - - switch.toggle: switch1 - - sensor: - - platform: hlw8012 - sel_pin: 0 # not connected - cf_pin: GPIO13 - cf1_pin: GPIO12 - voltage: - id: hlw8012_voltage - name: "HLW8012 Voltage" - power: - id: hlw8012_power - name: "HLW8012 Power" - on_value: - - sensor.template.publish: - id: hlw8012_current_calculated - state: !lambda 'return id(hlw8012_power).state / id(hlw8012_voltage).state;' - update_interval: 10s - initial_mode: VOLTAGE - change_mode_every: 4294967295 # basically never - - platform: template - id: hlw8012_current_calculated - name: "HLW8012 Current (calculated)" - unit_of_measurement: A - accuracy_decimals: 2 - - - -See Also --------- - -- :doc:`/components/sensor/hlw8012` -- :ghedit:`Edit` diff --git a/cookbook/geiger-counter.rst b/cookbook/geiger-counter.rst deleted file mode 100644 index 9e81062c0..000000000 --- a/cookbook/geiger-counter.rst +++ /dev/null @@ -1,80 +0,0 @@ -Geiger counter RadiationD v1.1 (CAJOE) -====================================== - -.. seo:: - :description: Instructions for setting up RadiationD v1.1(CAJOE) sensor in ESPHome and calculate the current radation level. - :image: radiationD-v1-1-cajoe_small.jpg - :keywords: Radiation Geiger counter - -With the help of :doc:`/components/sensor/pulse_counter` and the RadiationD v1.1(CAJOE) you can make your own Geiger counter, which will give you -a more or less precise messurement of the current radation level. But it should be good enough to warn you about critical events. - - -Assembly: ---------- - -.. figure:: images/radiationD-v1-1-cajoe_small.jpg - :align: center - :width: 100.0% - -The first step is to connect the sensor. - -You just need to connect the +5V, the ground and a GPIO pin to the ESP. -In my case I used the pin 34 for the signal. (The print on the PCB is wrong VIN is the signal.) -This setup should give you the pulse of each messurement or count. For more information check the Video of `Andreas Spiess `__. - -Housing: -********* -I just 3D printed an small housing the avoid touching the high voltage Geiger Mueller tube. -`Counter Tube Case `__ -(The tube should not be in direct sunlight. So maybe you will need another case.) - - -Configuration: ---------------- - -The block :doc:`/components/sensor/pulse_counter` will count the radation events per minute. -With the found specs of the tube you will be able to calculate the radiation in μSv/h. - -It's just the counts per minute (CPM) times the factor of your Geiger Mueller tube you're using. It should be the J305ß, which comes with the PCB. -(To make sure - check your printing on the tube) - -μSv/h = (CPM - Tube noise) * Factor -According to the video of `Andreas Spiess `__ the tube should have about 12 CPM as background noise. - -.. note:: - - The current version of the pack comes with the J305ß Geiger tube which detectes Beta and Gamma radiation. Specifications: - Manufacturer: North Optic Radiation Detection: β, γ Length: 111mm Diameter: 11mm Recommended Voltage: 350V Plateau Voltage: 360-440V - Sensitivy γ (60Co): 65cps/(μR/s) - Sensitivy γ (equivalent Sievert): 108cpm / (μSv/h) - Max cpm: 30000 - cps/mR/h: 18 - cpm/m/h: 1080 - cpm/μSv/h: 123.147092360319 - Factor: 0.00812037037037 - - -`Source: opengeiger.de/LibeliumDoku.pdf `__. - - -.. code-block:: yaml - - sensor: - - platform: pulse_counter - pin: 34 - name: "Radiation" - unit_of_measurement: 'μSv/h' - count_mode: - rising_edge: DISABLE - falling_edge: INCREMENT - filters: - - offset: -12.0 # J305ß Geiger Mueller tube background noise 0.2 pulses / sec x 60 sec = 12 CPM (Counts per Minute) - - multiply: 0.00812037037037 # Factor: 0.00812037037037 - - -See Also --------- - -- :doc:`/components/sensor/pulse_counter` -- :ghedit:`Edit` diff --git a/cookbook/h801.rst b/cookbook/h801.rst deleted file mode 100644 index 5ec856d49..000000000 --- a/cookbook/h801.rst +++ /dev/null @@ -1,167 +0,0 @@ -H801 RGBW LED controller -======================== - -The H801 is pretty affordable and easy to hack and adapt to your needs. It can be found on `AliExpress `__ -and other sites. The board is based on an `ESP8266EX `__ chip. - -It has 5 seperate PWM outputs (each driven by a `DTU35N06 `__ MOSFET rated -for 106W max power), and can be used as a :doc:`RGB ` / :doc:`RGBW ` / -:doc:`RGBWW ` / :doc:`RGBCT ` controller or configured with any combination of up to -five :doc:`individual monochromatic PWM ` lights. -See `A closer look at the H801 LED WiFi Controller `__ for more details on the hardware. - -.. figure:: images/h801.jpg - :align: center - :width: 80.0% - -Sample configuration --------------------- - -You can use the :doc:`RGBWW ` and the :doc:`ESP8266 Software PWM output ` components using below configuration: - -.. code-block:: yaml - - esphome: - name: h801light - - esp8266: - board: esp01_1m - - wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - logger: - api: - ota: - - output: - - platform: esp8266_pwm - pin: 12 - frequency: 1000 Hz - id: pwm_b - - platform: esp8266_pwm - pin: 13 - frequency: 1000 Hz - id: pwm_g - - platform: esp8266_pwm - pin: 15 - frequency: 1000 Hz - id: pwm_r - - platform: esp8266_pwm - pin: 14 - frequency: 1000 Hz - id: pwm_w1 - - platform: esp8266_pwm - pin: 4 - frequency: 1000 Hz - id: pwm_w2 - light: - - platform: rgbww - name: "H801 Light" - red: pwm_r - green: pwm_g - blue: pwm_b - cold_white: pwm_w1 - warm_white: pwm_w2 - -For :doc:`RGBW ` lights, the ``pwm_w2`` output is not used (and can be removed): - -.. code-block:: yaml - - light: - - platform: rgbw - name: "H801 Light" - red: pwm_r - green: pwm_g - blue: pwm_b - white: pwm_w1 - -Flashing --------- - -Make your node in the ESPHome dashboard and compile/upload it. -(if it fails OTA it must be uploaded manually with your favorite ESP flasher, -e.g. :ref:`esphome-flasher `) - -You will need to solder pins to the board inside the H801 (fortunately it's pretty roomy and -not a lot of components or stuff in the way apart from the 2 wires on the back). - -3.3V, GND, TX and RX (RX to RX and TX to TX) needs to be connected to your serial adapter, the -two other pins must be shorted throughout the flashing process by a jumper or a breadboard cable. -(Remember to remove it after flashing) - -.. figure:: images/h801-board-front.jpg - :align: center - :width: 80.0% - -Front side of board with pins soldered on - -.. figure:: images/h801-board-back.jpg - :align: center - :width: 80.0% - -Back side of the board (don't melt the blue and red wire when soldering) - -Add A PIR(Motion) Sensor ------------------------- - -It's possible to use the header that was soldered on for flashing as an input. -The example below uses the TX pin as a PIR motion sensor input: - -.. figure:: images/h801-pir_sensor.jpg - :align: center - :width: 80.0% - -H801 shown with PIR connected to header pins - -The following can be appended to the YAML file for your H801 to configure the TX pin as a motion -sensor input. - -.. code-block:: yaml - - binary_sensor: - - platform: gpio - pin: GPIO3 - name: "GPIO3-TX Motion" - device_class: motion - -Pinout ------- - -.. list-table:: - :header-rows: 1 - - * - Function - - ESP Pin - * - R (PWM1) - - GPIO15 - * - G (PWM2) - - GPIO13 - * - B (PWM3) - - GPIO12 - * - W1 (PWM4) - - GPIO14 - * - W2 (PWM5) - - GPIO4 - * - Jumper J3 - - GPIO0 - * - RX - - GPIO2 - * - TX - - GPIO3 - * - LED D1 (red) - - GPIO5 - * - LED D2 (green) - - GPIO1 - -See Also --------- - -- :doc:`/components/light/rgb` -- :doc:`/components/light/rgbw` -- :doc:`/components/light/rgbww` -- :doc:`/components/light/rgbct` -- :doc:`/components/light/monochromatic` -- :doc:`/components/output/esp8266_pwm` -- :ghedit:`Edit` diff --git a/cookbook/iaq_board.rst b/cookbook/iaq_board.rst deleted file mode 100644 index 260866611..000000000 --- a/cookbook/iaq_board.rst +++ /dev/null @@ -1,65 +0,0 @@ -.. seo:: - :description: IAQ (Indoor Air Quality) Board - :image: iaq_board2.jpg - :keywords: IAQ Board - -IAQ (Indoor Air Quality) Board -============================== - -.. figure:: images/iaq_board2.jpg - :align: center - :width: 100.0% - -IAQ Board is a DIY device for measuring internal air quality running with esphome. It's quite small and is based on a custom PCB where part of the components are soldered and connected. - -Here is what it can measure: - -- **Temperature / Humidity / Pressure** -- **Air particles PM1, PM2.5, PM10** -- **Carbon Dioxide with NDIR sensor** -- **Air Quality Index by EPA, based on 24h average PM2.5 particles** -- **Ambient light** -- **Total VOC (volatile organic compound)** -- **equivalent CO2 (not very correct compared with the NDIR sensor, but it's provided by the VOC sensor)** - -On top of that: - -- **At least one OLED display to show the data (can have one more on the top of the MCU board)** -- **three RGB wide angle LEDs with auto brightness. LED1 indicates PM2.5, LED2 - Air quality index, LED3 - CO2.** -- **auto night dimming of the displays and LEDs (can be disabled)** -- **MIN/MAX values of Temperature, PM2.5 and CO2, and 24h average PM2.5 value.** -- **multi function button for selection of the data to show on the display** - -ESPHome Configuration ---------------------- -Full documentation (PCB, Schematic, esphome yaml config) is published here: `https://github.com/nkitanov/iaq_board `__ - -YAML configuration is about 700 lines and can be downloaded from here: `iaq_board.yaml `__ - -.. figure:: images/iaq_board1.jpg - :align: center - :width: 100.0% - -.. raw:: html - - - -See Also --------- - -- :doc:`/devices/nodemcu_esp8266` -- :doc:`/components/display/ssd1306` -- :doc:`/components/sensor/bme280` -- :doc:`/components/sensor/ee895` -- :doc:`/components/sensor/pmsx003` -- :doc:`/components/sensor/mhz19` -- :doc:`/components/sensor/sgp30` -- :doc:`/components/sensor/sgp4x` -- :doc:`/components/sensor/tsl2561` -- :doc:`/components/binary_sensor/gpio` -- :doc:`/components/sensor/template` -- :doc:`/components/light/neopixelbus` -- :doc:`/guides/automations` -- :doc:`/components/i2c` -- :doc:`/components/uart` -- :ghedit:`Edit` diff --git a/cookbook/ifan02.rst b/cookbook/ifan02.rst deleted file mode 100644 index cfa310a91..000000000 --- a/cookbook/ifan02.rst +++ /dev/null @@ -1,214 +0,0 @@ -Sonoff iFan02 -============= - -.. seo:: - :description: Instructions for using Sonoff ifan02 in ESPHome. - :keywords: Fan, Sonoff, ifan02 - :image: fan.svg - -Sonoff iFan02 is a driver for ceiling fans with lights. -By replacing the old driver with iFan02, your non-smart led ceiling fan will be converted to a smart ceiling fan. -For more information see `iFan02 `__ - -This configuration will expose a :doc:`/components/light/binary` and a :doc:`/components/fan/speed`. - -To get this working in ESPHome you first need to create a :doc:`/components/output/custom` to control the iFan02. - -Create an ifan02.h file: - -.. code-block:: c++ - - #include "esphome.h" - using namespace esphome; - - class IFan02Output : public Component, public FloatOutput { - public: - void write_state(float state) override { - if (state < 0.3) { - // OFF - digitalWrite(5, LOW); - digitalWrite(4, LOW); - digitalWrite(15, LOW); - } else if (state < 0.6) { - // low speed - digitalWrite(5, HIGH); - digitalWrite(4, LOW); - digitalWrite(15, LOW); - } else if (state < 0.9) { - // medium speed - digitalWrite(5, HIGH); - digitalWrite(4, HIGH); - digitalWrite(15, LOW); - } else { - // high speed - digitalWrite(5, HIGH); - digitalWrite(4, LOW); - digitalWrite(15, HIGH); - } - } - }; - -Then you need to set it up with yaml. - -.. code-block:: yaml - - esphome: - name: ifan02 - includes: - - ifan02.h - on_boot: - priority: 225 - # turn off the light as early as possible - then: - - light.turn_off: ifan02_light - - esp8266: - board: esp8285 - - wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - api: - - logger: - - ota: - - binary_sensor: - - platform: gpio - id: vbutton_light - pin: - number: GPIO0 - inverted: true - on_press: - then: - - light.toggle: ifan02_light - - - platform: gpio - id: vbutton_relay_1 - pin: - number: GPIO9 - inverted: true - on_press: - then: - - switch.toggle: fan_relay1 - - switch.turn_on: update_fan_speed - - - platform: gpio - id: vbutton_relay_2 - pin: - number: GPIO10 - inverted: true - on_press: - then: - - switch.toggle: fan_relay2 - - switch.turn_on: update_fan_speed - - - platform: gpio - id: vbutton_relay_3 - pin: - number: GPIO14 - inverted: true - on_press: - then: - - switch.toggle: fan_relay3 - - switch.turn_on: update_fan_speed - - output: - - platform: custom - type: float - outputs: - id: fanoutput - lambda: |- - auto ifan02_fan = new IFan02Output(); - App.register_component(ifan02_fan); - return {ifan02_fan}; - - - platform: gpio - pin: GPIO12 - id: light_output - - light: - - platform: binary - name: "iFan02 Light" - output: light_output - id: ifan02_light - - switch: - - platform: template - id: update_fan_speed - optimistic: true - turn_on_action: - then: - - delay: 200ms - - if: - condition: - and: - - switch.is_off: fan_relay1 - - switch.is_off: fan_relay2 - - switch.is_off: fan_relay3 - then: - - fan.turn_off: ifan02_fan - - if: - condition: - and: - - switch.is_on: fan_relay1 - - switch.is_off: fan_relay2 - - switch.is_off: fan_relay3 - then: - - fan.turn_on: - id: ifan02_fan - speed: 1 - - if: - condition: - and: - - switch.is_on: fan_relay1 - - switch.is_on: fan_relay2 - - switch.is_off: fan_relay3 - then: - - fan.turn_on: - id: ifan02_fan - speed: 2 - - if: - condition: - and: - - switch.is_on: fan_relay1 - - switch.is_off: fan_relay2 - - switch.is_on: fan_relay3 - then: - - fan.turn_on: - id: ifan02_fan - speed: 3 - - switch.turn_off: update_fan_speed - - - platform: gpio - pin: GPIO5 - id: fan_relay1 - - - platform: gpio - pin: GPIO4 - id: fan_relay2 - - - platform: gpio - pin: GPIO15 - id: fan_relay3 - - fan: - - platform: speed - output: fanoutput - id: ifan02_fan - speed_count: 3 - name: "iFan02 Fan" - -See Also --------- - -- :doc:`/components/light/index` -- :doc:`/components/light/binary` -- :doc:`/components/fan/index` -- :doc:`/components/fan/speed` -- :doc:`/components/output/index` -- :doc:`/components/output/custom` -- :doc:`/guides/automations` -- :ghedit:`Edit` diff --git a/cookbook/ilonda-wifi-smart-fish-feeder.rst b/cookbook/ilonda-wifi-smart-fish-feeder.rst deleted file mode 100644 index 55a5bbe9b..000000000 --- a/cookbook/ilonda-wifi-smart-fish-feeder.rst +++ /dev/null @@ -1,105 +0,0 @@ -Ilonda Wifi Smart Fish Feeder (L88) -=================================== - -Ilonda Wifi Smart Fish Feeder (L88) is a Tuya-based device sold by Amazon (not only under Ilonda, but also under other brand names). - -.. figure:: images/ilonda-wifi-smart-fish-feeder.jpg - :align: center - :width: 50.0% - -Originally intended to be used with its companion app, once flashed using `tuya-convert `__, ESPHome generated -firmware can be uploaded allowing you to control the Wifi Smart Fish Feeder via Home Assistant. - -Wifi Smart Fish Feeder Configuration ------------------------------------- - -Thanks to the amazing `Tasmota template `__, -managed to build a fully working esphome configuration. This assumes you have a secret.yaml with ssid and password keys. - -.. code-block:: yaml - - esphome: - name: wifi_smart_fish_feeder - - esp8266: - board: esp01_1m - - wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - logger: - - api: - - ota: - - # Binary Sensor to allow relay to be switched when physical button is pressed - binary_sensor: - - platform: gpio - id: button - pin: - number: GPIO4 - mode: - input: true - pullup: true - inverted: True - name: 'Switch feeder' - on_press: - - switch.turn_on: relay - - - platform: status - name: "Status" - - switch: - # Switch to turn feeder on for 3 seconds/off and turn on/off LED - - platform: gpio - name: 'Relay feeder' - id: relay - pin: GPIO14 - on_turn_on: - - light.turn_on: led - - delay: 3s - - switch.turn_off: relay - - light.turn_off: led - restore_mode: ALWAYS_OFF - - sensor: - # Feeder counter - - platform: pulse_meter - pin: GPIO12 - name: 'Counter/min' - unit_of_measurement: 'time(s)' - internal: true - total: - unit_of_measurement: 'time(s)' - name: 'Counter feeder' - - # To allow led to be controlled via GPIO - output: - - platform: esp8266_pwm - id: blue_led - pin: - number: GPIO5 - inverted: true - - # LED control - light: - - platform: monochromatic - output: blue_led - id: led - - -You can now add your Wifi Smart Fish Feeder to Home Assistant via the configurations page, look for 'ESPHome' under the Integrations option and click 'Configure'. - -See Also --------- - -- :doc:`/components/binary_sensor/gpio` -- :doc:`/components/switch/gpio` -- :doc:`/components/sensor/pulse_meter` -- :doc:`/components/output/esp8266_pwm` -- :doc:`/components/light/monochromatic` -- :doc:`/guides/automations` -- `Fish Feeder diagrams and pictures `__. -- :ghedit:`Edit` diff --git a/cookbook/images/air_gradient_diy_air_quality_sensor.jpg b/cookbook/images/air_gradient_diy_air_quality_sensor.jpg deleted file mode 100644 index 069aac132..000000000 Binary files a/cookbook/images/air_gradient_diy_air_quality_sensor.jpg and /dev/null differ diff --git a/cookbook/images/esw01-eu-pcb-bottom.jpg b/cookbook/images/esw01-eu-pcb-bottom.jpg deleted file mode 100644 index 106a64d20..000000000 Binary files a/cookbook/images/esw01-eu-pcb-bottom.jpg and /dev/null differ diff --git a/cookbook/images/esw01-eu-pcb-top.jpg b/cookbook/images/esw01-eu-pcb-top.jpg deleted file mode 100644 index 29e6d5f0c..000000000 Binary files a/cookbook/images/esw01-eu-pcb-top.jpg and /dev/null differ diff --git a/cookbook/images/esw01-eu.jpg b/cookbook/images/esw01-eu.jpg deleted file mode 100644 index 4adda23ac..000000000 Binary files a/cookbook/images/esw01-eu.jpg and /dev/null differ diff --git a/cookbook/images/h801-board-back.jpg b/cookbook/images/h801-board-back.jpg deleted file mode 100644 index b69e310b8..000000000 Binary files a/cookbook/images/h801-board-back.jpg and /dev/null differ diff --git a/cookbook/images/h801-board-front.jpg b/cookbook/images/h801-board-front.jpg deleted file mode 100644 index d8b1cda55..000000000 Binary files a/cookbook/images/h801-board-front.jpg and /dev/null differ diff --git a/cookbook/images/h801-pir_sensor.jpg b/cookbook/images/h801-pir_sensor.jpg deleted file mode 100644 index 8029a3748..000000000 Binary files a/cookbook/images/h801-pir_sensor.jpg and /dev/null differ diff --git a/cookbook/images/h801.jpg b/cookbook/images/h801.jpg deleted file mode 100644 index 979091f3f..000000000 Binary files a/cookbook/images/h801.jpg and /dev/null differ diff --git a/cookbook/images/iaq_board1.jpg b/cookbook/images/iaq_board1.jpg deleted file mode 100644 index e87781af0..000000000 Binary files a/cookbook/images/iaq_board1.jpg and /dev/null differ diff --git a/cookbook/images/iaq_board2.jpg b/cookbook/images/iaq_board2.jpg deleted file mode 100644 index 61cf79a5b..000000000 Binary files a/cookbook/images/iaq_board2.jpg and /dev/null differ diff --git a/cookbook/images/ilonda-wifi-smart-fish-feeder-cookbook.jpg b/cookbook/images/ilonda-wifi-smart-fish-feeder-cookbook.jpg deleted file mode 100644 index 843276960..000000000 Binary files a/cookbook/images/ilonda-wifi-smart-fish-feeder-cookbook.jpg and /dev/null differ diff --git a/cookbook/images/ilonda-wifi-smart-fish-feeder.jpg b/cookbook/images/ilonda-wifi-smart-fish-feeder.jpg deleted file mode 100644 index cc648d1c6..000000000 Binary files a/cookbook/images/ilonda-wifi-smart-fish-feeder.jpg and /dev/null differ diff --git a/cookbook/images/iwoole_rgbw_table_lamp.png b/cookbook/images/iwoole_rgbw_table_lamp.png deleted file mode 100644 index f560c9e9f..000000000 Binary files a/cookbook/images/iwoole_rgbw_table_lamp.png and /dev/null differ diff --git a/cookbook/images/iwoole_rgbw_table_lamp_connections_bottom.jpg b/cookbook/images/iwoole_rgbw_table_lamp_connections_bottom.jpg deleted file mode 100644 index e7294a681..000000000 Binary files a/cookbook/images/iwoole_rgbw_table_lamp_connections_bottom.jpg and /dev/null differ diff --git a/cookbook/images/iwoole_rgbw_table_lamp_connections_top.jpg b/cookbook/images/iwoole_rgbw_table_lamp_connections_top.jpg deleted file mode 100644 index 03cf17fe3..000000000 Binary files a/cookbook/images/iwoole_rgbw_table_lamp_connections_top.jpg and /dev/null differ diff --git a/cookbook/images/iwoole_rgbw_table_lamp_internal_1.jpg b/cookbook/images/iwoole_rgbw_table_lamp_internal_1.jpg deleted file mode 100644 index 4cf5296dc..000000000 Binary files a/cookbook/images/iwoole_rgbw_table_lamp_internal_1.jpg and /dev/null differ diff --git a/cookbook/images/iwoole_rgbw_table_lamp_internal_2.jpg b/cookbook/images/iwoole_rgbw_table_lamp_internal_2.jpg deleted file mode 100644 index 678332448..000000000 Binary files a/cookbook/images/iwoole_rgbw_table_lamp_internal_2.jpg and /dev/null differ diff --git a/cookbook/images/iwoole_rgbw_table_lamp_internal_3.jpg b/cookbook/images/iwoole_rgbw_table_lamp_internal_3.jpg deleted file mode 100644 index eb5e107dd..000000000 Binary files a/cookbook/images/iwoole_rgbw_table_lamp_internal_3.jpg and /dev/null differ diff --git a/cookbook/images/iwoole_rgbw_table_lamp_wires_bottom.jpg b/cookbook/images/iwoole_rgbw_table_lamp_wires_bottom.jpg deleted file mode 100644 index 4fcfe4857..000000000 Binary files a/cookbook/images/iwoole_rgbw_table_lamp_wires_bottom.jpg and /dev/null differ diff --git a/cookbook/images/iwoole_rgbw_table_lamp_wires_top.jpg b/cookbook/images/iwoole_rgbw_table_lamp_wires_top.jpg deleted file mode 100644 index 982c0ce70..000000000 Binary files a/cookbook/images/iwoole_rgbw_table_lamp_wires_top.jpg and /dev/null differ diff --git a/cookbook/images/radiationD-v1-1-cajoe_small.jpg b/cookbook/images/radiationD-v1-1-cajoe_small.jpg deleted file mode 100644 index ee6325bc7..000000000 Binary files a/cookbook/images/radiationD-v1-1-cajoe_small.jpg and /dev/null differ diff --git a/cookbook/images/teckin_sb50.jpg b/cookbook/images/teckin_sb50.jpg deleted file mode 100644 index 580b6c726..000000000 Binary files a/cookbook/images/teckin_sb50.jpg and /dev/null differ diff --git a/cookbook/images/temt6000-header.jpg b/cookbook/images/temt6000-header.jpg deleted file mode 100644 index bb3a83d35..000000000 Binary files a/cookbook/images/temt6000-header.jpg and /dev/null differ diff --git a/cookbook/images/temt6000-pins.jpg b/cookbook/images/temt6000-pins.jpg deleted file mode 100644 index 54c6a4a18..000000000 Binary files a/cookbook/images/temt6000-pins.jpg and /dev/null differ diff --git a/cookbook/images/tracer-an.jpg b/cookbook/images/tracer-an.jpg deleted file mode 100644 index 41f95959c..000000000 Binary files a/cookbook/images/tracer-an.jpg and /dev/null differ diff --git a/cookbook/images/tuya_rgbw.jpg b/cookbook/images/tuya_rgbw.jpg deleted file mode 100644 index f9c029489..000000000 Binary files a/cookbook/images/tuya_rgbw.jpg and /dev/null differ diff --git a/cookbook/iwoole_rgbw_table_lamp.rst b/cookbook/iwoole_rgbw_table_lamp.rst deleted file mode 100644 index bae99a994..000000000 --- a/cookbook/iwoole_rgbw_table_lamp.rst +++ /dev/null @@ -1,141 +0,0 @@ -IWOOLE Table Lamp -=================================== - -.. seo:: - :description: Instructions for flashing and configuring IWOOLE Table Lamps. - -The IWOOLE Table Lamp is a RGBW lamp normally configured using the Tuya Smart App. -It is available from various retailers online or directly from `iwoole.com `__. - -.. figure:: images/iwoole_rgbw_table_lamp.png - :align: center - :width: 50.0% - -1. Device overview -================== -.. note:: - - The following information relates to the desk model depicted above. A free-standing version and a desk version with a longer arm are available. They are likely to share the same internals and configuration, but I can not be certain. - -My device had no external markings at all. - -The device is a basic 4-channel PWM RGBW light in a simple elegant housing. -The LEDs are not individually addressable. -No other sensors, outputs or status LEDs are available. - -The MOSFETs for the different color channels are connected as follows: - -- GPIO04: White -- GPIO12: Green -- GPIO13: Blue -- GPIO14: Red - -1.1 Internal markings ----------------------- -.. figure:: images/iwoole_rgbw_table_lamp_internal_1.jpg - :align: center - :width: 40.0% - -.. figure:: images/iwoole_rgbw_table_lamp_internal_2.jpg - :align: center - :width: 40.0% - -.. figure:: images/iwoole_rgbw_table_lamp_internal_3.jpg - :align: center - :width: 40.0% - -2. ESPHome configuration -======================== -Since there is only one RGBW light to configure the .yaml file is fairly straightforward. -Alternatively, you could configure each channel as a separate light if desired. -I prefer to use the :ref:`color-interlock ` option along with the configuration below. - -2.1 Example configuration -------------------------- -.. code-block:: yaml - - esphome: - name: "IWOOLE Table Lamp" - #ESP type is ESP8266EX with 1MB flash - - esp8266: - board: esp01_1m - - # Insert wifi and api configuration here - - # Configuration for IWOOLE PWM light - light: - - platform: rgbw - name: "Light" - red: output_red - green: output_green - blue: output_blue - white: output_white - - output: - - platform: esp8266_pwm - id: output_red - pin: GPIO14 - - platform: esp8266_pwm - id: output_green - pin: GPIO12 - - platform: esp8266_pwm - id: output_blue - pin: GPIO13 - - platform: esp8266_pwm - id: output_white - pin: GPIO4 - -3. Flashing -=========== - -.. warning:: - - The circuit inside will be exposed to mains voltage. Do not connect your device to the mains when flashing. Flashing this device via a serial connection will involve precarious soldering and cutting through insulating heat-shrink tubing which will have to be replaced. - If you are uncomfortable with this, or are not confident around mains voltage, do not attempt to do this! Using the Tuya-convert method is preferred. - -1. Disconnect the device from mains voltage! -2. Open the device. The plastic and aluminum halves can be separated by twisting the plastic part counter-clockwise. If you're okay with a few scuffs you can also use a screwdriver (or a spudger) to separate the two halves. -3. Remove the two screws holding the round plate with the LEDs. It is connected to the main PCB with a little cable. Make note of the orientation of this connection to ensure you reconnect it correctly later. -4. Carefully remove the heat-shrink tubing around the two main PCBs. -5. Like any ESP device, to flash this chip using serial you'll need 3V3, GND, RX, TX and GPIO0 - -.. figure:: images/iwoole_rgbw_table_lamp_connections_top.jpg - :align: left - :width: 60.0% - -There are pads available for 3V3 and GPIO0 on the back. I have tried to find easier solder points on the front, marked in the image above. -Be aware that the pin labeled VCC does not carry 3V3, but 24V DC. If, for any reason, you wanted to connect any other sensor or component, the exposed pin for GPIO5 can be used, in addition to RX (GPIO3) and TX (GPIO1). - -.. figure:: images/iwoole_rgbw_table_lamp_connections_bottom.jpg - :align: left - :width: 60.0% - -I have made the following connections, I used the pad for GPIO0 because I did not know of the other connection point yet. - -.. figure:: images/iwoole_rgbw_table_lamp_wires_top.jpg - :align: left - :width: 60.0% - -.. figure:: images/iwoole_rgbw_table_lamp_wires_bottom.jpg - :align: left - :width: 60.0% - -6. Flash the chip as you would with any other, using `ESPHome-Flasher `__ or any other tool of your choosing. While this is not meant as a tutorial on flashing ESP chips, some general hints: - -- Always double-check your connections, and don't change any when the ESP is powered. I fried one of these mood lights this way. -- Ensure GPIO0 is connected to ground to get the device into programming mode, but also don't forget to disconnect this when you expect the device to start in normal mode. -- When working with a breadboard, an FTDI adapter and jumper wires, it is very easy for something to become disconnected. Try to use as few wires as possible. - -7. Re-apply some heat-shrink tubing or cover the PCBs in electrical tape. Make sure none of the traces or solder joints are exposed anymore. Re-connect the LEDs (see cable orientation in one of the images above). - -8. Screw down the plate with LEDs and close the device. - -See Also -======== - -- :doc:`/components/light/index` -- :doc:`/components/light/rgbw` -- :doc:`/components/output/index` -- :doc:`/components/output/esp8266_pwm` -- :ghedit:`Edit` diff --git a/cookbook/pir.rst b/cookbook/pir.rst index 2e81d6fe0..094560047 100644 --- a/cookbook/pir.rst +++ b/cookbook/pir.rst @@ -62,5 +62,4 @@ See Also - `Awesome article explaining how PIR Sensors work `__. - :doc:`/components/binary_sensor/gpio` -- :doc:`bruh` - :ghedit:`Edit` diff --git a/cookbook/relay.rst b/cookbook/relay.rst index bc841f7e6..e1e15c27c 100644 --- a/cookbook/relay.rst +++ b/cookbook/relay.rst @@ -46,6 +46,5 @@ See Also - :doc:`/components/switch/gpio` - :doc:`/components/output/gpio` -- :doc:`/cookbook/garage-door` - `How do relays work `__. - :ghedit:`Edit` diff --git a/cookbook/teckin_sb50.rst b/cookbook/teckin_sb50.rst deleted file mode 100644 index edb1369a4..000000000 --- a/cookbook/teckin_sb50.rst +++ /dev/null @@ -1,88 +0,0 @@ -TECKIN SB50 LED Bulb -==================== - -.. seo:: - :description: ESPHome configuration for Teckin SB50 LED Bulb. - :image: teckin_sb50.jpg - :keywords: Teckin SB50 - -.. figure:: images/teckin_sb50.jpg - :align: center - :width: 50.0% - -.. warning:: - - It is not currently possible to flash these bulbs with ``tuya-convert`` due to shipping with an updated/patched firmware. - Please check `this issue `__ for details and progress on a workaround. - -The Teckin SB50 Bulb's are a great option for lighting that could previously be flashed with tuya-convert. More details can be found at tuya-convert `github page `__. -Below is the ESPHome configuration file that will get you up and running. This assumes you have a ``secret.yaml`` with ssid, password, api_password and ota_password keys. - -.. code-block:: yaml - - substitutions: - devicename: - - esphome: - name: $devicename - - esp8266: - board: esp01_1m - - wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - # Enable logging to ESPHome - logger: - # Disable logging to serial - baud_rate: 0 - - # Enable Home Assistant API - api: - - # Setup OTA - ota: - - # Define output pins - output: - - platform: esp8266_pwm - id: output_red - pin: GPIO4 - - platform: esp8266_pwm - id: output_green - pin: GPIO12 - - platform: esp8266_pwm - id: output_blue - pin: GPIO14 - - platform: esp8266_pwm - id: output_warm_white - pin: GPIO13 - - platform: esp8266_pwm - id: output_cold_white - pin: GPIO5 - - # Define a light entity - light: - - platform: rgbww - name: $devicename - id: $devicename - red: output_red - green: output_green - blue: output_blue - warm_white: output_warm_white - cold_white: output_cold_white - cold_white_color_temperature: 6200 K - warm_white_color_temperature: 2800 K - color_interlock: true # avoids simultaneous RGB and W/W - - -See Also --------- - -- :doc:`/devices/nodemcu_esp8266` -- :doc:`/cookbook/mirabella-genio-bulb` -- :doc:`/components/light/rgb` -- :doc:`/components/output/esp8266_pwm` -- :doc:`/components/binary_sensor/gpio` -- :ghedit:`Edit` diff --git a/cookbook/temt6000.rst b/cookbook/temt6000.rst deleted file mode 100644 index 2e3ec01d3..000000000 --- a/cookbook/temt6000.rst +++ /dev/null @@ -1,74 +0,0 @@ -TEMT6000 -======== - -.. seo:: - :description: Instructions for setting up TEMT6000 ambient light sensors in ESPHome using the ADC sensor component. - :image: temt6000.jpg - :keywords: TEMT6000 - -The TEMT6000 is a simple and cheap ambient light sensor. The sensor itself -changes its resistance based on how much light hits the sensor. In order -for us to read this resistance the breakout boards you can buy these chips on -often have a small constant value resistor and three pins: ``GND``, ``VCC`` and -``SIG``. Connect ``VCC`` to ``3.3V``, ``GND`` to ``GND`` and ``SIG`` to any -available :doc:`analog pin `. - -.. figure:: images/temt6000-header.jpg - :align: center - :width: 75.0% - -To get the brightness the sensor measures, we then simply have to measure the voltage -on the ``SIG`` (also called ``OUT``) pin using the :doc:`/components/sensor/adc` -and convert those voltage measurements to illuminance values in lux using a formula: - -.. code-block:: yaml - - sensor: - - platform: adc - pin: A0 - name: "TEMT6000 Illuminance" - device_class: illuminance - unit_of_measurement: lx - filters: - - lambda: |- - return (x / 10000.0) * 2000000.0; - -.. figure:: images/temt6000-pins.jpg - :align: center - :width: 75.0% - - Pins on the TEMT6000. Connect ``OUT`` to an ADC pin, ``GND`` to ``GND``, and ``VCC`` - to ``3.3V`` - -Formula Explanation: --------------------- - -To get the illuminance in lux, we first need to convert the measured voltage to the -current flowing across the TEMT6000 sensor. This current is also equal to the current -flowing across the 10kΩ resistor in the voltage divider circuit, which is -``I = adc_value/10000kΩ``. - -The `datasheet for the TEMT6000 `__ -specifies a proportional correlation between current and illuminance: Every 2 µA of current -correlates to 1 lx in the illuminance. - -.. note:: - - The default voltage range of the ADC for the ESP8266 and ESP32 are from 0 to 1.0V. - So you won't be able to measure any value above 200 lx using the default setup. - - For the ESP32, you have the option of setting a :ref:`Voltage Attenuation ` - (note that the formula doesn't need to be adjusted if you set an attenuation, as the value ``x`` - is automatically converted to volts). - - For the ESP8266, you unfortunately need to tinker with the hardware a bit to decrease - the voltage a bit. So one option would be to create another voltage divider on the ``SIG`` pin - to divide the analog voltage by a constant value. - -See Also --------- - -- :doc:`/components/sensor/adc` -- `TEMT6000 datasheet `__ -- :doc:`bruh` -- :ghedit:`Edit` diff --git a/cookbook/tracer-an.rst b/cookbook/tracer-an.rst deleted file mode 100644 index e4111ab47..000000000 --- a/cookbook/tracer-an.rst +++ /dev/null @@ -1,1286 +0,0 @@ -EPEVER® MPPT Solar Charge Controller Tracer-AN Series -===================================================== -.. seo:: - :description: ESPHome configuration for EPEVER® MPPT Solar Charge Controller Tracer-AN Series - :image: tracer-an.jpg - :keywords: EPEVER Tracer - -.. figure:: images/tracer-an.jpg - :align: center - :width: 50.0% - -.. warning:: - - Enabling all modbus registers will probably cause a stack overflow in main - - -Tested with Tracer-AN Series 10A/20A/30A/40A and XTRA Series 10A/20A/30A/40A. -Probably works for other EPEver MPPT controllers as well. - - -Below is the ESPHome configuration file that will get you up and running. This assumes you have a ``secret.yaml`` with ssid, password, api_password and ota_password keys. - -.. code-block:: yaml - - substitutions: - updates: 30s - name: solarstation-x - - esphome: - name: ${name} - platformio_options: - ## larger stack size required with all registers enable_load_test - ## reduce registers or wait for integration of 2.0.0 arduinoespressif32 - ## not yet working needs 2.0 - build_flags: - - -DCONFIG_ARDUINO_LOOP_STACK_SIZE=32768 - - 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 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 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 battery_settings3 = { - 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, 0x900A, battery_settings2.size() , - // battery_settings2); - - esphome::modbus_controller::ModbusCommandItem set_battery3_command = - esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller, 0x906B, battery_settings3.size(), - battery_settings3); - delay(200) ; - controller->queue_command(set_battery1_command); - delay(200) ; - // controller->queue_command(set_battery2_command); - // delay(200) ; - controller->queue_command(set_battery3_command); - ESP_LOGI("ModbusLambda", "EPSOLAR Battery set"); - - esp32: - board: pico32 - framework: - type: arduino - version: latest - - wifi: - ssid: !secret wifi_sid - password: !secret wifi_password - - time: - - platform: sntp - id: sntp_time - timezone: "CET-1CEST,M3.5.0,M10.5.0/3" - servers: "de.pool.ntp.org" - - # Enable logging - logger: - level: INFO - - # Enable Home Assistant API - api: - reboot_timeout: 0s - - ota: - - 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: 200ms - setup_priority: -10 - update_interval: ${updates} - - packages: - tracer-rated-datum: !include tracer-rated-datum.yaml - tracer-real-time: !include tracer-real-time.yaml - tracer-stats: !include tracer-stats.yaml - #tracer-settings: !include tracer-settings.yaml - - sensor: - - platform: template - accuracy_decimals: 0 - name: "Generated Charge today" - id: generated_charge_today - unit_of_measurement: "Ah" - - - platform: wifi_signal - name: "WiFi Signal" - update_interval: ${updates} - - binary_sensor: - - platform: modbus_controller - modbus_controller_id: epever - id: charging_input_volt_failure - name: "Charging Input Volt Failure" - register_type: read - address: 0x3201 - bitmask: 0xC000 - - switch: - - platform: modbus_controller - modbus_controller_id: epever - id: manual_control_load - register_type: coil - address: 2 - name: "manual control the load" - bitmask: 1 - - - platform: modbus_controller - modbus_controller_id: epever - id: default_control_the_load - register_type: coil - address: 3 - name: "default control the load" - bitmask: 1 - - - platform: modbus_controller - modbus_controller_id: epever - id: enable_load_test - register_type: coil - address: 5 - name: "enable load test mode" - bitmask: 1 - - - platform: modbus_controller - modbus_controller_id: epever - id: force_load - register_type: coil - address: 6 - name: "Force Load on/off" - bitmask: 1 - - # - platform: modbus_controller - # modbus_controller_id: epever - # id: clear_energy_stats - # register_type: coil - # address: 0x14 - # name: "Clear generating electricity statistic" - # bitmask: 1 - - # - platform: modbus_controller - # modbus_controller_id: epever - # id: reset_to_fabric_default - # name: "Reset to Factory Default" - # register_type: coil - # address: 0x15 - # bitmask: 1 - - text_sensor: - - platform: modbus_controller - modbus_controller_id: epever - name: "rtc_clock" - id: rtc_clock - internal: true - register_type: holding - address: 0x9013 - register_count: 3 - raw_encode: HEXBYTES - response_size: 6 - # /* - # E20 Real time clock 9013 D7-0 Sec, D15-8 Min - # E21 Real time clock 9014 D7-0 Hour, D15-8 Day - # E22 Real time clock 9015 D7-0 Month, D15-8 Year - # */ - 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 % 100; - // correct time if needed (ignore seconds) - if (d != day || month_ != month || y != year || h != hour || m != minutes) { - // create the payload - std::vector 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(epever, 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); - } - 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); - - - platform: template - name: "RTC Time Sensor" - id: template_rtc - - - platform: modbus_controller - modbus_controller_id: epever - name: "rtc clock test 2" - id: rtc_clock_test2 - internal: true - register_type: holding - address: 0x9013 - register_count: 3 - raw_encode: HEXBYTES - response_size: 6 - - web_server: - port: 80 - -The definitions for most sensors is included using Packages - -Rated Datum registers - -tracer-rated-datum.yaml - -.. code-block:: yaml - - sensor: - - platform: modbus_controller - modbus_controller_id: epever - id: array_rated_voltage - name: "array_rated_voltage" - address: 0x3000 - skip_updates: 60 - 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 - register_count: 2 - 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 - - - platform: modbus_controller - modbus_controller_id: epever - id: rated_current_of_load - name: "rated_current_of_load" - address: 0x300E - skip_updates: 60 - unit_of_measurement: "A" - register_type: read - value_type: U_WORD - accuracy_decimals: 1 - filters: - - multiply: 0.01 - - -Real TimeDatum registers -tracer-real-time.yaml - -.. code-block:: yaml - - sensor: - - platform: modbus_controller - modbus_controller_id: epever - 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: epever - 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: epever - id: pv_input_power - name: "PV array input power" - address: 0x3102 - unit_of_measurement: "W" ## for any other unit the value is returned in minutes - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 1 - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: charging_voltage - name: "Charging voltage" - address: 0x3104 - 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: charging_current - name: "Charging current" - address: 0x3105 - 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: charging_power - name: "Charging power" - address: 0x3106 - 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: load_voltage - name: "Load voltage" - address: 0x310C - 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: load_current - name: "Load Current" - address: 0x310D - 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: load_power - name: "Load power" - address: 0x310E - 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_temperature - name: "Battery temperature" - address: 0x3110 - unit_of_measurement: °C - register_type: read - value_type: S_WORD - accuracy_decimals: 1 - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: device_temperature - name: "Device temperature" - address: 0x3111 - unit_of_measurement: °C - register_type: read - value_type: S_WORD - accuracy_decimals: 1 - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: power_components_temperature - name: "Power components temperature" - address: 0x3112 - unit_of_measurement: °C - register_type: read - value_type: S_WORD - accuracy_decimals: 1 - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: battery_soc - name: "Battery SOC" - address: 0x311A - unit_of_measurement: "%" - register_type: read - value_type: U_WORD - accuracy_decimals: 0 - - - platform: modbus_controller - modbus_controller_id: epever - id: remote_battery_temperature - name: "Remote battery temperature" - address: 0x311B - unit_of_measurement: °C - register_type: read - value_type: S_WORD - accuracy_decimals: 1 - filters: - - multiply: 0.01 - - platform: modbus_controller - modbus_controller_id: epever - id: battery_volt_settings - name: "Remote real voltage" - address: 0x311D - unit_of_measurement: "°C" - register_type: read - value_type: S_WORD - accuracy_decimals: 1 - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: Battery_status_volt - name: "Battery status voltage" - address: 0x3200 - register_type: read - value_type: U_WORD - bitmask: 7 #(Bits 0-3) - accuracy_decimals: 0 - - - platform: modbus_controller - modbus_controller_id: epever - id: Battery_status_temp - name: "Battery status temeratur" - address: 0x3200 - register_type: read - value_type: U_WORD - bitmask: 0x38 #(Bits 4-7) - accuracy_decimals: 0 - - - platform: modbus_controller - modbus_controller_id: epever - id: Charger_status - name: "Charger status" - address: 0x3201 - register_type: read - value_type: U_WORD - accuracy_decimals: 0 - - Statistic registers - tracer-stats.yaml - - .. code-block:: yaml - - sensor: - - platform: modbus_controller - modbus_controller_id: epever - id: max_pv_voltage_today - name: "Maximum PV voltage today" - address: 0x3300 - register_type: read - value_type: U_WORD - accuracy_decimals: 1 - unit_of_measurement: "V" - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: min_pv_voltage_today - name: "Minimum PV voltage today" - address: 0x3301 - register_type: read - value_type: U_WORD - accuracy_decimals: 1 - unit_of_measurement: "V" - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: max_battery_voltage_today - name: "Maximum battery voltage today" - address: 0x3302 - register_type: read - value_type: U_WORD - accuracy_decimals: 1 - unit_of_measurement: "V" - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: min_battery_today - name: "Minimum battery voltage today" - address: 0x3303 - register_type: read - value_type: U_WORD - accuracy_decimals: 1 - unit_of_measurement: "V" - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: consumed_energy_today - name: "Consumed energy today" - address: 0x3304 - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 0 - unit_of_measurement: "Wh" - filters: - - multiply: 10.0 - - - platform: modbus_controller - modbus_controller_id: epever - id: consumed_energy_month - name: "Consumed Energy Month" - address: 0x3306 - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 0 - unit_of_measurement: "Wh" - filters: - - multiply: 10.0 - - - platform: modbus_controller - modbus_controller_id: epever - id: consumed_energy_year - name: "Consumed energy year" - address: 0x3308 - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 1 - unit_of_measurement: "kWh" - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: consumed_energy_total - name: "Consumed energy total" - address: 0x330A - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 1 - unit_of_measurement: "kWh" - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: generated_energy_today - name: "Generated energy today" - address: 0x330C - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 0 - unit_of_measurement: "Wh" - on_value: - then: - - sensor.template.publish: - id: generated_charge_today - state: !lambda "return x/12.0;" - filters: - - multiply: 10.0 - - - platform: modbus_controller - modbus_controller_id: epever - id: generated_energy_month - name: "Generated energy month" - address: 0x330E - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 0 - unit_of_measurement: "Wh" - filters: - - multiply: 10.0 - - - platform: modbus_controller - modbus_controller_id: epever - id: generated_energy_year - name: "Generated energy year" - address: 0x3310 - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 1 - unit_of_measurement: "kWh" - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: generated_energy_total - name: "Generated energy total" - address: 0x3312 - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 1 - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: co2_reduction - name: "CO2 reduction" - address: 0x3314 - register_type: read - value_type: U_DWORD_R - accuracy_decimals: 1 - unit_of_measurement: "kg" - filters: - - multiply: 10.0 - - - platform: modbus_controller - modbus_controller_id: epever - id: battery_voltage - name: "Battery voltage" - address: 0x331A - register_type: read - value_type: U_WORD - accuracy_decimals: 1 - unit_of_measurement: "V" - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: battery_current - name: "Battery current" - address: 0x331B - register_type: read - value_type: S_DWORD_R - register_count: 2 - accuracy_decimals: 2 - unit_of_measurement: "A" - filters: - - multiply: 0.01 - - -Setting registers (commented out to save stack space) -tracer-settings.yaml - -.. code-block:: yaml - - sensor: - - platform: modbus_controller - modbus_controller_id: epever - id: battery_type - address: 0x9000 - name: "Battery Type" - register_type: holding - value_type: U_WORD - skip_updates: 50 - - - platform: modbus_controller - modbus_controller_id: epever - id: battery_capacity - address: 0x9001 - name: "Battery Capacity" - register_type: holding - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: temperature_compensation_coefficient - address: 0x9002 - name: "Temperature compensation coefficient" - unit_of_measurement: "mV/°C/2V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: high_voltage_disconnect - address: 0x9003 - name: "High Voltage disconnect" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: charging_limit_voltage - address: 0x9004 - name: "Charging limit voltage" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: over_voltage_reconnect - address: 0x9005 - name: "Over voltage reconnect" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: equalization_voltage - address: 0x9006 - name: "Equalization voltage" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: boost_voltage - address: 0x9007 - name: "Boost voltage" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: float_voltage - address: 0x9008 - name: "Float voltage" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: boost_reconnect_voltage - address: 0x9009 - name: "Boost reconnect voltage" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: low_voltage_reconnect - address: 0x900A - name: "Low voltage reconnect" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: under_voltage_recover - address: 0x900B - name: "Under voltage recover" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: under_voltage_warning - address: 0x900C - name: "Under voltage warning" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: low_voltage_disconnect - address: 0x900D - name: "Low voltage disconnect" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: discharging_limit_voltage - address: 0x900E - name: "Discharging limit voltage" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: battery_temperature_warning_upper_limit - address: 0x9017 - name: "Battery temperature warning upper limit" - unit_of_measurement: "°C" - register_type: holding - value_type: S_WORD - # new range add 'skip_updates' again - skip_updates: 50 - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: battery_temperature_warning_lower_limit - address: 0x9018 - name: "Battery temperature warning lower limit" - unit_of_measurement: "°C" - register_type: holding - value_type: S_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: controller_inner_temperature_upper_limit - address: 0x9019 - name: "Controller inner temperature upper limit" - unit_of_measurement: "°C" - register_type: holding - value_type: S_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: controller_inner_temperature_upper_limit_recover - address: 0x901A - name: "Controller inner temperature upper limit recover" - unit_of_measurement: "°C" - register_type: holding - value_type: S_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: power_component_temperature_upper_limit - address: 0x901B - name: "Power component temperature upper limit" - unit_of_measurement: "°C" - register_type: holding - value_type: S_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: power_component_temperature_upper_limit_recover - address: 0x901C - name: "Power component temperature upper limit recover" - unit_of_measurement: "°C" - register_type: holding - value_type: S_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: line_impedance - address: 0x901D - name: "Line Impedance" - unit_of_measurement: "mOhm" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: dttv - address: 0x901E - name: "Day Time Threshold Voltage" - unit_of_measurement: "V" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: light_signal_startup_delay_time - address: 0x901F - name: "Light signal startup delay time" - unit_of_measurement: "mins" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: nttv - address: 0x9020 - name: "Light Time Threshold Voltage" - unit_of_measurement: "mins" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: light_signal_close_delay_time - address: 0x9021 - name: "Light signal close delay time" - unit_of_measurement: "mins" - register_type: holding - value_type: U_WORD - filters: - - multiply: 0.01 - - - platform: modbus_controller - modbus_controller_id: epever - id: - load_controlling_modes - # 0000H Manual Control - # 0001H Light ON/OFF - # 0002H Light ON+ Timer/ - # 0003H Time Control - address: 0x903D - name: "Load controlling modes" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - skip_updates: 50 - - - platform: modbus_controller - modbus_controller_id: epever - id: working_time_length_1 - # The length of load output timer1, - # D15-D8,hour, D7-D0, minute - address: 0x903E - name: "Working_time length 1" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: working_time_length_2 - address: 0x903F - name: "Working_time length 1" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_on_timing_1_seconds - address: 0x9042 - name: "Turn on timing 1 seconds" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - skip_updates: 50 - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_on_timing_1_minutes - address: 0x9043 - name: "Turn on timing 1 minutes" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_on_timing_1_hours - address: 0x9044 - name: "Turn on timing 1 hours" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_off_timing_1_seconds - address: 0x9045 - name: "Turn off timing 1 seconds" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_off_timing_1_minutes - address: 0x9046 - name: "Turn off timing 1 minutes" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_off_timing_1_hours - address: 0x9047 - name: "Turn off timing 1 hours" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_on_timing_2_seconds - address: 0x9048 - name: "Turn on timing 2 seconds" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_on_timing_2_minutes - address: 0x9049 - name: "Turn on timing 2 minutes" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_on_timing_2_hours - address: 0x904A - name: "Turn on timing 2 hours" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_off_timing_2_seconds - address: 0x904B - name: "Turn off timing 2 seconds" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_off_timing_2_minutes - address: 0x904C - name: "Turn off timing 2 minutes" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: turn_off_timing_2_hours - address: 0x904D - name: "Turn off timing 2 hours" - register_type: holding - accuracy_decimals: 0 - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: backlight_time - address: 0x9063 - name: "Backlight time" - register_type: holding - accuracy_decimals: 0 - unit_of_measurement: "s" - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: length_of_night_minutes - address: 0x9065 - internal: true - bitmask: 0xFF - unit_of_measurement: "m" - name: "Length of night-mins" - register_type: holding - value_type: U_WORD - - - platform: modbus_controller - modbus_controller_id: epever - id: length_of_night - address: 0x9065 - bitmask: 0xFF00 - unit_of_measurement: "m" - name: "Length of night" - register_type: holding - value_type: U_WORD - skip_updates: 50 - filters: - - lambda: return id(length_of_night_minutes).state + ( 60 * x); - - -See Also --------- - -- :doc:`/components/modbus_controller` -- `EPEVER Tracer Modbus Registers `__ -- :ghedit:`Edit` diff --git a/cookbook/tuya_rgbw.rst b/cookbook/tuya_rgbw.rst deleted file mode 100644 index 08d34b8b3..000000000 --- a/cookbook/tuya_rgbw.rst +++ /dev/null @@ -1,88 +0,0 @@ -Tuya RGBW LED controller -======================== - -The Tuya RGBW controller is inexpensive, available on ebay, and can be OTA flashed using `tuya-convert `__, after which it can be OTA flashed via the ESPHome web interface (NOTE: a port must be explicitly set if using a Home Assistant add-on for this, and you need to connect directly to that port instead of using the proxied port via Home Assistant). - -.. figure:: images/tuya_rgbw.jpg - :align: center - :width: 80.0% - -The configuration below shows an example that can be compiled to a binary firmware file that works correctly for this device, and that cycles through three different brightnesses and an off state based on the number of button presses. The device can also be controlled via Home Assistant, of course, setting specific RGBW combinations and brightness levels. - -.. code-block:: yaml - - # Example configuration entry - output: - - platform: esp8266_pwm - id: output_red - pin: GPIO14 - - platform: esp8266_pwm - id: output_green - pin: GPIO5 - - platform: esp8266_pwm - id: output_blue - pin: GPIO12 - - platform: esp8266_pwm - id: output_white - pin: GPIO15 - - globals: - - id: action_state - type: int - restore_value: no - initial_value: '0' - - binary_sensor: - - platform: gpio - pin: GPIO13 - name: "RGBW Controller Button" - filters: - - invert: - - delayed_on_off: 20ms - on_press: - then: - - lambda: id(action_state) = (id(action_state) + 1) % 4; - - if: - condition: - lambda: 'return id(action_state) == 0;' - then: - - light.turn_off: rgbw_lightstrip1 - - if: - condition: - lambda: 'return id(action_state) == 1;' - then: - - light.turn_on: - id: rgbw_lightstrip1 - brightness: 60% - - if: - condition: - lambda: 'return id(action_state) == 2;' - then: - - light.turn_on: - id: rgbw_lightstrip1 - brightness: 40% - - if: - condition: - lambda: 'return id(action_state) == 3;' - then: - - light.turn_on: - id: rgbw_lightstrip1 - brightness: 15% - light: - - platform: rgbw - name: "rgbw_strip_01" - id: rgbw_lightstrip1 - red: output_red - green: output_green - blue: output_blue - white: output_white - - # Ensure the light turns on by default if the physical switch is actuated. - restore_mode: ALWAYS_OFF - -See Also --------- - -- :doc:`/components/light/rgbw` -- :doc:`/components/output/esp8266_pwm` -- :ghedit:`Edit` diff --git a/index.rst b/index.rst index 8498425fb..c4e742b38 100644 --- a/index.rst +++ b/index.rst @@ -399,8 +399,8 @@ Weight Looking for a sensor that outputs its values as an analog voltage? Have a look at the -:doc:`ADC Sensor ` together with a formula like in the :doc:`TEMT6000 -example `. +:doc:`ADC Sensor ` together with a formula like in the `TEMT6000 +configuration `__. Binary Sensor Components @@ -783,41 +783,29 @@ Cookbook .. imgtable:: - Arduino Port Extender, cookbook/arduino_port_extender, arduino_logo.svg - Endstop Cover, cookbook/endstop-cover, window-open.svg - PIR Sensor, cookbook/pir, pir.jpg - Relay, cookbook/relay, relay.jpg - BRUH Multisensor, cookbook/bruh, bruh.png - TEMT6000, cookbook/temt6000, temt6000.jpg + Generic PIR Sensor, cookbook/pir, pir.jpg + Generic Relay, cookbook/relay, relay.jpg + Garage Door, cookbook/garage-door, window-open.svg Non-Invasive Power Meter, cookbook/power_meter, power_meter.jpg Dual Relay Motor Cover, cookbook/dual-r2-cover, sonoff_dual_r2.jpg BME280 Environment, cookbook/bme280_environment, bme280.jpg Sonoff Fishpond Pump, cookbook/sonoff-fishpond-pump, cookbook-sonoff-fishpond-pump.jpg - H801 LED Controller, cookbook/h801, h801.jpg Time & Temperature on OLED Display, cookbook/display_time_temp_oled, display_time_temp_oled_2.jpg Mirabella Genio Bulb, cookbook/mirabella-genio-bulb, cookbook-mirabella-genio-b22-rgbw.jpg - Garage Door, cookbook/garage-door, window-open.svg Brilliant / Mirabella Genio Smart Plugs, cookbook/brilliant-mirabella-genio-smart-plugs, cookbook-brilliant-mirabella-genio-smart-plugs.jpg - Etekcity Voltson (ESW01-EU) , cookbook/esw01-eu, esw01-eu.jpg - Sonoff iFan02, cookbook/ifan02, fan.svg Zemismart RGBW Downlights, cookbook/zemismart-rgbw-downlights, cookbook-zemismart-rgbw-downlight.jpg - Teckin SB50, cookbook/teckin_sb50, teckin_sb50.jpg Sonoff light switch options, cookbook/sonoff-light-switch, light_switch.png ESP32 Water Leak Detector, cookbook/leak-detector-m5stickC, leak-detector-m5stickC_main_index.jpg - ESP32 BLE iTag Button, cookbook/ble_itag, esp32_ble_itag.jpg - IAQ (Indoor Air Quality) Board, cookbook/iaq_board, iaq_board2.jpg - TUYA Smart Life RGBW Controller, cookbook/tuya_rgbw, tuya_rgbw.jpg + Arduino Port Extender, cookbook/arduino_port_extender, arduino_logo.svg + Endstop Cover, cookbook/endstop-cover, window-open.svg 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 - AirGradient DIY Air Quality Sensor, cookbook/air_gradient_diy_air_quality_sensor, air_gradient_diy_air_quality_sensor.jpg - Geiger Counter, cookbook/geiger-counter, radiationD-v1-1-cajoe_small.jpg EHMTX a matrix status/text display, cookbook/ehmtx, ehmtx.jpg Do you have other awesome automations or cool setups? Please feel free to add them to the documentation for others to copy. See :doc:`Contributing `. +If you'd like to share configurations for specific devices, please contribute to our `ESPHome Devices `__ database. + .. toctree:: :hidden: