mirror of https://github.com/esphome/esphome.git
Merge branch 'dev' into smartconfig
This commit is contained in:
commit
32e378be36
|
@ -1,7 +1,6 @@
|
|||
import esphome.codegen as cg
|
||||
import esphome.config_validation as cv
|
||||
from esphome import automation
|
||||
from esphome import core
|
||||
from esphome.automation import maybe_simple_id
|
||||
from esphome.const import CONF_ID
|
||||
from esphome.components import uart
|
||||
|
@ -101,7 +100,7 @@ def range_segment_list(input):
|
|||
|
||||
largest_distance = -1
|
||||
for distance in input:
|
||||
if isinstance(distance, core.Lambda):
|
||||
if isinstance(distance, cv.Lambda):
|
||||
continue
|
||||
m = cv.distance(distance)
|
||||
if m > 9:
|
||||
|
@ -128,14 +127,14 @@ MMWAVE_SETTINGS_SCHEMA = cv.Schema(
|
|||
cv.Optional(CONF_OUTPUT_LATENCY): {
|
||||
cv.Required(CONF_DELAY_AFTER_DETECT): cv.templatable(
|
||||
cv.All(
|
||||
cv.positive_time_period,
|
||||
cv.Range(max=core.TimePeriod(seconds=1638.375)),
|
||||
cv.positive_time_period_milliseconds,
|
||||
cv.Range(max=cv.TimePeriod(seconds=1638.375)),
|
||||
)
|
||||
),
|
||||
cv.Required(CONF_DELAY_AFTER_DISAPPEAR): cv.templatable(
|
||||
cv.All(
|
||||
cv.positive_time_period,
|
||||
cv.Range(max=core.TimePeriod(seconds=1638.375)),
|
||||
cv.positive_time_period_milliseconds,
|
||||
cv.Range(max=cv.TimePeriod(seconds=1638.375)),
|
||||
)
|
||||
),
|
||||
},
|
||||
|
|
|
@ -50,7 +50,7 @@ class DfrobotSen0395SettingsAction : public Action<Ts...>, public Parented<Dfrob
|
|||
float detect = this->delay_after_detect_.value(x...);
|
||||
float disappear = this->delay_after_disappear_.value(x...);
|
||||
if (detect >= 0 && disappear >= 0) {
|
||||
this->parent_->enqueue(make_unique<OutputLatencyCommand>(detect, disappear));
|
||||
this->parent_->enqueue(make_unique<SetLatencyCommand>(detect, disappear));
|
||||
}
|
||||
}
|
||||
if (this->start_after_power_on_.has_value()) {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "commands.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#include "esphome/core/log.h"
|
||||
|
||||
#include "dfrobot_sen0395.h"
|
||||
|
@ -194,32 +196,22 @@ uint8_t DetRangeCfgCommand::on_message(std::string &message) {
|
|||
return 0; // Command not done yet.
|
||||
}
|
||||
|
||||
OutputLatencyCommand::OutputLatencyCommand(float delay_after_detection, float delay_after_disappear) {
|
||||
delay_after_detection = round(delay_after_detection / 0.025) * 0.025;
|
||||
delay_after_disappear = round(delay_after_disappear / 0.025) * 0.025;
|
||||
if (delay_after_detection < 0)
|
||||
delay_after_detection = 0;
|
||||
if (delay_after_detection > 1638.375)
|
||||
delay_after_detection = 1638.375;
|
||||
if (delay_after_disappear < 0)
|
||||
delay_after_disappear = 0;
|
||||
if (delay_after_disappear > 1638.375)
|
||||
delay_after_disappear = 1638.375;
|
||||
|
||||
this->delay_after_detection_ = delay_after_detection;
|
||||
this->delay_after_disappear_ = delay_after_disappear;
|
||||
|
||||
this->cmd_ = str_sprintf("outputLatency -1 %.0f %.0f", delay_after_detection / 0.025, delay_after_disappear / 0.025);
|
||||
SetLatencyCommand::SetLatencyCommand(float delay_after_detection, float delay_after_disappear) {
|
||||
delay_after_detection = std::round(delay_after_detection / 0.025f) * 0.025f;
|
||||
delay_after_disappear = std::round(delay_after_disappear / 0.025f) * 0.025f;
|
||||
this->delay_after_detection_ = clamp(delay_after_detection, 0.0f, 1638.375f);
|
||||
this->delay_after_disappear_ = clamp(delay_after_disappear, 0.0f, 1638.375f);
|
||||
this->cmd_ = str_sprintf("setLatency %.03f %.03f", this->delay_after_detection_, this->delay_after_disappear_);
|
||||
};
|
||||
|
||||
uint8_t OutputLatencyCommand::on_message(std::string &message) {
|
||||
uint8_t SetLatencyCommand::on_message(std::string &message) {
|
||||
if (message == "sensor is not stopped") {
|
||||
ESP_LOGE(TAG, "Cannot configure output latency. Sensor is not stopped!");
|
||||
return 1; // Command done
|
||||
} else if (message == "Done") {
|
||||
ESP_LOGI(TAG, "Updated output latency config:");
|
||||
ESP_LOGI(TAG, "Signal that someone was detected is delayed by %.02fs.", this->delay_after_detection_);
|
||||
ESP_LOGI(TAG, "Signal that nobody is detected anymore is delayed by %.02fs.", this->delay_after_disappear_);
|
||||
ESP_LOGI(TAG, "Signal that someone was detected is delayed by %.03f s.", this->delay_after_detection_);
|
||||
ESP_LOGI(TAG, "Signal that nobody is detected anymore is delayed by %.03f s.", this->delay_after_disappear_);
|
||||
ESP_LOGD(TAG, "Used command: %s", this->cmd_.c_str());
|
||||
return 1; // Command done
|
||||
}
|
||||
|
|
|
@ -62,9 +62,9 @@ class DetRangeCfgCommand : public Command {
|
|||
// TODO: Set min max values in component, so they can be published as sensor.
|
||||
};
|
||||
|
||||
class OutputLatencyCommand : public Command {
|
||||
class SetLatencyCommand : public Command {
|
||||
public:
|
||||
OutputLatencyCommand(float delay_after_detection, float delay_after_disappear);
|
||||
SetLatencyCommand(float delay_after_detection, float delay_after_disappear);
|
||||
uint8_t on_message(std::string &message) override;
|
||||
|
||||
protected:
|
||||
|
|
|
@ -62,6 +62,7 @@ from esphome.const import (
|
|||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
||||
DEVICE_CLASS_VOLTAGE,
|
||||
DEVICE_CLASS_VOLUME,
|
||||
DEVICE_CLASS_VOLUME_FLOW_RATE,
|
||||
DEVICE_CLASS_VOLUME_STORAGE,
|
||||
DEVICE_CLASS_WATER,
|
||||
DEVICE_CLASS_WEIGHT,
|
||||
|
@ -117,6 +118,7 @@ DEVICE_CLASSES = [
|
|||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
||||
DEVICE_CLASS_VOLTAGE,
|
||||
DEVICE_CLASS_VOLUME,
|
||||
DEVICE_CLASS_VOLUME_FLOW_RATE,
|
||||
DEVICE_CLASS_VOLUME_STORAGE,
|
||||
DEVICE_CLASS_WATER,
|
||||
DEVICE_CLASS_WEIGHT,
|
||||
|
|
|
@ -82,6 +82,7 @@ from esphome.const import (
|
|||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
||||
DEVICE_CLASS_VOLTAGE,
|
||||
DEVICE_CLASS_VOLUME,
|
||||
DEVICE_CLASS_VOLUME_FLOW_RATE,
|
||||
DEVICE_CLASS_VOLUME_STORAGE,
|
||||
DEVICE_CLASS_WATER,
|
||||
DEVICE_CLASS_WEIGHT,
|
||||
|
@ -141,6 +142,7 @@ DEVICE_CLASSES = [
|
|||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
||||
DEVICE_CLASS_VOLTAGE,
|
||||
DEVICE_CLASS_VOLUME,
|
||||
DEVICE_CLASS_VOLUME_FLOW_RATE,
|
||||
DEVICE_CLASS_VOLUME_STORAGE,
|
||||
DEVICE_CLASS_WATER,
|
||||
DEVICE_CLASS_WEIGHT,
|
||||
|
|
|
@ -17,8 +17,12 @@ from esphome.const import (
|
|||
DEPENDENCIES = ["spi"]
|
||||
|
||||
waveshare_epaper_ns = cg.esphome_ns.namespace("waveshare_epaper")
|
||||
WaveshareEPaper = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaper", cg.PollingComponent, spi.SPIDevice, display.DisplayBuffer
|
||||
WaveshareEPaperBase = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaperBase", cg.PollingComponent, spi.SPIDevice, display.DisplayBuffer
|
||||
)
|
||||
WaveshareEPaper = waveshare_epaper_ns.class_("WaveshareEPaper", WaveshareEPaperBase)
|
||||
WaveshareEPaperBWR = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaperBWR", WaveshareEPaperBase
|
||||
)
|
||||
WaveshareEPaperTypeA = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaperTypeA", WaveshareEPaper
|
||||
|
@ -26,6 +30,12 @@ WaveshareEPaperTypeA = waveshare_epaper_ns.class_(
|
|||
WaveshareEPaper2P7In = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaper2P7In", WaveshareEPaper
|
||||
)
|
||||
WaveshareEPaper2P7InB = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaper2P7InB", WaveshareEPaperBWR
|
||||
)
|
||||
WaveshareEPaper2P7InBV2 = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaper2P7InBV2", WaveshareEPaperBWR
|
||||
)
|
||||
WaveshareEPaper2P7InV2 = waveshare_epaper_ns.class_(
|
||||
"WaveshareEPaper2P7InV2", WaveshareEPaper
|
||||
)
|
||||
|
@ -92,6 +102,8 @@ MODELS = {
|
|||
"2.90inv2": ("a", WaveshareEPaperTypeAModel.WAVESHARE_EPAPER_2_9_IN_V2),
|
||||
"gdey029t94": ("c", GDEY029T94),
|
||||
"2.70in": ("b", WaveshareEPaper2P7In),
|
||||
"2.70in-b": ("b", WaveshareEPaper2P7InB),
|
||||
"2.70in-bv2": ("b", WaveshareEPaper2P7InBV2),
|
||||
"2.70inv2": ("b", WaveshareEPaper2P7InV2),
|
||||
"2.90in-b": ("b", WaveshareEPaper2P9InB),
|
||||
"2.90in-bv3": ("b", WaveshareEPaper2P9InBV3),
|
||||
|
@ -130,12 +142,12 @@ def validate_full_update_every_only_types_ac(value):
|
|||
CONFIG_SCHEMA = cv.All(
|
||||
display.FULL_DISPLAY_SCHEMA.extend(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(WaveshareEPaper),
|
||||
cv.GenerateID(): cv.declare_id(WaveshareEPaperBase),
|
||||
cv.Required(CONF_DC_PIN): pins.gpio_output_pin_schema,
|
||||
cv.Required(CONF_MODEL): cv.one_of(*MODELS, lower=True),
|
||||
cv.Optional(CONF_RESET_PIN): pins.gpio_output_pin_schema,
|
||||
cv.Optional(CONF_BUSY_PIN): pins.gpio_input_pin_schema,
|
||||
cv.Optional(CONF_FULL_UPDATE_EVERY): cv.uint32_t,
|
||||
cv.Optional(CONF_FULL_UPDATE_EVERY): cv.int_range(min=1, max=4294967295),
|
||||
cv.Optional(CONF_RESET_DURATION): cv.All(
|
||||
cv.positive_time_period_milliseconds,
|
||||
cv.Range(max=core.TimePeriod(milliseconds=500)),
|
||||
|
|
|
@ -83,7 +83,7 @@ static const uint8_t PARTIAL_UPDATE_LUT_TTGO_B1[LUT_SIZE_TTGO_B1] = {
|
|||
0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
void WaveshareEPaper::setup_pins_() {
|
||||
void WaveshareEPaperBase::setup_pins_() {
|
||||
this->init_internal_(this->get_buffer_length_());
|
||||
this->dc_pin_->setup(); // OUTPUT
|
||||
this->dc_pin_->digital_write(false);
|
||||
|
@ -98,13 +98,13 @@ void WaveshareEPaper::setup_pins_() {
|
|||
|
||||
this->reset_();
|
||||
}
|
||||
float WaveshareEPaper::get_setup_priority() const { return setup_priority::PROCESSOR; }
|
||||
void WaveshareEPaper::command(uint8_t value) {
|
||||
float WaveshareEPaperBase::get_setup_priority() const { return setup_priority::PROCESSOR; }
|
||||
void WaveshareEPaperBase::command(uint8_t value) {
|
||||
this->start_command_();
|
||||
this->write_byte(value);
|
||||
this->end_command_();
|
||||
}
|
||||
void WaveshareEPaper::data(uint8_t value) {
|
||||
void WaveshareEPaperBase::data(uint8_t value) {
|
||||
this->start_data_();
|
||||
this->write_byte(value);
|
||||
this->end_data_();
|
||||
|
@ -112,7 +112,7 @@ void WaveshareEPaper::data(uint8_t value) {
|
|||
|
||||
// write a command followed by one or more bytes of data.
|
||||
// The command is the first byte, length is the total including cmd.
|
||||
void WaveshareEPaper::cmd_data(const uint8_t *c_data, size_t length) {
|
||||
void WaveshareEPaperBase::cmd_data(const uint8_t *c_data, size_t length) {
|
||||
this->dc_pin_->digital_write(false);
|
||||
this->enable();
|
||||
this->write_byte(c_data[0]);
|
||||
|
@ -121,7 +121,7 @@ void WaveshareEPaper::cmd_data(const uint8_t *c_data, size_t length) {
|
|||
this->disable();
|
||||
}
|
||||
|
||||
bool WaveshareEPaper::wait_until_idle_() {
|
||||
bool WaveshareEPaperBase::wait_until_idle_() {
|
||||
if (this->busy_pin_ == nullptr || !this->busy_pin_->digital_read()) {
|
||||
return true;
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ bool WaveshareEPaper::wait_until_idle_() {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
void WaveshareEPaper::update() {
|
||||
void WaveshareEPaperBase::update() {
|
||||
this->do_update_();
|
||||
this->display();
|
||||
}
|
||||
|
@ -159,20 +159,51 @@ void HOT WaveshareEPaper::draw_absolute_pixel_internal(int x, int y, Color color
|
|||
this->buffer_[pos] &= ~(0x80 >> subpos);
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t WaveshareEPaper::get_buffer_length_() {
|
||||
return this->get_width_controller() * this->get_height_internal() / 8u;
|
||||
} // just a black buffer
|
||||
uint32_t WaveshareEPaperBWR::get_buffer_length_() {
|
||||
return this->get_width_controller() * this->get_height_internal() / 4u;
|
||||
} // black and red buffer
|
||||
|
||||
void WaveshareEPaperBWR::fill(Color color) {
|
||||
this->filled_rectangle(0, 0, this->get_width(), this->get_height(), color);
|
||||
}
|
||||
void WaveshareEPaper::start_command_() {
|
||||
void HOT WaveshareEPaperBWR::draw_absolute_pixel_internal(int x, int y, Color color) {
|
||||
if (x >= this->get_width_internal() || y >= this->get_height_internal() || x < 0 || y < 0)
|
||||
return;
|
||||
|
||||
const uint32_t buf_half_len = this->get_buffer_length_() / 2u;
|
||||
|
||||
const uint32_t pos = (x + y * this->get_width_internal()) / 8u;
|
||||
const uint8_t subpos = x & 0x07;
|
||||
// flip logic
|
||||
if (color.is_on()) {
|
||||
this->buffer_[pos] |= 0x80 >> subpos;
|
||||
} else {
|
||||
this->buffer_[pos] &= ~(0x80 >> subpos);
|
||||
}
|
||||
|
||||
// draw red pixels only, if the color contains red only
|
||||
if (((color.red > 0) && (color.green == 0) && (color.blue == 0))) {
|
||||
this->buffer_[pos + buf_half_len] |= 0x80 >> subpos;
|
||||
} else {
|
||||
this->buffer_[pos + buf_half_len] &= ~(0x80 >> subpos);
|
||||
}
|
||||
}
|
||||
|
||||
void WaveshareEPaperBase::start_command_() {
|
||||
this->dc_pin_->digital_write(false);
|
||||
this->enable();
|
||||
}
|
||||
void WaveshareEPaper::end_command_() { this->disable(); }
|
||||
void WaveshareEPaper::start_data_() {
|
||||
void WaveshareEPaperBase::end_command_() { this->disable(); }
|
||||
void WaveshareEPaperBase::start_data_() {
|
||||
this->dc_pin_->digital_write(true);
|
||||
this->enable();
|
||||
}
|
||||
void WaveshareEPaper::end_data_() { this->disable(); }
|
||||
void WaveshareEPaper::on_safe_shutdown() { this->deep_sleep(); }
|
||||
void WaveshareEPaperBase::end_data_() { this->disable(); }
|
||||
void WaveshareEPaperBase::on_safe_shutdown() { this->deep_sleep(); }
|
||||
|
||||
// ========================================================
|
||||
// Type A
|
||||
|
@ -493,7 +524,7 @@ uint32_t WaveshareEPaperTypeA::idle_timeout_() {
|
|||
case TTGO_EPAPER_2_13_IN_B1:
|
||||
return 2500;
|
||||
default:
|
||||
return WaveshareEPaper::idle_timeout_();
|
||||
return WaveshareEPaperBase::idle_timeout_();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -699,6 +730,246 @@ void WaveshareEPaper2P7InV2::dump_config() {
|
|||
LOG_UPDATE_INTERVAL(this);
|
||||
}
|
||||
|
||||
// ========================================================
|
||||
// 2.7inch_e-paper_b
|
||||
// ========================================================
|
||||
// Datasheet:
|
||||
// - https://www.waveshare.com/w/upload/d/d8/2.7inch-e-paper-b-specification.pdf
|
||||
// - https://github.com/waveshare/e-Paper/blob/master/RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in7b.c
|
||||
|
||||
static const uint8_t LUT_VCOM_DC_2_7B[44] = {0x00, 0x00, 0x00, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x00, 0x0A, 0x0A,
|
||||
0x00, 0x00, 0x08, 0x00, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x00, 0x0A,
|
||||
0x0A, 0x00, 0x00, 0x08, 0x00, 0x04, 0x10, 0x00, 0x00, 0x05, 0x00,
|
||||
0x03, 0x0E, 0x00, 0x00, 0x0A, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01};
|
||||
|
||||
static const uint8_t LUT_WHITE_TO_WHITE_2_7B[42] = {0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x40, 0x0A, 0x0A, 0x00, 0x00,
|
||||
0x08, 0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x80, 0x0A, 0x0A, 0x00,
|
||||
0x00, 0x08, 0x00, 0x04, 0x10, 0x00, 0x00, 0x05, 0x00, 0x03, 0x0E,
|
||||
0x00, 0x00, 0x0A, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01};
|
||||
|
||||
static const uint8_t LUT_BLACK_TO_WHITE_2_7B[42] = {0xA0, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x00, 0x0A, 0x0A, 0x00, 0x00,
|
||||
0x08, 0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x90, 0x0A, 0x0A, 0x00,
|
||||
0x00, 0x08, 0xB0, 0x04, 0x10, 0x00, 0x00, 0x05, 0xB0, 0x03, 0x0E,
|
||||
0x00, 0x00, 0x0A, 0xC0, 0x23, 0x00, 0x00, 0x00, 0x01};
|
||||
|
||||
static const uint8_t LUT_WHITE_TO_BLACK_2_7B[] = {0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x20, 0x0A, 0x0A, 0x00, 0x00,
|
||||
0x08, 0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x10, 0x0A, 0x0A, 0x00,
|
||||
0x00, 0x08, 0x00, 0x04, 0x10, 0x00, 0x00, 0x05, 0x00, 0x03, 0x0E,
|
||||
0x00, 0x00, 0x0A, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01};
|
||||
|
||||
static const uint8_t LUT_BLACK_TO_BLACK_2_7B[42] = {0x90, 0x1A, 0x1A, 0x00, 0x00, 0x01, 0x40, 0x0A, 0x0A, 0x00, 0x00,
|
||||
0x08, 0x84, 0x0E, 0x01, 0x0E, 0x01, 0x10, 0x80, 0x0A, 0x0A, 0x00,
|
||||
0x00, 0x08, 0x00, 0x04, 0x10, 0x00, 0x00, 0x05, 0x00, 0x03, 0x0E,
|
||||
0x00, 0x00, 0x0A, 0x00, 0x23, 0x00, 0x00, 0x00, 0x01};
|
||||
|
||||
void WaveshareEPaper2P7InB::initialize() {
|
||||
this->reset_();
|
||||
|
||||
// command power on
|
||||
this->command(0x04);
|
||||
this->wait_until_idle_();
|
||||
delay(10);
|
||||
|
||||
// Command panel setting
|
||||
this->command(0x00);
|
||||
this->data(0xAF); // KW-BF KWR-AF BWROTP 0f
|
||||
// command pll control
|
||||
this->command(0x30);
|
||||
this->data(0x3A); // 3A 100HZ 29 150Hz 39 200HZ 31 171HZ
|
||||
|
||||
// command power setting
|
||||
this->command(0x01);
|
||||
this->data(0x03); // VDS_EN, VDG_EN
|
||||
this->data(0x00); // VCOM_HV, VGHL_LV[1], VGHL_LV[0]
|
||||
this->data(0x2B); // VDH
|
||||
this->data(0x2B); // VDL
|
||||
this->data(0x09); // VDHR
|
||||
|
||||
// command booster soft start
|
||||
this->command(0x06);
|
||||
this->data(0x07);
|
||||
this->data(0x07);
|
||||
this->data(0x17);
|
||||
|
||||
// Power optimization - ???
|
||||
this->command(0xF8);
|
||||
this->data(0x60);
|
||||
this->data(0xA5);
|
||||
this->command(0xF8);
|
||||
this->data(0x89);
|
||||
this->data(0xA5);
|
||||
this->command(0xF8);
|
||||
this->data(0x90);
|
||||
this->data(0x00);
|
||||
this->command(0xF8);
|
||||
this->data(0x93);
|
||||
this->data(0x2A);
|
||||
this->command(0xF8);
|
||||
this->data(0x73);
|
||||
this->data(0x41);
|
||||
|
||||
// COMMAND VCM DC SETTING
|
||||
this->command(0x82);
|
||||
this->data(0x12);
|
||||
|
||||
// VCOM_AND_DATA_INTERVAL_SETTING
|
||||
this->command(0x50);
|
||||
this->data(0x87); // define by OTP
|
||||
|
||||
delay(2);
|
||||
// COMMAND LUT FOR VCOM
|
||||
this->command(0x20);
|
||||
for (uint8_t i : LUT_VCOM_DC_2_7B)
|
||||
this->data(i);
|
||||
// COMMAND LUT WHITE TO WHITE
|
||||
this->command(0x21);
|
||||
for (uint8_t i : LUT_WHITE_TO_WHITE_2_7B)
|
||||
this->data(i);
|
||||
// COMMAND LUT BLACK TO WHITE
|
||||
this->command(0x22);
|
||||
for (uint8_t i : LUT_BLACK_TO_WHITE_2_7B)
|
||||
this->data(i);
|
||||
// COMMAND LUT WHITE TO BLACK
|
||||
this->command(0x23);
|
||||
for (uint8_t i : LUT_WHITE_TO_BLACK_2_7B) {
|
||||
this->data(i);
|
||||
}
|
||||
// COMMAND LUT BLACK TO BLACK
|
||||
this->command(0x24);
|
||||
|
||||
for (uint8_t i : LUT_BLACK_TO_BLACK_2_7B) {
|
||||
this->data(i);
|
||||
}
|
||||
|
||||
delay(2);
|
||||
}
|
||||
|
||||
void HOT WaveshareEPaper2P7InB::display() {
|
||||
uint32_t buf_len_half = this->get_buffer_length_() >> 1;
|
||||
this->initialize();
|
||||
|
||||
// TCON_RESOLUTION
|
||||
this->command(0x61);
|
||||
this->data(this->get_width_internal() >> 8);
|
||||
this->data(this->get_width_internal() & 0xff); // 176
|
||||
this->data(this->get_height_internal() >> 8);
|
||||
this->data(this->get_height_internal() & 0xff); // 264
|
||||
|
||||
// COMMAND DATA START TRANSMISSION 1 (BLACK)
|
||||
this->command(0x10);
|
||||
delay(2);
|
||||
for (uint32_t i = 0; i < buf_len_half; i++) {
|
||||
this->data(this->buffer_[i]);
|
||||
}
|
||||
this->command(0x11);
|
||||
delay(2);
|
||||
|
||||
// COMMAND DATA START TRANSMISSION 2 (RED)
|
||||
this->command(0x13);
|
||||
delay(2);
|
||||
for (uint32_t i = buf_len_half; i < buf_len_half * 2u; i++) {
|
||||
this->data(this->buffer_[i]);
|
||||
}
|
||||
this->command(0x11);
|
||||
|
||||
delay(2);
|
||||
|
||||
// COMMAND DISPLAY REFRESH
|
||||
this->command(0x12);
|
||||
this->wait_until_idle_();
|
||||
|
||||
this->deep_sleep();
|
||||
}
|
||||
int WaveshareEPaper2P7InB::get_width_internal() { return 176; }
|
||||
int WaveshareEPaper2P7InB::get_height_internal() { return 264; }
|
||||
void WaveshareEPaper2P7InB::dump_config() {
|
||||
LOG_DISPLAY("", "Waveshare E-Paper", this);
|
||||
ESP_LOGCONFIG(TAG, " Model: 2.7in B");
|
||||
LOG_PIN(" Reset Pin: ", this->reset_pin_);
|
||||
LOG_PIN(" DC Pin: ", this->dc_pin_);
|
||||
LOG_PIN(" Busy Pin: ", this->busy_pin_);
|
||||
LOG_UPDATE_INTERVAL(this);
|
||||
}
|
||||
|
||||
// ========================================================
|
||||
// 2.7inch_e-paper_b_v2
|
||||
// ========================================================
|
||||
// Datasheet:
|
||||
// - https://www.waveshare.com/w/upload/7/7b/2.7inch-e-paper-b-v2-specification.pdf
|
||||
// - https://github.com/waveshare/e-Paper/blob/master/RaspberryPi_JetsonNano/c/lib/e-Paper/EPD_2in7b_V2.c
|
||||
|
||||
void WaveshareEPaper2P7InBV2::initialize() {
|
||||
this->reset_();
|
||||
|
||||
this->wait_until_idle_();
|
||||
this->command(0x12);
|
||||
this->wait_until_idle_();
|
||||
|
||||
this->command(0x00);
|
||||
this->data(0x27);
|
||||
this->data(0x01);
|
||||
this->data(0x00);
|
||||
|
||||
this->command(0x11);
|
||||
this->data(0x03);
|
||||
|
||||
// self.SetWindows(0, 0, self.width-1, self.height-1)
|
||||
// SetWindows(self, Xstart, Ystart, Xend, Yend):
|
||||
|
||||
uint32_t xend = this->get_width_internal() - 1;
|
||||
uint32_t yend = this->get_height_internal() - 1;
|
||||
this->command(0x44);
|
||||
this->data(0x00);
|
||||
this->data((xend >> 3) & 0xff);
|
||||
|
||||
this->command(0x45);
|
||||
this->data(0x00);
|
||||
this->data(0x00);
|
||||
this->data(yend & 0xff);
|
||||
this->data((yend >> 8) & 0xff);
|
||||
|
||||
// SetCursor(self, Xstart, Ystart):
|
||||
this->command(0x4E);
|
||||
this->data(0x00);
|
||||
this->command(0x4F);
|
||||
this->data(0x00);
|
||||
this->data(0x00);
|
||||
}
|
||||
|
||||
void HOT WaveshareEPaper2P7InBV2::display() {
|
||||
uint32_t buf_len = this->get_buffer_length_();
|
||||
// COMMAND DATA START TRANSMISSION 1 (BLACK)
|
||||
this->command(0x24);
|
||||
delay(2);
|
||||
for (uint32_t i = 0; i < buf_len; i++) {
|
||||
this->data(this->buffer_[i]);
|
||||
}
|
||||
delay(2);
|
||||
|
||||
// COMMAND DATA START TRANSMISSION 2 (RED)
|
||||
this->command(0x26);
|
||||
delay(2);
|
||||
for (uint32_t i = 0; i < buf_len; i++) {
|
||||
this->data(this->buffer_[i]);
|
||||
}
|
||||
|
||||
delay(2);
|
||||
|
||||
this->command(0x20);
|
||||
|
||||
this->wait_until_idle_();
|
||||
}
|
||||
int WaveshareEPaper2P7InBV2::get_width_internal() { return 176; }
|
||||
int WaveshareEPaper2P7InBV2::get_height_internal() { return 264; }
|
||||
void WaveshareEPaper2P7InBV2::dump_config() {
|
||||
LOG_DISPLAY("", "Waveshare E-Paper", this);
|
||||
ESP_LOGCONFIG(TAG, " Model: 2.7in B V2");
|
||||
LOG_PIN(" Reset Pin: ", this->reset_pin_);
|
||||
LOG_PIN(" DC Pin: ", this->dc_pin_);
|
||||
LOG_PIN(" Busy Pin: ", this->busy_pin_);
|
||||
LOG_UPDATE_INTERVAL(this);
|
||||
}
|
||||
|
||||
// ========================================================
|
||||
// 2.90in Type B (LUT from OTP)
|
||||
// Datasheet:
|
||||
|
|
|
@ -7,9 +7,9 @@
|
|||
namespace esphome {
|
||||
namespace waveshare_epaper {
|
||||
|
||||
class WaveshareEPaper : public display::DisplayBuffer,
|
||||
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
|
||||
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_2MHZ> {
|
||||
class WaveshareEPaperBase : public display::DisplayBuffer,
|
||||
public spi::SPIDevice<spi::BIT_ORDER_MSB_FIRST, spi::CLOCK_POLARITY_LOW,
|
||||
spi::CLOCK_PHASE_LEADING, spi::DATA_RATE_2MHZ> {
|
||||
public:
|
||||
void set_dc_pin(GPIOPin *dc_pin) { dc_pin_ = dc_pin; }
|
||||
float get_setup_priority() const override;
|
||||
|
@ -27,8 +27,6 @@ class WaveshareEPaper : public display::DisplayBuffer,
|
|||
|
||||
void update() override;
|
||||
|
||||
void fill(Color color) override;
|
||||
|
||||
void setup() override {
|
||||
this->setup_pins_();
|
||||
this->initialize();
|
||||
|
@ -36,11 +34,7 @@ class WaveshareEPaper : public display::DisplayBuffer,
|
|||
|
||||
void on_safe_shutdown() override;
|
||||
|
||||
display::DisplayType get_display_type() override { return display::DisplayType::DISPLAY_TYPE_BINARY; }
|
||||
|
||||
protected:
|
||||
void draw_absolute_pixel_internal(int x, int y, Color color) override;
|
||||
|
||||
bool wait_until_idle_();
|
||||
|
||||
void setup_pins_();
|
||||
|
@ -56,7 +50,7 @@ class WaveshareEPaper : public display::DisplayBuffer,
|
|||
|
||||
virtual int get_width_controller() { return this->get_width_internal(); };
|
||||
|
||||
uint32_t get_buffer_length_();
|
||||
virtual uint32_t get_buffer_length_() = 0; // NOLINT(readability-identifier-naming)
|
||||
uint32_t reset_duration_{200};
|
||||
|
||||
void start_command_();
|
||||
|
@ -70,6 +64,28 @@ class WaveshareEPaper : public display::DisplayBuffer,
|
|||
virtual uint32_t idle_timeout_() { return 1000u; } // NOLINT(readability-identifier-naming)
|
||||
};
|
||||
|
||||
class WaveshareEPaper : public WaveshareEPaperBase {
|
||||
public:
|
||||
void fill(Color color) override;
|
||||
|
||||
display::DisplayType get_display_type() override { return display::DisplayType::DISPLAY_TYPE_BINARY; }
|
||||
|
||||
protected:
|
||||
void draw_absolute_pixel_internal(int x, int y, Color color) override;
|
||||
uint32_t get_buffer_length_() override;
|
||||
};
|
||||
|
||||
class WaveshareEPaperBWR : public WaveshareEPaperBase {
|
||||
public:
|
||||
void fill(Color color) override;
|
||||
|
||||
display::DisplayType get_display_type() override { return display::DisplayType::DISPLAY_TYPE_COLOR; }
|
||||
|
||||
protected:
|
||||
void draw_absolute_pixel_internal(int x, int y, Color color) override;
|
||||
uint32_t get_buffer_length_() override;
|
||||
};
|
||||
|
||||
enum WaveshareEPaperTypeAModel {
|
||||
WAVESHARE_EPAPER_1_54_IN = 0,
|
||||
WAVESHARE_EPAPER_1_54_IN_V2,
|
||||
|
@ -134,6 +150,8 @@ class WaveshareEPaperTypeA : public WaveshareEPaper {
|
|||
|
||||
enum WaveshareEPaperTypeBModel {
|
||||
WAVESHARE_EPAPER_2_7_IN = 0,
|
||||
WAVESHARE_EPAPER_2_7_IN_B,
|
||||
WAVESHARE_EPAPER_2_7_IN_B_V2,
|
||||
WAVESHARE_EPAPER_4_2_IN,
|
||||
WAVESHARE_EPAPER_4_2_IN_B_V2,
|
||||
WAVESHARE_EPAPER_7_5_IN,
|
||||
|
@ -155,6 +173,68 @@ class WaveshareEPaper2P7In : public WaveshareEPaper {
|
|||
this->data(0xA5); // check byte
|
||||
}
|
||||
|
||||
protected:
|
||||
int get_width_internal() override;
|
||||
int get_height_internal() override;
|
||||
};
|
||||
|
||||
class WaveshareEPaper2P7InB : public WaveshareEPaperBWR {
|
||||
public:
|
||||
void initialize() override;
|
||||
|
||||
void display() override;
|
||||
|
||||
void dump_config() override;
|
||||
|
||||
void deep_sleep() override {
|
||||
// COMMAND VCOM_AND_DATA_INTERVAL_SETTING
|
||||
this->command(0x50);
|
||||
// COMMAND POWER OFF
|
||||
this->command(0x02);
|
||||
this->wait_until_idle_();
|
||||
// COMMAND DEEP SLEEP
|
||||
this->command(0x07); // deep sleep
|
||||
this->data(0xA5); // check byte
|
||||
}
|
||||
|
||||
protected:
|
||||
int get_width_internal() override;
|
||||
int get_height_internal() override;
|
||||
};
|
||||
|
||||
class WaveshareEPaper2P7InBV2 : public WaveshareEPaperBWR {
|
||||
public:
|
||||
void initialize() override;
|
||||
|
||||
void display() override;
|
||||
|
||||
void dump_config() override;
|
||||
|
||||
void deep_sleep() override {
|
||||
// COMMAND DEEP SLEEP
|
||||
this->command(0x10);
|
||||
this->data(0x01);
|
||||
}
|
||||
|
||||
protected:
|
||||
int get_width_internal() override;
|
||||
int get_height_internal() override;
|
||||
};
|
||||
|
||||
class GDEY029T94 : public WaveshareEPaper {
|
||||
public:
|
||||
void initialize() override;
|
||||
|
||||
void display() override;
|
||||
|
||||
void dump_config() override;
|
||||
|
||||
void deep_sleep() override {
|
||||
// COMMAND DEEP SLEEP
|
||||
this->command(0x07);
|
||||
this->data(0xA5); // check byte
|
||||
}
|
||||
|
||||
protected:
|
||||
int get_width_internal() override;
|
||||
|
||||
|
@ -177,26 +257,6 @@ class WaveshareEPaper2P7InV2 : public WaveshareEPaper {
|
|||
int get_height_internal() override;
|
||||
};
|
||||
|
||||
class GDEY029T94 : public WaveshareEPaper {
|
||||
public:
|
||||
void initialize() override;
|
||||
|
||||
void display() override;
|
||||
|
||||
void dump_config() override;
|
||||
|
||||
void deep_sleep() override {
|
||||
// COMMAND DEEP SLEEP
|
||||
this->command(0x07);
|
||||
this->data(0xA5); // check byte
|
||||
}
|
||||
|
||||
protected:
|
||||
int get_width_internal() override;
|
||||
|
||||
int get_height_internal() override;
|
||||
};
|
||||
|
||||
class GDEW0154M09 : public WaveshareEPaper {
|
||||
public:
|
||||
void initialize() override;
|
||||
|
|
|
@ -1082,6 +1082,7 @@ DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS = "volatile_organic_compounds"
|
|||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS = "volatile_organic_compounds_parts"
|
||||
DEVICE_CLASS_VOLTAGE = "voltage"
|
||||
DEVICE_CLASS_VOLUME = "volume"
|
||||
DEVICE_CLASS_VOLUME_FLOW_RATE = "volume_flow_rate"
|
||||
DEVICE_CLASS_VOLUME_STORAGE = "volume_storage"
|
||||
DEVICE_CLASS_WATER = "water"
|
||||
DEVICE_CLASS_WEIGHT = "weight"
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 17
|
||||
rx_pin:
|
||||
number: 16
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 17
|
||||
rx_pin:
|
||||
number: 16
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a01nyub
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a01nyub
|
||||
id: a01nyub_sensor
|
||||
name: a01nyub Distance
|
||||
uart_id: uart_a01nyub
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a02yyuw
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a02yyuw
|
||||
id: a02yyuw_sensor
|
||||
name: a02yyuw Distance
|
||||
uart_id: uart_a02yyuw
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a02yyuw
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a02yyuw
|
||||
id: a02yyuw_sensor
|
||||
name: a02yyuw Distance
|
||||
uart_id: uart_a02yyuw
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a02yyuw
|
||||
tx_pin:
|
||||
number: 17
|
||||
rx_pin:
|
||||
number: 16
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a02yyuw
|
||||
id: a02yyuw_sensor
|
||||
name: a02yyuw Distance
|
||||
uart_id: uart_a02yyuw
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a02yyuw
|
||||
tx_pin:
|
||||
number: 17
|
||||
rx_pin:
|
||||
number: 16
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a02yyuw
|
||||
id: a02yyuw_sensor
|
||||
name: a02yyuw Distance
|
||||
uart_id: uart_a02yyuw
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a02yyuw
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a02yyuw
|
||||
id: a02yyuw_sensor
|
||||
name: a02yyuw Distance
|
||||
uart_id: uart_a02yyuw
|
|
@ -0,0 +1,13 @@
|
|||
uart:
|
||||
- id: uart_a02yyuw
|
||||
tx_pin:
|
||||
number: 4
|
||||
rx_pin:
|
||||
number: 5
|
||||
baud_rate: 9600
|
||||
|
||||
sensor:
|
||||
- platform: a02yyuw
|
||||
id: a02yyuw_sensor
|
||||
name: a02yyuw Distance
|
||||
uart_id: uart_a02yyuw
|
|
@ -0,0 +1,12 @@
|
|||
stepper:
|
||||
- platform: a4988
|
||||
id: a4988_stepper
|
||||
step_pin:
|
||||
number: 2
|
||||
dir_pin:
|
||||
number: 3
|
||||
sleep_pin:
|
||||
number: 5
|
||||
max_speed: 250 steps/s
|
||||
acceleration: 100 steps/s^2
|
||||
deceleration: 200 steps/s^2
|
|
@ -0,0 +1,12 @@
|
|||
stepper:
|
||||
- platform: a4988
|
||||
id: a4988_stepper
|
||||
step_pin:
|
||||
number: 2
|
||||
dir_pin:
|
||||
number: 3
|
||||
sleep_pin:
|
||||
number: 5
|
||||
max_speed: 250 steps/s
|
||||
acceleration: 100 steps/s^2
|
||||
deceleration: 200 steps/s^2
|
|
@ -0,0 +1,12 @@
|
|||
stepper:
|
||||
- platform: a4988
|
||||
id: a4988_stepper
|
||||
step_pin:
|
||||
number: 22
|
||||
dir_pin:
|
||||
number: 23
|
||||
sleep_pin:
|
||||
number: 25
|
||||
max_speed: 250 steps/s
|
||||
acceleration: 100 steps/s^2
|
||||
deceleration: 200 steps/s^2
|
|
@ -0,0 +1,12 @@
|
|||
stepper:
|
||||
- platform: a4988
|
||||
id: a4988_stepper
|
||||
step_pin:
|
||||
number: 22
|
||||
dir_pin:
|
||||
number: 23
|
||||
sleep_pin:
|
||||
number: 25
|
||||
max_speed: 250 steps/s
|
||||
acceleration: 100 steps/s^2
|
||||
deceleration: 200 steps/s^2
|
|
@ -0,0 +1,12 @@
|
|||
stepper:
|
||||
- platform: a4988
|
||||
id: a4988_stepper
|
||||
step_pin:
|
||||
number: 1
|
||||
dir_pin:
|
||||
number: 2
|
||||
sleep_pin:
|
||||
number: 5
|
||||
max_speed: 250 steps/s
|
||||
acceleration: 100 steps/s^2
|
||||
deceleration: 200 steps/s^2
|
|
@ -0,0 +1,12 @@
|
|||
stepper:
|
||||
- platform: a4988
|
||||
id: a4988_stepper
|
||||
step_pin:
|
||||
number: 2
|
||||
dir_pin:
|
||||
number: 3
|
||||
sleep_pin:
|
||||
number: 5
|
||||
max_speed: 250 steps/s
|
||||
acceleration: 100 steps/s^2
|
||||
deceleration: 200 steps/s^2
|
|
@ -0,0 +1,21 @@
|
|||
sensor:
|
||||
- platform: absolute_humidity
|
||||
name: Absolute Humidity
|
||||
temperature: template_temperature
|
||||
humidity: template_humidity
|
||||
- platform: template
|
||||
id: template_humidity
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 0.6;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
- platform: template
|
||||
id: template_temperature
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 42.0;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
sensor:
|
||||
- platform: absolute_humidity
|
||||
name: Absolute Humidity
|
||||
temperature: template_temperature
|
||||
humidity: template_humidity
|
||||
- platform: template
|
||||
id: template_humidity
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 0.6;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
- platform: template
|
||||
id: template_temperature
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 42.0;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
sensor:
|
||||
- platform: absolute_humidity
|
||||
name: Absolute Humidity
|
||||
temperature: template_temperature
|
||||
humidity: template_humidity
|
||||
- platform: template
|
||||
id: template_humidity
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 0.6;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
- platform: template
|
||||
id: template_temperature
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 42.0;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
sensor:
|
||||
- platform: absolute_humidity
|
||||
name: Absolute Humidity
|
||||
temperature: template_temperature
|
||||
humidity: template_humidity
|
||||
- platform: template
|
||||
id: template_humidity
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 0.6;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
- platform: template
|
||||
id: template_temperature
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 42.0;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
sensor:
|
||||
- platform: absolute_humidity
|
||||
name: Absolute Humidity
|
||||
temperature: template_temperature
|
||||
humidity: template_humidity
|
||||
- platform: template
|
||||
id: template_humidity
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 0.6;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
- platform: template
|
||||
id: template_temperature
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 42.0;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
sensor:
|
||||
- platform: absolute_humidity
|
||||
name: Absolute Humidity
|
||||
temperature: template_temperature
|
||||
humidity: template_humidity
|
||||
- platform: template
|
||||
id: template_humidity
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 0.6;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
- platform: template
|
||||
id: template_temperature
|
||||
lambda: |-
|
||||
if (millis() > 10000) {
|
||||
return 42.0;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
output:
|
||||
- platform: ac_dimmer
|
||||
id: ac_dimmer_1
|
||||
gate_pin:
|
||||
number: 5
|
||||
zero_cross_pin:
|
||||
number: 6
|
|
@ -0,0 +1,7 @@
|
|||
output:
|
||||
- platform: ac_dimmer
|
||||
id: ac_dimmer_1
|
||||
gate_pin:
|
||||
number: 12
|
||||
zero_cross_pin:
|
||||
number: 13
|
|
@ -0,0 +1,7 @@
|
|||
output:
|
||||
- platform: ac_dimmer
|
||||
id: ac_dimmer_1
|
||||
gate_pin:
|
||||
number: 5
|
||||
zero_cross_pin:
|
||||
number: 4
|
|
@ -0,0 +1,7 @@
|
|||
output:
|
||||
- platform: ac_dimmer
|
||||
id: ac_dimmer_1
|
||||
gate_pin:
|
||||
number: 5
|
||||
zero_cross_pin:
|
||||
number: 6
|
|
@ -0,0 +1,14 @@
|
|||
spi:
|
||||
- id: spi_adc128s102
|
||||
clk_pin: 6
|
||||
mosi_pin: 7
|
||||
miso_pin: 5
|
||||
|
||||
adc128s102:
|
||||
cs_pin: 8
|
||||
id: adc128s102_adc
|
||||
|
||||
sensor:
|
||||
- platform: adc128s102
|
||||
id: adc128s102_channel_0
|
||||
channel: 0
|
|
@ -0,0 +1,14 @@
|
|||
spi:
|
||||
- id: spi_adc128s102
|
||||
clk_pin: 6
|
||||
mosi_pin: 7
|
||||
miso_pin: 5
|
||||
|
||||
adc128s102:
|
||||
cs_pin: 8
|
||||
id: adc128s102_adc
|
||||
|
||||
sensor:
|
||||
- platform: adc128s102
|
||||
id: adc128s102_channel_0
|
||||
channel: 0
|
|
@ -0,0 +1,14 @@
|
|||
spi:
|
||||
- id: spi_adc128s102
|
||||
clk_pin: 16
|
||||
mosi_pin: 17
|
||||
miso_pin: 15
|
||||
|
||||
adc128s102:
|
||||
cs_pin: 12
|
||||
id: adc128s102_adc
|
||||
|
||||
sensor:
|
||||
- platform: adc128s102
|
||||
id: adc128s102_channel_0
|
||||
channel: 0
|
|
@ -0,0 +1,14 @@
|
|||
spi:
|
||||
- id: spi_adc128s102
|
||||
clk_pin: 16
|
||||
mosi_pin: 17
|
||||
miso_pin: 15
|
||||
|
||||
adc128s102:
|
||||
cs_pin: 12
|
||||
id: adc128s102_adc
|
||||
|
||||
sensor:
|
||||
- platform: adc128s102
|
||||
id: adc128s102_channel_0
|
||||
channel: 0
|
|
@ -0,0 +1,14 @@
|
|||
spi:
|
||||
- id: spi_adc128s102
|
||||
clk_pin: 14
|
||||
mosi_pin: 13
|
||||
miso_pin: 12
|
||||
|
||||
adc128s102:
|
||||
cs_pin: 15
|
||||
id: adc128s102_adc
|
||||
|
||||
sensor:
|
||||
- platform: adc128s102
|
||||
id: adc128s102_channel_0
|
||||
channel: 0
|
|
@ -0,0 +1,14 @@
|
|||
spi:
|
||||
- id: spi_adc128s102
|
||||
clk_pin: 2
|
||||
mosi_pin: 3
|
||||
miso_pin: 4
|
||||
|
||||
adc128s102:
|
||||
cs_pin: 5
|
||||
id: adc128s102_adc
|
||||
|
||||
sensor:
|
||||
- platform: adc128s102
|
||||
id: adc128s102_channel_0
|
||||
channel: 0
|
|
@ -0,0 +1,31 @@
|
|||
light:
|
||||
- platform: esp32_rmt_led_strip
|
||||
id: led_matrix_32x8
|
||||
default_transition_length: 500ms
|
||||
chipset: ws2812
|
||||
rgb_order: GRB
|
||||
num_leds: 256
|
||||
pin: 2
|
||||
rmt_channel: 0
|
||||
|
||||
display:
|
||||
- platform: addressable_light
|
||||
id: led_matrix_32x8_display
|
||||
addressable_light_id: led_matrix_32x8
|
||||
width: 32
|
||||
height: 8
|
||||
pixel_mapper: |-
|
||||
if (x % 2 == 0) {
|
||||
return (x * 8) + y;
|
||||
}
|
||||
return (x * 8) + (7 - y);
|
||||
lambda: |-
|
||||
Color red = Color(0xFF0000);
|
||||
Color green = Color(0x00FF00);
|
||||
Color blue = Color(0x0000FF);
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height(), red);
|
||||
it.rectangle(1, 1, it.get_width()-2, it.get_height()-2, green);
|
||||
it.rectangle(2, 2, it.get_width()-4, it.get_height()-4, blue);
|
||||
it.rectangle(3, 3, it.get_width()-6, it.get_height()-6, red);
|
||||
rotation: 0°
|
||||
update_interval: 16ms
|
|
@ -0,0 +1,31 @@
|
|||
light:
|
||||
- platform: esp32_rmt_led_strip
|
||||
id: led_matrix_32x8
|
||||
default_transition_length: 500ms
|
||||
chipset: ws2812
|
||||
rgb_order: GRB
|
||||
num_leds: 256
|
||||
pin: 2
|
||||
rmt_channel: 0
|
||||
|
||||
display:
|
||||
- platform: addressable_light
|
||||
id: led_matrix_32x8_display
|
||||
addressable_light_id: led_matrix_32x8
|
||||
width: 32
|
||||
height: 8
|
||||
pixel_mapper: |-
|
||||
if (x % 2 == 0) {
|
||||
return (x * 8) + y;
|
||||
}
|
||||
return (x * 8) + (7 - y);
|
||||
lambda: |-
|
||||
Color red = Color(0xFF0000);
|
||||
Color green = Color(0x00FF00);
|
||||
Color blue = Color(0x0000FF);
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height(), red);
|
||||
it.rectangle(1, 1, it.get_width()-2, it.get_height()-2, green);
|
||||
it.rectangle(2, 2, it.get_width()-4, it.get_height()-4, blue);
|
||||
it.rectangle(3, 3, it.get_width()-6, it.get_height()-6, red);
|
||||
rotation: 0°
|
||||
update_interval: 16ms
|
|
@ -0,0 +1,31 @@
|
|||
light:
|
||||
- platform: esp32_rmt_led_strip
|
||||
id: led_matrix_32x8
|
||||
default_transition_length: 500ms
|
||||
chipset: ws2812
|
||||
rgb_order: GRB
|
||||
num_leds: 256
|
||||
pin: 2
|
||||
rmt_channel: 0
|
||||
|
||||
display:
|
||||
- platform: addressable_light
|
||||
id: led_matrix_32x8_display
|
||||
addressable_light_id: led_matrix_32x8
|
||||
width: 32
|
||||
height: 8
|
||||
pixel_mapper: |-
|
||||
if (x % 2 == 0) {
|
||||
return (x * 8) + y;
|
||||
}
|
||||
return (x * 8) + (7 - y);
|
||||
lambda: |-
|
||||
Color red = Color(0xFF0000);
|
||||
Color green = Color(0x00FF00);
|
||||
Color blue = Color(0x0000FF);
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height(), red);
|
||||
it.rectangle(1, 1, it.get_width()-2, it.get_height()-2, green);
|
||||
it.rectangle(2, 2, it.get_width()-4, it.get_height()-4, blue);
|
||||
it.rectangle(3, 3, it.get_width()-6, it.get_height()-6, red);
|
||||
rotation: 0°
|
||||
update_interval: 16ms
|
|
@ -0,0 +1,32 @@
|
|||
light:
|
||||
- platform: fastled_clockless
|
||||
id: led_matrix_32x8
|
||||
name: led_matrix_32x8
|
||||
chipset: WS2812B
|
||||
pin: 2
|
||||
num_leds: 256
|
||||
rgb_order: GRB
|
||||
default_transition_length: 0s
|
||||
color_correct: [50%, 50%, 50%]
|
||||
|
||||
display:
|
||||
- platform: addressable_light
|
||||
id: led_matrix_32x8_display
|
||||
addressable_light_id: led_matrix_32x8
|
||||
width: 32
|
||||
height: 8
|
||||
pixel_mapper: |-
|
||||
if (x % 2 == 0) {
|
||||
return (x * 8) + y;
|
||||
}
|
||||
return (x * 8) + (7 - y);
|
||||
lambda: |-
|
||||
Color red = Color(0xFF0000);
|
||||
Color green = Color(0x00FF00);
|
||||
Color blue = Color(0x0000FF);
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height(), red);
|
||||
it.rectangle(1, 1, it.get_width()-2, it.get_height()-2, green);
|
||||
it.rectangle(2, 2, it.get_width()-4, it.get_height()-4, blue);
|
||||
it.rectangle(3, 3, it.get_width()-6, it.get_height()-6, red);
|
||||
rotation: 0°
|
||||
update_interval: 16ms
|
|
@ -0,0 +1,34 @@
|
|||
i2c:
|
||||
- id: i2c_ade7953
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_i2c
|
||||
irq_pin: 6
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,34 @@
|
|||
i2c:
|
||||
- id: i2c_ade7953
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_i2c
|
||||
irq_pin: 6
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,34 @@
|
|||
i2c:
|
||||
- id: i2c_ade7953
|
||||
scl: 16
|
||||
sda: 17
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_i2c
|
||||
irq_pin: 15
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,34 @@
|
|||
i2c:
|
||||
- id: i2c_ade7953
|
||||
scl: 16
|
||||
sda: 17
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_i2c
|
||||
irq_pin: 15
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,34 @@
|
|||
i2c:
|
||||
- id: i2c_ade7953
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_i2c
|
||||
irq_pin: 15
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,34 @@
|
|||
i2c:
|
||||
- id: i2c_ade7953
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_i2c
|
||||
irq_pin: 6
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,36 @@
|
|||
spi:
|
||||
- id: spi_ade7953
|
||||
clk_pin: 6
|
||||
mosi_pin: 7
|
||||
miso_pin: 5
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_spi
|
||||
cs_pin: 8
|
||||
irq_pin: 9
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,36 @@
|
|||
spi:
|
||||
- id: spi_ade7953
|
||||
clk_pin: 6
|
||||
mosi_pin: 7
|
||||
miso_pin: 5
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_spi
|
||||
cs_pin: 8
|
||||
irq_pin: 9
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,36 @@
|
|||
spi:
|
||||
- id: spi_ade7953
|
||||
clk_pin: 16
|
||||
mosi_pin: 17
|
||||
miso_pin: 15
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_spi
|
||||
cs_pin: 5
|
||||
irq_pin: 13
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,36 @@
|
|||
spi:
|
||||
- id: spi_ade7953
|
||||
clk_pin: 16
|
||||
mosi_pin: 17
|
||||
miso_pin: 15
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_spi
|
||||
cs_pin: 5
|
||||
irq_pin: 13
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,36 @@
|
|||
spi:
|
||||
- id: spi_ade7953
|
||||
clk_pin: 14
|
||||
mosi_pin: 13
|
||||
miso_pin: 12
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_spi
|
||||
cs_pin: 15
|
||||
irq_pin: 5
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,36 @@
|
|||
spi:
|
||||
- id: spi_ade7953
|
||||
clk_pin: 2
|
||||
mosi_pin: 3
|
||||
miso_pin: 4
|
||||
|
||||
sensor:
|
||||
- platform: ade7953_spi
|
||||
cs_pin: 5
|
||||
irq_pin: 6
|
||||
voltage:
|
||||
name: ADE7953 Voltage
|
||||
id: ade7953_voltage
|
||||
current_a:
|
||||
name: ADE7953 Current A
|
||||
id: ade7953_current_a
|
||||
current_b:
|
||||
name: ADE7953 Current B
|
||||
id: ade7953_current_b
|
||||
power_factor_a:
|
||||
name: ADE7953 Power Factor A
|
||||
power_factor_b:
|
||||
name: ADE7953 Power Factor B
|
||||
apparent_power_a:
|
||||
name: ADE7953 Apparent Power A
|
||||
apparent_power_b:
|
||||
name: ADE7953 Apparent Power B
|
||||
active_power_a:
|
||||
name: ADE7953 Active Power A
|
||||
active_power_b:
|
||||
name: ADE7953 Active Power B
|
||||
reactive_power_a:
|
||||
name: ADE7953 Reactive Power A
|
||||
reactive_power_b:
|
||||
name: ADE7953 Reactive Power B
|
||||
update_interval: 1s
|
|
@ -0,0 +1,13 @@
|
|||
i2c:
|
||||
- id: i2c_ads1115
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
ads1115:
|
||||
address: 0x48
|
||||
|
||||
sensor:
|
||||
- platform: ads1115
|
||||
multiplexer: A0_A1
|
||||
gain: 1.024
|
||||
id: ads1115_sensor
|
|
@ -0,0 +1,13 @@
|
|||
i2c:
|
||||
- id: i2c_ads1115
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
ads1115:
|
||||
address: 0x48
|
||||
|
||||
sensor:
|
||||
- platform: ads1115
|
||||
multiplexer: A0_A1
|
||||
gain: 1.024
|
||||
id: ads1115_sensor
|
|
@ -0,0 +1,13 @@
|
|||
i2c:
|
||||
- id: i2c_ads1115
|
||||
scl: 16
|
||||
sda: 17
|
||||
|
||||
ads1115:
|
||||
address: 0x48
|
||||
|
||||
sensor:
|
||||
- platform: ads1115
|
||||
multiplexer: A0_A1
|
||||
gain: 1.024
|
||||
id: ads1115_sensor
|
|
@ -0,0 +1,13 @@
|
|||
i2c:
|
||||
- id: i2c_ads1115
|
||||
scl: 16
|
||||
sda: 17
|
||||
|
||||
ads1115:
|
||||
address: 0x48
|
||||
|
||||
sensor:
|
||||
- platform: ads1115
|
||||
multiplexer: A0_A1
|
||||
gain: 1.024
|
||||
id: ads1115_sensor
|
|
@ -0,0 +1,13 @@
|
|||
i2c:
|
||||
- id: i2c_ads1115
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
ads1115:
|
||||
address: 0x48
|
||||
|
||||
sensor:
|
||||
- platform: ads1115
|
||||
multiplexer: A0_A1
|
||||
gain: 1.024
|
||||
id: ads1115_sensor
|
|
@ -0,0 +1,13 @@
|
|||
i2c:
|
||||
- id: i2c_ads1115
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
ads1115:
|
||||
address: 0x48
|
||||
|
||||
sensor:
|
||||
- platform: ads1115
|
||||
multiplexer: A0_A1
|
||||
gain: 1.024
|
||||
id: ads1115_sensor
|
|
@ -0,0 +1,11 @@
|
|||
i2c:
|
||||
- id: i2c_aht10
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
sensor:
|
||||
- platform: aht10
|
||||
temperature:
|
||||
name: Temperature
|
||||
humidity:
|
||||
name: Humidity
|
|
@ -0,0 +1,11 @@
|
|||
i2c:
|
||||
- id: i2c_aht10
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
sensor:
|
||||
- platform: aht10
|
||||
temperature:
|
||||
name: Temperature
|
||||
humidity:
|
||||
name: Humidity
|
|
@ -0,0 +1,11 @@
|
|||
i2c:
|
||||
- id: i2c_aht10
|
||||
scl: 16
|
||||
sda: 17
|
||||
|
||||
sensor:
|
||||
- platform: aht10
|
||||
temperature:
|
||||
name: Temperature
|
||||
humidity:
|
||||
name: Humidity
|
|
@ -0,0 +1,11 @@
|
|||
i2c:
|
||||
- id: i2c_aht10
|
||||
scl: 16
|
||||
sda: 17
|
||||
|
||||
sensor:
|
||||
- platform: aht10
|
||||
temperature:
|
||||
name: Temperature
|
||||
humidity:
|
||||
name: Humidity
|
|
@ -0,0 +1,11 @@
|
|||
i2c:
|
||||
- id: i2c_aht10
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
sensor:
|
||||
- platform: aht10
|
||||
temperature:
|
||||
name: Temperature
|
||||
humidity:
|
||||
name: Humidity
|
|
@ -0,0 +1,11 @@
|
|||
i2c:
|
||||
- id: i2c_aht10
|
||||
scl: 5
|
||||
sda: 4
|
||||
|
||||
sensor:
|
||||
- platform: aht10
|
||||
temperature:
|
||||
name: Temperature
|
||||
humidity:
|
||||
name: Humidity
|
|
@ -0,0 +1,22 @@
|
|||
esp32_ble_tracker:
|
||||
|
||||
ble_client:
|
||||
- mac_address: 01:02:03:04:05:06
|
||||
id: airthingsmini01
|
||||
|
||||
sensor:
|
||||
- id: airthingswm
|
||||
platform: airthings_wave_mini
|
||||
ble_client_id: airthingsmini01
|
||||
update_interval: 5min
|
||||
battery_update_interval: 12h
|
||||
temperature:
|
||||
name: Wave Mini Temperature
|
||||
humidity:
|
||||
name: Wave Mini Humidity
|
||||
pressure:
|
||||
name: Wave Mini Pressure
|
||||
tvoc:
|
||||
name: Wave Mini VOC
|
||||
battery_voltage:
|
||||
name: Wave Mini Battery Voltage
|
|
@ -0,0 +1,22 @@
|
|||
esp32_ble_tracker:
|
||||
|
||||
ble_client:
|
||||
- mac_address: 01:02:03:04:05:06
|
||||
id: airthingsmini01
|
||||
|
||||
sensor:
|
||||
- id: airthingswm
|
||||
platform: airthings_wave_mini
|
||||
ble_client_id: airthingsmini01
|
||||
update_interval: 5min
|
||||
battery_update_interval: 12h
|
||||
temperature:
|
||||
name: Wave Mini Temperature
|
||||
humidity:
|
||||
name: Wave Mini Humidity
|
||||
pressure:
|
||||
name: Wave Mini Pressure
|
||||
tvoc:
|
||||
name: Wave Mini VOC
|
||||
battery_voltage:
|
||||
name: Wave Mini Battery Voltage
|
|
@ -0,0 +1,22 @@
|
|||
esp32_ble_tracker:
|
||||
|
||||
ble_client:
|
||||
- mac_address: 01:02:03:04:05:06
|
||||
id: airthingsmini01
|
||||
|
||||
sensor:
|
||||
- id: airthingswm
|
||||
platform: airthings_wave_mini
|
||||
ble_client_id: airthingsmini01
|
||||
update_interval: 5min
|
||||
battery_update_interval: 12h
|
||||
temperature:
|
||||
name: Wave Mini Temperature
|
||||
humidity:
|
||||
name: Wave Mini Humidity
|
||||
pressure:
|
||||
name: Wave Mini Pressure
|
||||
tvoc:
|
||||
name: Wave Mini VOC
|
||||
battery_voltage:
|
||||
name: Wave Mini Battery Voltage
|
|
@ -0,0 +1,22 @@
|
|||
esp32_ble_tracker:
|
||||
|
||||
ble_client:
|
||||
- mac_address: 01:02:03:04:05:06
|
||||
id: airthingsmini01
|
||||
|
||||
sensor:
|
||||
- id: airthingswm
|
||||
platform: airthings_wave_mini
|
||||
ble_client_id: airthingsmini01
|
||||
update_interval: 5min
|
||||
battery_update_interval: 12h
|
||||
temperature:
|
||||
name: Wave Mini Temperature
|
||||
humidity:
|
||||
name: Wave Mini Humidity
|
||||
pressure:
|
||||
name: Wave Mini Pressure
|
||||
tvoc:
|
||||
name: Wave Mini VOC
|
||||
battery_voltage:
|
||||
name: Wave Mini Battery Voltage
|
|
@ -0,0 +1,28 @@
|
|||
esp32_ble_tracker:
|
||||
|
||||
ble_client:
|
||||
- mac_address: 01:02:03:04:05:06
|
||||
id: airthings01
|
||||
|
||||
sensor:
|
||||
- id: airthingswp
|
||||
platform: airthings_wave_plus
|
||||
ble_client_id: airthings01
|
||||
update_interval: 5min
|
||||
battery_update_interval: 12h
|
||||
temperature:
|
||||
name: Wave Plus Temperature
|
||||
radon:
|
||||
name: Wave Plus Radon
|
||||
radon_long_term:
|
||||
name: Wave Plus Radon Long Term
|
||||
pressure:
|
||||
name: Wave Plus Pressure
|
||||
humidity:
|
||||
name: Wave Plus Humidity
|
||||
co2:
|
||||
name: Wave Plus CO2
|
||||
tvoc:
|
||||
name: Wave Plus VOC
|
||||
battery_voltage:
|
||||
name: Wave Plus Battery Voltage
|
|
@ -0,0 +1,28 @@
|
|||
esp32_ble_tracker:
|
||||
|
||||
ble_client:
|
||||
- mac_address: 01:02:03:04:05:06
|
||||
id: airthings01
|
||||
|
||||
sensor:
|
||||
- id: airthingswp
|
||||
platform: airthings_wave_plus
|
||||
ble_client_id: airthings01
|
||||
update_interval: 5min
|
||||
battery_update_interval: 12h
|
||||
temperature:
|
||||
name: Wave Plus Temperature
|
||||
radon:
|
||||
name: Wave Plus Radon
|
||||
radon_long_term:
|
||||
name: Wave Plus Radon Long Term
|
||||
pressure:
|
||||
name: Wave Plus Pressure
|
||||
humidity:
|
||||
name: Wave Plus Humidity
|
||||
co2:
|
||||
name: Wave Plus CO2
|
||||
tvoc:
|
||||
name: Wave Plus VOC
|
||||
battery_voltage:
|
||||
name: Wave Plus Battery Voltage
|
|
@ -0,0 +1,28 @@
|
|||
esp32_ble_tracker:
|
||||
|
||||
ble_client:
|
||||
- mac_address: 01:02:03:04:05:06
|
||||
id: airthings01
|
||||
|
||||
sensor:
|
||||
- id: airthingswp
|
||||
platform: airthings_wave_plus
|
||||
ble_client_id: airthings01
|
||||
update_interval: 5min
|
||||
battery_update_interval: 12h
|
||||
temperature:
|
||||
name: Wave Plus Temperature
|
||||
radon:
|
||||
name: Wave Plus Radon
|
||||
radon_long_term:
|
||||
name: Wave Plus Radon Long Term
|
||||
pressure:
|
||||
name: Wave Plus Pressure
|
||||
humidity:
|
||||
name: Wave Plus Humidity
|
||||
co2:
|
||||
name: Wave Plus CO2
|
||||
tvoc:
|
||||
name: Wave Plus VOC
|
||||
battery_voltage:
|
||||
name: Wave Plus Battery Voltage
|
|
@ -0,0 +1,28 @@
|
|||
esp32_ble_tracker:
|
||||
|
||||
ble_client:
|
||||
- mac_address: 01:02:03:04:05:06
|
||||
id: airthings01
|
||||
|
||||
sensor:
|
||||
- id: airthingswp
|
||||
platform: airthings_wave_plus
|
||||
ble_client_id: airthings01
|
||||
update_interval: 5min
|
||||
battery_update_interval: 12h
|
||||
temperature:
|
||||
name: Wave Plus Temperature
|
||||
radon:
|
||||
name: Wave Plus Radon
|
||||
radon_long_term:
|
||||
name: Wave Plus Radon Long Term
|
||||
pressure:
|
||||
name: Wave Plus Pressure
|
||||
humidity:
|
||||
name: Wave Plus Humidity
|
||||
co2:
|
||||
name: Wave Plus CO2
|
||||
tvoc:
|
||||
name: Wave Plus VOC
|
||||
battery_voltage:
|
||||
name: Wave Plus Battery Voltage
|
|
@ -671,6 +671,40 @@ display:
|
|||
full_update_every: 30
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
- platform: waveshare_epaper
|
||||
spi_id: spi_id_1
|
||||
cs_pin:
|
||||
allow_other_uses: true
|
||||
number: GPIO23
|
||||
dc_pin:
|
||||
allow_other_uses: true
|
||||
number: GPIO23
|
||||
busy_pin:
|
||||
allow_other_uses: true
|
||||
number: GPIO23
|
||||
reset_pin:
|
||||
allow_other_uses: true
|
||||
number: GPIO23
|
||||
model: 2.70in-b
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
- platform: waveshare_epaper
|
||||
spi_id: spi_id_1
|
||||
cs_pin:
|
||||
allow_other_uses: true
|
||||
number: GPIO23
|
||||
dc_pin:
|
||||
allow_other_uses: true
|
||||
number: GPIO23
|
||||
busy_pin:
|
||||
allow_other_uses: true
|
||||
number: GPIO23
|
||||
reset_pin:
|
||||
allow_other_uses: true
|
||||
number: GPIO23
|
||||
model: 2.70in-bv2
|
||||
lambda: |-
|
||||
it.rectangle(0, 0, it.get_width(), it.get_height());
|
||||
- platform: waveshare_epaper
|
||||
spi_id: spi_id_1
|
||||
cs_pin:
|
||||
|
|
Loading…
Reference in New Issue