Merge branch 'dev' into ds3232

This commit is contained in:
Vladimir A. Kozhevnikov 2024-02-11 21:38:49 +03:00 committed by GitHub
commit ab25cc4438
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
334 changed files with 7684 additions and 54 deletions

View File

@ -1,6 +1,8 @@
#include "cse7766.h"
#include "esphome/core/log.h"
#include <cinttypes>
#include <iomanip>
#include <sstream>
namespace esphome {
namespace cse7766 {
@ -68,20 +70,26 @@ bool CSE7766Component::check_byte_() {
return true;
}
void CSE7766Component::parse_data_() {
ESP_LOGVV(TAG, "CSE7766 Data: ");
for (uint8_t i = 0; i < 23; i++) {
ESP_LOGVV(TAG, " %u: 0b" BYTE_TO_BINARY_PATTERN " (0x%02X)", i + 1, BYTE_TO_BINARY(this->raw_data_[i]),
this->raw_data_[i]);
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERY_VERBOSE
{
std::stringstream ss;
ss << "Raw data:" << std::hex << std::uppercase << std::setfill('0');
for (uint8_t i = 0; i < 23; i++) {
ss << ' ' << std::setw(2) << static_cast<unsigned>(this->raw_data_[i]);
}
ESP_LOGVV(TAG, "%s", ss.str().c_str());
}
#endif
// Parse header
uint8_t header1 = this->raw_data_[0];
if (header1 == 0xAA) {
ESP_LOGE(TAG, "CSE7766 not calibrated!");
return;
}
bool power_cycle_exceeds_range = false;
if ((header1 & 0xF0) == 0xF0) {
if (header1 & 0xD) {
ESP_LOGE(TAG, "CSE7766 reports abnormal external circuit or chip damage: (0x%02X)", header1);
@ -94,74 +102,106 @@ void CSE7766Component::parse_data_() {
if (header1 & (1 << 0)) {
ESP_LOGE(TAG, " Coefficient storage area is abnormal.");
}
// Datasheet: voltage or current cycle exceeding range means invalid values
return;
}
power_cycle_exceeds_range = header1 & (1 << 1);
}
uint32_t voltage_calib = this->get_24_bit_uint_(2);
// Parse data frame
uint32_t voltage_coeff = this->get_24_bit_uint_(2);
uint32_t voltage_cycle = this->get_24_bit_uint_(5);
uint32_t current_calib = this->get_24_bit_uint_(8);
uint32_t current_coeff = this->get_24_bit_uint_(8);
uint32_t current_cycle = this->get_24_bit_uint_(11);
uint32_t power_calib = this->get_24_bit_uint_(14);
uint32_t power_coeff = this->get_24_bit_uint_(14);
uint32_t power_cycle = this->get_24_bit_uint_(17);
uint8_t adj = this->raw_data_[20];
uint32_t cf_pulses = (this->raw_data_[21] << 8) + this->raw_data_[22];
bool have_power = adj & 0x10;
bool have_current = adj & 0x20;
bool have_voltage = adj & 0x40;
float voltage = 0.0f;
if (have_voltage) {
// voltage cycle of serial port outputted is a complete cycle;
float voltage = voltage_calib / float(voltage_cycle);
if (this->voltage_sensor_ != nullptr)
voltage = voltage_coeff / float(voltage_cycle);
if (this->voltage_sensor_ != nullptr) {
this->voltage_sensor_->publish_state(voltage);
}
}
bool have_power = adj & 0x10;
float power = 0.0f;
if (have_power) {
// power cycle of serial port outputted is a complete cycle;
// According to the user manual, power cycle exceeding range means the measured power is 0
if (!power_cycle_exceeds_range) {
power = power_calib / float(power_cycle);
float energy = 0.0f;
if (power_cycle_exceeds_range) {
// Datasheet: power cycle exceeding range means active power is 0
if (this->power_sensor_ != nullptr) {
this->power_sensor_->publish_state(0.0f);
}
if (this->power_sensor_ != nullptr)
} else if (have_power) {
power = power_coeff / float(power_cycle);
if (this->power_sensor_ != nullptr) {
this->power_sensor_->publish_state(power);
}
// Add CF pulses to the total energy only if we have Power coefficient to multiply by
uint32_t difference;
if (this->cf_pulses_last_ == 0) {
this->cf_pulses_last_ = cf_pulses;
}
uint32_t cf_diff;
if (cf_pulses < this->cf_pulses_last_) {
difference = cf_pulses + (0x10000 - this->cf_pulses_last_);
cf_diff = cf_pulses + (0x10000 - this->cf_pulses_last_);
} else {
difference = cf_pulses - this->cf_pulses_last_;
cf_diff = cf_pulses - this->cf_pulses_last_;
}
this->cf_pulses_last_ = cf_pulses;
this->energy_total_ += difference * float(power_calib) / 1000000.0f / 3600.0f;
energy = cf_diff * float(power_coeff) / 1000000.0f / 3600.0f;
this->energy_total_ += energy;
if (this->energy_sensor_ != nullptr)
this->energy_sensor_->publish_state(this->energy_total_);
} else if ((this->energy_sensor_ != nullptr) && !this->energy_sensor_->has_state()) {
this->energy_sensor_->publish_state(0);
}
if (adj & 0x20) {
// indicates current cycle of serial port outputted is a complete cycle;
float current = 0.0f;
if (have_voltage && !have_power) {
// Testing has shown that when we have voltage and current but not power, that means the power is 0.
// We report a power of 0, which in turn means we should report a current of 0.
if (this->power_sensor_ != nullptr)
this->power_sensor_->publish_state(0);
} else if (power != 0.0f) {
current = current_calib / float(current_cycle);
float current = 0.0f;
float calculated_current = 0.0f;
if (have_current) {
// Assumption: if we don't have power measurement, then current is likely below 50mA
if (have_power && voltage > 1.0f) {
calculated_current = power / voltage;
}
if (this->current_sensor_ != nullptr)
// Datasheet: minimum measured current is 50mA
if (calculated_current > 0.05f) {
current = current_coeff / float(current_cycle);
}
if (this->current_sensor_ != nullptr) {
this->current_sensor_->publish_state(current);
}
}
#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERY_VERBOSE
{
std::stringstream ss;
ss << "Parsed:";
if (have_voltage) {
ss << " V=" << voltage << "V";
}
if (have_current) {
ss << " I=" << current * 1000.0f << "mA (~" << calculated_current * 1000.0f << "mA)";
}
if (have_power) {
ss << " P=" << power << "W";
}
if (energy != 0.0f) {
ss << " E=" << energy << "kWh (" << cf_pulses << ")";
}
ESP_LOGVV(TAG, "%s", ss.str().c_str());
}
#endif
}
uint32_t CSE7766Component::get_24_bit_uint_(uint8_t start_index) {

View File

@ -161,10 +161,12 @@ light::ESPColorView ESP32RMTLEDStripLightOutput::get_view_internal(int32_t index
break;
}
uint8_t multiplier = this->is_rgbw_ ? 4 : 3;
return {this->buf_ + (index * multiplier) + r,
this->buf_ + (index * multiplier) + g,
this->buf_ + (index * multiplier) + b,
this->is_rgbw_ ? this->buf_ + (index * multiplier) + 3 : nullptr,
uint8_t white = this->is_wrgb_ ? 0 : 3;
return {this->buf_ + (index * multiplier) + r + this->is_wrgb_,
this->buf_ + (index * multiplier) + g + this->is_wrgb_,
this->buf_ + (index * multiplier) + b + this->is_wrgb_,
this->is_rgbw_ || this->is_wrgb_ ? this->buf_ + (index * multiplier) + white : nullptr,
&this->effect_data_[index],
&this->correction_};
}

View File

@ -33,7 +33,7 @@ class ESP32RMTLEDStripLightOutput : public light::AddressableLight {
int32_t size() const override { return this->num_leds_; }
light::LightTraits get_traits() override {
auto traits = light::LightTraits();
if (this->is_rgbw_) {
if (this->is_rgbw_ || this->is_wrgb_) {
traits.set_supported_color_modes({light::ColorMode::RGB_WHITE, light::ColorMode::WHITE});
} else {
traits.set_supported_color_modes({light::ColorMode::RGB});
@ -44,6 +44,7 @@ class ESP32RMTLEDStripLightOutput : public light::AddressableLight {
void set_pin(uint8_t pin) { this->pin_ = pin; }
void set_num_leds(uint16_t num_leds) { this->num_leds_ = num_leds; }
void set_is_rgbw(bool is_rgbw) { this->is_rgbw_ = is_rgbw; }
void set_is_wrgb(bool is_wrgb) { this->is_wrgb_ = is_wrgb; }
/// Set a maximum refresh rate in µs as some lights do not like being updated too often.
void set_max_refresh_rate(uint32_t interval_us) { this->max_refresh_rate_ = interval_us; }
@ -72,6 +73,7 @@ class ESP32RMTLEDStripLightOutput : public light::AddressableLight {
uint8_t pin_;
uint16_t num_leds_;
bool is_rgbw_;
bool is_wrgb_;
rmt_item32_t bit0_, bit1_;
RGBOrder rgb_order_;

View File

@ -52,6 +52,7 @@ CHIPSETS = {
CONF_IS_RGBW = "is_rgbw"
CONF_IS_WRGB = "is_wrgb"
CONF_BIT0_HIGH = "bit0_high"
CONF_BIT0_LOW = "bit0_low"
CONF_BIT1_HIGH = "bit1_high"
@ -90,6 +91,7 @@ CONFIG_SCHEMA = cv.All(
cv.Optional(CONF_MAX_REFRESH_RATE): cv.positive_time_period_microseconds,
cv.Optional(CONF_CHIPSET): cv.one_of(*CHIPSETS, upper=True),
cv.Optional(CONF_IS_RGBW, default=False): cv.boolean,
cv.Optional(CONF_IS_WRGB, default=False): cv.boolean,
cv.Inclusive(
CONF_BIT0_HIGH,
"custom",
@ -145,6 +147,7 @@ async def to_code(config):
cg.add(var.set_rgb_order(config[CONF_RGB_ORDER]))
cg.add(var.set_is_rgbw(config[CONF_IS_RGBW]))
cg.add(var.set_is_wrgb(config[CONF_IS_WRGB]))
cg.add(
var.set_rmt_channel(

View File

@ -4,6 +4,7 @@ from esphome.const import (
KEY_TARGET_FRAMEWORK,
KEY_TARGET_PLATFORM,
PLATFORM_HOST,
CONF_MAC_ADDRESS,
)
from esphome.core import CORE
from esphome.helpers import IS_MACOS
@ -28,13 +29,18 @@ def set_core_data(config):
CONFIG_SCHEMA = cv.All(
cv.Schema({}),
cv.Schema(
{
cv.Optional(CONF_MAC_ADDRESS, default="98:35:69:ab:f6:79"): cv.mac_address,
}
),
set_core_data,
)
async def to_code(config):
cg.add_build_flag("-DUSE_HOST")
cg.add_define("USE_ESPHOME_HOST_MAC_ADDRESS", config[CONF_MAC_ADDRESS].parts)
cg.add_build_flag("-std=c++17")
cg.add_build_flag("-lsodium")
if IS_MACOS:

View File

@ -120,6 +120,7 @@ void LightState::loop() {
// Apply transformer (if any)
if (this->transformer_ != nullptr) {
auto values = this->transformer_->apply();
this->is_transformer_active_ = true;
if (values.has_value()) {
this->current_values = *values;
this->output_->update_state(this);
@ -131,6 +132,7 @@ void LightState::loop() {
this->current_values = this->transformer_->get_target_values();
this->transformer_->stop();
this->is_transformer_active_ = false;
this->transformer_ = nullptr;
this->target_state_reached_callback_.call();
}
@ -214,6 +216,8 @@ void LightState::current_values_as_ct(float *color_temperature, float *white_bri
this->gamma_correct_);
}
bool LightState::is_transformer_active() { return this->is_transformer_active_; }
void LightState::start_effect_(uint32_t effect_index) {
this->stop_effect_();
if (effect_index == 0)
@ -263,6 +267,7 @@ void LightState::start_flash_(const LightColorValues &target, uint32_t length, b
}
void LightState::set_immediately_(const LightColorValues &target, bool set_remote_values) {
this->is_transformer_active_ = false;
this->transformer_ = nullptr;
this->current_values = target;
if (set_remote_values) {

View File

@ -144,6 +144,17 @@ class LightState : public EntityBase, public Component {
void current_values_as_ct(float *color_temperature, float *white_brightness);
/**
* Indicator if a transformer (e.g. transition) is active. This is useful
* for effects e.g. at the start of the apply() method, add a check like:
*
* if (this->state_->is_transformer_active()) {
* // Something is already running.
* return;
* }
*/
bool is_transformer_active();
protected:
friend LightOutput;
friend LightCall;
@ -203,6 +214,9 @@ class LightState : public EntityBase, public Component {
LightRestoreMode restore_mode_;
/// List of effects for this light.
std::vector<LightEffect *> effects_;
// for effects, true if a transformer (transition) is active.
bool is_transformer_active_ = false;
};
} // namespace light

View File

@ -3,6 +3,8 @@
#include "esphome/core/component.h"
#include "esphome/core/hal.h"
#include <vector>
namespace esphome {
namespace lightwaverf {

View File

@ -212,6 +212,14 @@ void HOT Logger::log_message_(int level, const char *tag, int offset) {
return;
#endif
#ifdef USE_HOST
time_t rawtime;
struct tm *timeinfo;
char buffer[80];
time(&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer, sizeof buffer, "[%H:%M:%S]", timeinfo);
fputs(buffer, stdout);
puts(msg);
#endif

View File

@ -25,6 +25,7 @@ namespace sntp {
static const char *const TAG = "sntp";
void SNTPComponent::setup() {
#ifndef USE_HOST
ESP_LOGCONFIG(TAG, "Setting up SNTP...");
#if defined(USE_ESP32) || defined(USE_LIBRETINY)
if (sntp_enabled()) {
@ -48,6 +49,7 @@ void SNTPComponent::setup() {
#endif
sntp_init();
#endif
}
void SNTPComponent::dump_config() {
ESP_LOGCONFIG(TAG, "SNTP Time:");
@ -57,7 +59,7 @@ void SNTPComponent::dump_config() {
ESP_LOGCONFIG(TAG, " Timezone: '%s'", this->timezone_.c_str());
}
void SNTPComponent::update() {
#ifndef USE_ESP_IDF
#if !defined(USE_ESP_IDF) && !defined(USE_HOST)
// force resync
if (sntp_enabled()) {
sntp_stop();

View File

@ -28,7 +28,7 @@ class Filter {
* @param value The new value.
* @return An optional string, the new value that should be pushed out.
*/
virtual optional<std::string> new_value(std::string value);
virtual optional<std::string> new_value(std::string value) = 0;
/// Initialize this filter, please note this can be called more than once.
virtual void initialize(TextSensor *parent, Filter *next);

View File

@ -8,6 +8,8 @@ wled_ns = cg.esphome_ns.namespace("wled")
WLEDLightEffect = wled_ns.class_("WLEDLightEffect", AddressableLightEffect)
CONFIG_SCHEMA = cv.All(cv.Schema({}), cv.only_with_arduino)
CONF_SYNC_GROUP_MASK = "sync_group_mask"
CONF_BLANK_ON_START = "blank_on_start"
@register_addressable_effect(
@ -16,10 +18,13 @@ CONFIG_SCHEMA = cv.All(cv.Schema({}), cv.only_with_arduino)
"WLED",
{
cv.Optional(CONF_PORT, default=21324): cv.port,
cv.Optional(CONF_SYNC_GROUP_MASK, default=0): cv.int_range(min=0, max=255),
cv.Optional(CONF_BLANK_ON_START, default=True): cv.boolean,
},
)
async def wled_light_effect_to_code(config, effect_id):
effect = cg.new_Pvariable(effect_id, config[CONF_NAME])
cg.add(effect.set_port(config[CONF_PORT]))
cg.add(effect.set_sync_group_mask(config[CONF_SYNC_GROUP_MASK]))
cg.add(effect.set_blank_on_start(config[CONF_BLANK_ON_START]))
return effect

View File

@ -13,6 +13,10 @@
#include <WiFiUdp.h>
#endif
#ifdef USE_BK72XX
#include <WiFiUdp.h>
#endif
namespace esphome {
namespace wled {
@ -29,7 +33,11 @@ WLEDLightEffect::WLEDLightEffect(const std::string &name) : AddressableLightEffe
void WLEDLightEffect::start() {
AddressableLightEffect::start();
blank_at_ = 0;
if (this->blank_on_start_) {
this->blank_at_ = 0;
} else {
this->blank_at_ = UINT32_MAX;
}
}
void WLEDLightEffect::stop() {
@ -101,8 +109,11 @@ bool WLEDLightEffect::parse_frame_(light::AddressableLight &it, const uint8_t *p
if (!parse_drgb_frame_(it, payload, size))
return false;
} else {
if (!parse_notifier_frame_(it, payload, size))
if (!parse_notifier_frame_(it, payload, size)) {
return false;
} else {
timeout = UINT8_MAX;
}
}
break;
@ -143,8 +154,32 @@ bool WLEDLightEffect::parse_frame_(light::AddressableLight &it, const uint8_t *p
}
bool WLEDLightEffect::parse_notifier_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size) {
// Packet needs to be empty
return size == 0;
// Receive at least RGBW and Brightness for all LEDs from WLED Sync Notification
// https://kno.wled.ge/interfaces/udp-notifier/
// https://github.com/Aircoookie/WLED/blob/main/wled00/udp.cpp
if (size < 34) {
return false;
}
uint8_t payload_sync_group_mask = payload[34];
if ((payload_sync_group_mask & this->sync_group_mask_) != this->sync_group_mask_) {
ESP_LOGD(TAG, "sync group mask does not match");
return false;
}
uint8_t bri = payload[0];
uint8_t r = esp_scale8(payload[1], bri);
uint8_t g = esp_scale8(payload[2], bri);
uint8_t b = esp_scale8(payload[3], bri);
uint8_t w = esp_scale8(payload[8], bri);
for (auto &&led : it) {
led.set(Color(r, g, b, w));
}
return true;
}
bool WLEDLightEffect::parse_warls_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size) {

View File

@ -21,6 +21,8 @@ class WLEDLightEffect : public light::AddressableLightEffect {
void stop() override;
void apply(light::AddressableLight &it, const Color &current_color) override;
void set_port(uint16_t port) { this->port_ = port; }
void set_sync_group_mask(uint8_t mask) { this->sync_group_mask_ = mask; }
void set_blank_on_start(bool blank) { this->blank_on_start_ = blank; }
protected:
void blank_all_leds_(light::AddressableLight &it);
@ -35,6 +37,8 @@ class WLEDLightEffect : public light::AddressableLightEffect {
std::unique_ptr<UDP> udp_;
uint32_t blank_at_{0};
uint32_t dropped_{0};
uint8_t sync_group_mask_{0};
bool blank_on_start_{true};
};
} // namespace wled

View File

@ -1,8 +1,9 @@
#pragma once
#include <string>
#include <functional>
#include <cmath>
#include <cstdint>
#include <functional>
#include <string>
#include "esphome/core/optional.h"

View File

@ -11,6 +11,12 @@
#include <cstdio>
#include <cstring>
#ifdef USE_HOST
#include <net/if.h>
#include <netinet/in.h>
#include <sys/ioctl.h>
#include <unistd.h>
#endif
#if defined(USE_ESP8266)
#include <osapi.h>
#include <user_interface.h>
@ -415,7 +421,7 @@ std::string value_accuracy_to_string(float value, int8_t accuracy_decimals) {
int8_t step_to_accuracy_decimals(float step) {
// use printf %g to find number of digits based on temperature step
char buf[32];
sprintf(buf, "%.5g", step);
snprintf(buf, sizeof buf, "%.5g", step);
std::string str{buf};
size_t dot_pos = str.find('.');
@ -551,7 +557,10 @@ void HighFrequencyLoopRequester::stop() {
bool HighFrequencyLoopRequester::is_high_frequency() { return num_requests > 0; }
void get_mac_address_raw(uint8_t *mac) { // NOLINT(readability-non-const-parameter)
#if defined(USE_ESP32)
#if defined(USE_HOST)
static const uint8_t esphome_host_mac_address[6] = USE_ESPHOME_HOST_MAC_ADDRESS;
memcpy(mac, esphome_host_mac_address, sizeof(esphome_host_mac_address));
#elif defined(USE_ESP32)
#if defined(CONFIG_SOC_IEEE802154_SUPPORTED) || defined(USE_ESP32_IGNORE_EFUSE_MAC_CRC)
// When CONFIG_SOC_IEEE802154_SUPPORTED is defined, esp_efuse_mac_get_default
// returns the 802.15.4 EUI-64 address. Read directly from eFuse instead.
@ -569,6 +578,8 @@ void get_mac_address_raw(uint8_t *mac) { // NOLINT(readability-non-const-parame
WiFi.macAddress(mac);
#elif defined(USE_LIBRETINY)
WiFi.macAddress(mac);
#else
// this should be an error, but that messes with CI checks. #error No mac address method defined
#endif
}
std::string get_mac_address() {

View File

@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <cstdlib>
#include <ctime>
#include <string>

View File

@ -1,4 +1,5 @@
async_timeout==4.0.3; python_version <= "3.10"
cryptography==42.0.2
voluptuous==0.14.1
PyYAML==6.0.1
paho-mqtt==1.6.1
@ -12,7 +13,7 @@ platformio==6.1.13 # When updating platformio, also update Dockerfile
esptool==4.7.0
click==8.1.7
esphome-dashboard==20231107.0
aioesphomeapi==21.0.1
aioesphomeapi==21.0.2
zeroconf==0.131.0
python-magic==0.4.27

View File

@ -1,3 +1,2 @@
pillow==10.2.0
cairosvg==2.7.1
cryptography==41.0.4

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,64 @@
binary_sensor:
- platform: gpio
id: bin1
pin: 1
alarm_control_panel:
- platform: template
id: alarmcontrolpanel1
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_state:
then:
- lambda: !lambda |-
ESP_LOGD("TEST", "State change %s", LOG_STR_ARG(alarm_control_panel_state_to_string(id(alarmcontrolpanel1)->get_state())));
- platform: template
id: alarmcontrolpanel2
name: Alarm Panel
codes:
- "1234"
requires_code_to_arm: true
arming_home_time: 1s
arming_night_time: 1s
arming_away_time: 15s
pending_time: 15s
trigger_time: 30s
binary_sensors:
- input: bin1
bypass_armed_home: true
bypass_armed_night: true
on_disarmed:
then:
- logger.log: "### DISARMED ###"
on_pending:
then:
- logger.log: "### PENDING ###"
on_arming:
then:
- logger.log: "### ARMING ###"
on_armed_home:
then:
- logger.log: "### ARMED HOME ###"
on_armed_night:
then:
- logger.log: "### ARMED NIGHT ###"
on_armed_away:
then:
- logger.log: "### ARMED AWAY ###"
on_triggered:
then:
- logger.log: "### TRIGGERED ###"
on_cleared:
then:
- logger.log: "### CLEARED ###"

View File

@ -0,0 +1,17 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: alpha3_blec
sensor:
- platform: alpha3
ble_client_id: alpha3_blec
flow:
name: "Radiator Pump Flow"
head:
name: "Radiator Pump Head"
power:
name: "Radiator Pump Power"
speed:
name: "Radiator Pump Speed"

View File

@ -0,0 +1,17 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: alpha3_blec
sensor:
- platform: alpha3
ble_client_id: alpha3_blec
flow:
name: "Radiator Pump Flow"
head:
name: "Radiator Pump Head"
power:
name: "Radiator Pump Power"
speed:
name: "Radiator Pump Speed"

View File

@ -0,0 +1,17 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: alpha3_blec
sensor:
- platform: alpha3
ble_client_id: alpha3_blec
flow:
name: "Radiator Pump Flow"
head:
name: "Radiator Pump Head"
power:
name: "Radiator Pump Power"
speed:
name: "Radiator Pump Speed"

View File

@ -0,0 +1,17 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: alpha3_blec
sensor:
- platform: alpha3
ble_client_id: alpha3_blec
flow:
name: "Radiator Pump Flow"
head:
name: "Radiator Pump Head"
power:
name: "Radiator Pump Power"
speed:
name: "Radiator Pump Speed"

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 16
sda: 17
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 16
sda: 17
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,11 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
sensor:
- platform: am2320
temperature:
name: Temperature
humidity:
name: Humidity

View File

@ -0,0 +1,19 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: am43_blec
cover:
- platform: am43
name: Test AM43 Cover
id: am43_test
ble_client_id: am43_blec
sensor:
- platform: am43
ble_client_id: am43_blec
battery_level:
name: Kitchen blinds battery
illuminance:
name: Kitchen blinds light

View File

@ -0,0 +1,19 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: am43_blec
cover:
- platform: am43
name: Test AM43 Cover
id: am43_test
ble_client_id: am43_blec
sensor:
- platform: am43
ble_client_id: am43_blec
battery_level:
name: Kitchen blinds battery
illuminance:
name: Kitchen blinds light

View File

@ -0,0 +1,19 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: am43_blec
cover:
- platform: am43
name: Test AM43 Cover
id: am43_test
ble_client_id: am43_blec
sensor:
- platform: am43
ble_client_id: am43_blec
battery_level:
name: Kitchen blinds battery
illuminance:
name: Kitchen blinds light

View File

@ -0,0 +1,19 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: am43_blec
cover:
- platform: am43
name: Test AM43 Cover
id: am43_test
ble_client_id: am43_blec
sensor:
- platform: am43
ble_client_id: am43_blec
battery_level:
name: Kitchen blinds battery
illuminance:
name: Kitchen blinds light

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,28 @@
sensor:
- platform: template
id: template_sensor
name: Template Sensor
lambda: |-
if (millis() > 10000) {
return 42.0;
} else {
return 0.0;
}
update_interval: 15s
binary_sensor:
- platform: analog_threshold
name: Analog Threshold 1
sensor_id: template_sensor
threshold:
upper: 110
lower: 90
filters:
- delayed_on: 0s
- delayed_off: 10s
- platform: analog_threshold
name: Analog Threshold 2
sensor_id: template_sensor
threshold: 100
filters:
- invert:

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 6
mosi_pin: 7
miso_pin: 5
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 8
dc_pin: 9
reset_pin: 10
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 6
mosi_pin: 7
miso_pin: 5
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 8
dc_pin: 9
reset_pin: 10
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 16
mosi_pin: 17
miso_pin: 15
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 12
dc_pin: 13
reset_pin: 21
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 16
mosi_pin: 17
miso_pin: 15
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 12
dc_pin: 13
reset_pin: 21
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 14
mosi_pin: 13
miso_pin: 12
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 5
dc_pin: 15
reset_pin: 16
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,23 @@
spi:
- id: spi_main_lcd
clk_pin: 2
mosi_pin: 3
miso_pin: 4
display:
- platform: ili9xxx
id: main_lcd
model: ili9342
cs_pin: 20
dc_pin: 21
reset_pin: 22
# Purposely test that `animation:` does auto-load `image:`
# Keep the `image:` undefined.
# image:
animation:
- id: rgb565_animation
file: ../../pnglogo.png
type: RGB565
use_transparency: no

View File

@ -0,0 +1,11 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: anova_blec
climate:
- platform: anova
name: Anova cooker
ble_client_id: anova_blec
unit_of_measurement: c

View File

@ -0,0 +1,11 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: anova_blec
climate:
- platform: anova
name: Anova cooker
ble_client_id: anova_blec
unit_of_measurement: c

View File

@ -0,0 +1,11 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: anova_blec
climate:
- platform: anova
name: Anova cooker
ble_client_id: anova_blec
unit_of_measurement: c

View File

@ -0,0 +1,11 @@
esp32_ble_tracker:
ble_client:
- mac_address: 01:02:03:04:05:06
id: anova_blec
climate:
- platform: anova
name: Anova cooker
ble_client_id: anova_blec
unit_of_measurement: c

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
direction: up
name: APDS9960 Up
device_class: motion
filters:
- invert
- delayed_on: 20ms
- delayed_off: 20ms
- lambda: "return false;"
on_state:
- logger.log: New state
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
direction: up
name: APDS9960 Up
device_class: motion
filters:
- invert
- delayed_on: 20ms
- delayed_off: 20ms
- lambda: "return false;"
on_state:
- logger.log: New state
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 16
sda: 17
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
direction: up
name: APDS9960 Up
device_class: motion
filters:
- invert
- delayed_on: 20ms
- delayed_off: 20ms
- lambda: "return false;"
on_state:
- logger.log: New state
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 16
sda: 17
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
direction: up
name: APDS9960 Up
device_class: motion
filters:
- invert
- delayed_on: 20ms
- delayed_off: 20ms
- lambda: "return false;"
on_state:
- logger.log: New state
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
direction: up
name: APDS9960 Up
device_class: motion
filters:
- invert
- delayed_on: 20ms
- delayed_off: 20ms
- lambda: "return false;"
on_state:
- logger.log: New state
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,48 @@
i2c:
- id: i2c_bme280
scl: 5
sda: 4
apds9960:
address: 0x20
update_interval: 60s
binary_sensor:
- platform: apds9960
id: apds9960_binary_sensor
direction: up
name: APDS9960 Up
device_class: motion
filters:
- invert
- delayed_on: 20ms
- delayed_off: 20ms
- lambda: "return false;"
on_state:
- logger.log: New state
- platform: apds9960
direction: down
name: APDS9960 Down
- platform: apds9960
direction: left
name: APDS9960 Left
- platform: apds9960
direction: right
name: APDS9960 Right
sensor:
- platform: apds9960
type: proximity
name: APDS9960 Proximity
- platform: apds9960
type: clear
name: APDS9960 Clear
- platform: apds9960
type: red
name: APDS9960 Red
- platform: apds9960
type: green
name: APDS9960 Green
- platform: apds9960
type: blue
name: APDS9960 Blue

View File

@ -0,0 +1,50 @@
wifi:
ssid: MySSID
password: password1
api:
port: 8000
password: pwd
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
services:
- service: hello_world
variables:
name: string
then:
- logger.log:
format: Hello World %s!
args:
- name.c_str()
- service: empty_service
then:
- logger.log: Service Called
- service: all_types
variables:
bool_: bool
int_: int
float_: float
string_: string
then:
- logger.log: Something happened
- service: array_types
variables:
bool_arr: bool[]
int_arr: int[]
float_arr: float[]
string_arr: string[]
then:
- logger.log:
# yamllint disable rule:line-length
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
# yamllint enable rule:line-length
args:
- YESNO(bool_arr[0])
- bool_arr.size()
- int_arr[0]
- int_arr.size()
- float_arr[0]
- float_arr.size()
- string_arr[0].c_str()
- string_arr.size()

View File

@ -0,0 +1,50 @@
wifi:
ssid: MySSID
password: password1
api:
port: 8000
password: pwd
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
services:
- service: hello_world
variables:
name: string
then:
- logger.log:
format: Hello World %s!
args:
- name.c_str()
- service: empty_service
then:
- logger.log: Service Called
- service: all_types
variables:
bool_: bool
int_: int
float_: float
string_: string
then:
- logger.log: Something happened
- service: array_types
variables:
bool_arr: bool[]
int_arr: int[]
float_arr: float[]
string_arr: string[]
then:
- logger.log:
# yamllint disable rule:line-length
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
# yamllint enable rule:line-length
args:
- YESNO(bool_arr[0])
- bool_arr.size()
- int_arr[0]
- int_arr.size()
- float_arr[0]
- float_arr.size()
- string_arr[0].c_str()
- string_arr.size()

View File

@ -0,0 +1,50 @@
wifi:
ssid: MySSID
password: password1
api:
port: 8000
password: pwd
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
services:
- service: hello_world
variables:
name: string
then:
- logger.log:
format: Hello World %s!
args:
- name.c_str()
- service: empty_service
then:
- logger.log: Service Called
- service: all_types
variables:
bool_: bool
int_: int
float_: float
string_: string
then:
- logger.log: Something happened
- service: array_types
variables:
bool_arr: bool[]
int_arr: int[]
float_arr: float[]
string_arr: string[]
then:
- logger.log:
# yamllint disable rule:line-length
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
# yamllint enable rule:line-length
args:
- YESNO(bool_arr[0])
- bool_arr.size()
- int_arr[0]
- int_arr.size()
- float_arr[0]
- float_arr.size()
- string_arr[0].c_str()
- string_arr.size()

View File

@ -0,0 +1,50 @@
wifi:
ssid: MySSID
password: password1
api:
port: 8000
password: pwd
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
services:
- service: hello_world
variables:
name: string
then:
- logger.log:
format: Hello World %s!
args:
- name.c_str()
- service: empty_service
then:
- logger.log: Service Called
- service: all_types
variables:
bool_: bool
int_: int
float_: float
string_: string
then:
- logger.log: Something happened
- service: array_types
variables:
bool_arr: bool[]
int_arr: int[]
float_arr: float[]
string_arr: string[]
then:
- logger.log:
# yamllint disable rule:line-length
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
# yamllint enable rule:line-length
args:
- YESNO(bool_arr[0])
- bool_arr.size()
- int_arr[0]
- int_arr.size()
- float_arr[0]
- float_arr.size()
- string_arr[0].c_str()
- string_arr.size()

View File

@ -0,0 +1,50 @@
wifi:
ssid: MySSID
password: password1
api:
port: 8000
password: pwd
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
services:
- service: hello_world
variables:
name: string
then:
- logger.log:
format: Hello World %s!
args:
- name.c_str()
- service: empty_service
then:
- logger.log: Service Called
- service: all_types
variables:
bool_: bool
int_: int
float_: float
string_: string
then:
- logger.log: Something happened
- service: array_types
variables:
bool_arr: bool[]
int_arr: int[]
float_arr: float[]
string_arr: string[]
then:
- logger.log:
# yamllint disable rule:line-length
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
# yamllint enable rule:line-length
args:
- YESNO(bool_arr[0])
- bool_arr.size()
- int_arr[0]
- int_arr.size()
- float_arr[0]
- float_arr.size()
- string_arr[0].c_str()
- string_arr.size()

View File

@ -0,0 +1,50 @@
wifi:
ssid: MySSID
password: password1
api:
port: 8000
password: pwd
reboot_timeout: 0min
encryption:
key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU=
services:
- service: hello_world
variables:
name: string
then:
- logger.log:
format: Hello World %s!
args:
- name.c_str()
- service: empty_service
then:
- logger.log: Service Called
- service: all_types
variables:
bool_: bool
int_: int
float_: float
string_: string
then:
- logger.log: Something happened
- service: array_types
variables:
bool_arr: bool[]
int_arr: int[]
float_arr: float[]
string_arr: string[]
then:
- logger.log:
# yamllint disable rule:line-length
format: "Bool: %s (%u), Int: %d (%u), Float: %f (%u), String: %s (%u)"
# yamllint enable rule:line-length
args:
- YESNO(bool_arr[0])
- bool_arr.size()
- int_arr[0]
- int_arr.size()
- float_arr[0]
- float_arr.size()
- string_arr[0].c_str()
- string_arr.size()

View File

@ -0,0 +1,18 @@
i2c:
- id: i2c_as3935
scl: 5
sda: 4
as3935_i2c:
irq_pin: 6
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,18 @@
i2c:
- id: i2c_as3935
scl: 5
sda: 4
as3935_i2c:
irq_pin: 6
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,18 @@
i2c:
- id: i2c_as3935
scl: 16
sda: 17
as3935_i2c:
irq_pin: 12
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,18 @@
i2c:
- id: i2c_as3935
scl: 16
sda: 17
as3935_i2c:
irq_pin: 12
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,18 @@
i2c:
- id: i2c_as3935
scl: 5
sda: 4
as3935_i2c:
irq_pin: 15
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,18 @@
i2c:
- id: i2c_as3935
scl: 5
sda: 4
as3935_i2c:
irq_pin: 6
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,20 @@
spi:
- id: spi_as3935
clk_pin: 6
mosi_pin: 7
miso_pin: 5
as3935_spi:
cs_pin: 2
irq_pin: 3
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,20 @@
spi:
- id: spi_as3935
clk_pin: 6
mosi_pin: 7
miso_pin: 5
as3935_spi:
cs_pin: 2
irq_pin: 3
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,20 @@
spi:
- id: spi_as3935
clk_pin: 16
mosi_pin: 17
miso_pin: 15
as3935_spi:
cs_pin: 12
irq_pin: 13
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,20 @@
spi:
- id: spi_as3935
clk_pin: 16
mosi_pin: 17
miso_pin: 15
as3935_spi:
cs_pin: 12
irq_pin: 13
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,20 @@
spi:
- id: spi_as3935
clk_pin: 14
mosi_pin: 13
miso_pin: 12
as3935_spi:
cs_pin: 15
irq_pin: 16
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,20 @@
spi:
- id: spi_as3935
clk_pin: 2
mosi_pin: 3
miso_pin: 4
as3935_spi:
cs_pin: 6
irq_pin: 7
binary_sensor:
- platform: as3935
name: Storm Alert
sensor:
- platform: as3935
lightning_energy:
name: Lightning Energy
distance:
name: Distance Storm

View File

@ -0,0 +1,27 @@
i2c:
- id: i2c_as5600
scl: 5
sda: 4
as5600:
dir_pin: 6
direction: clockwise
start_position: 90deg
range: 180deg
watchdog: true
power_mode: low1
hysteresis: lsb1
slow_filter: 8x
fast_filter: lsb6
sensor:
- platform: as5600
name: AS5600 Position
raw_position:
name: AS5600 Raw Position
gain:
name: AS5600 Gain
magnitude:
name: AS5600 Magnitude
status:
name: AS5600 Status

View File

@ -0,0 +1,27 @@
i2c:
- id: i2c_as5600
scl: 5
sda: 4
as5600:
dir_pin: 6
direction: clockwise
start_position: 90deg
range: 180deg
watchdog: true
power_mode: low1
hysteresis: lsb1
slow_filter: 8x
fast_filter: lsb6
sensor:
- platform: as5600
name: AS5600 Position
raw_position:
name: AS5600 Raw Position
gain:
name: AS5600 Gain
magnitude:
name: AS5600 Magnitude
status:
name: AS5600 Status

View File

@ -0,0 +1,27 @@
i2c:
- id: i2c_as5600
scl: 16
sda: 17
as5600:
dir_pin: 12
direction: clockwise
start_position: 90deg
range: 180deg
watchdog: true
power_mode: low1
hysteresis: lsb1
slow_filter: 8x
fast_filter: lsb6
sensor:
- platform: as5600
name: AS5600 Position
raw_position:
name: AS5600 Raw Position
gain:
name: AS5600 Gain
magnitude:
name: AS5600 Magnitude
status:
name: AS5600 Status

View File

@ -0,0 +1,27 @@
i2c:
- id: i2c_as5600
scl: 16
sda: 17
as5600:
dir_pin: 12
direction: clockwise
start_position: 90deg
range: 180deg
watchdog: true
power_mode: low1
hysteresis: lsb1
slow_filter: 8x
fast_filter: lsb6
sensor:
- platform: as5600
name: AS5600 Position
raw_position:
name: AS5600 Raw Position
gain:
name: AS5600 Gain
magnitude:
name: AS5600 Magnitude
status:
name: AS5600 Status

View File

@ -0,0 +1,27 @@
i2c:
- id: i2c_as5600
scl: 5
sda: 4
as5600:
dir_pin: 15
direction: clockwise
start_position: 90deg
range: 180deg
watchdog: true
power_mode: low1
hysteresis: lsb1
slow_filter: 8x
fast_filter: lsb6
sensor:
- platform: as5600
name: AS5600 Position
raw_position:
name: AS5600 Raw Position
gain:
name: AS5600 Gain
magnitude:
name: AS5600 Magnitude
status:
name: AS5600 Status

View File

@ -0,0 +1,27 @@
i2c:
- id: i2c_as5600
scl: 5
sda: 4
as5600:
dir_pin: 6
direction: clockwise
start_position: 90deg
range: 180deg
watchdog: true
power_mode: low1
hysteresis: lsb1
slow_filter: 8x
fast_filter: lsb6
sensor:
- platform: as5600
name: AS5600 Position
raw_position:
name: AS5600 Raw Position
gain:
name: AS5600 Gain
magnitude:
name: AS5600 Magnitude
status:
name: AS5600 Status

View File

@ -0,0 +1,31 @@
i2c:
- id: i2c_as5600
scl: 5
sda: 4
sensor:
- platform: as7341
update_interval: 15s
gain: X8
atime: 120
astep: 99
f1:
name: F1
f2:
name: F2
f3:
name: F3
f4:
name: F4
f5:
name: F5
f6:
name: F6
f7:
name: F7
f8:
name: F8
clear:
name: Clear
nir:
name: NIR

View File

@ -0,0 +1,31 @@
i2c:
- id: i2c_as5600
scl: 5
sda: 4
sensor:
- platform: as7341
update_interval: 15s
gain: X8
atime: 120
astep: 99
f1:
name: F1
f2:
name: F2
f3:
name: F3
f4:
name: F4
f5:
name: F5
f6:
name: F6
f7:
name: F7
f8:
name: F8
clear:
name: Clear
nir:
name: NIR

View File

@ -0,0 +1,31 @@
i2c:
- id: i2c_as5600
scl: 16
sda: 17
sensor:
- platform: as7341
update_interval: 15s
gain: X8
atime: 120
astep: 99
f1:
name: F1
f2:
name: F2
f3:
name: F3
f4:
name: F4
f5:
name: F5
f6:
name: F6
f7:
name: F7
f8:
name: F8
clear:
name: Clear
nir:
name: NIR

View File

@ -0,0 +1,31 @@
i2c:
- id: i2c_as5600
scl: 16
sda: 17
sensor:
- platform: as7341
update_interval: 15s
gain: X8
atime: 120
astep: 99
f1:
name: F1
f2:
name: F2
f3:
name: F3
f4:
name: F4
f5:
name: F5
f6:
name: F6
f7:
name: F7
f8:
name: F8
clear:
name: Clear
nir:
name: NIR

View File

@ -0,0 +1,31 @@
i2c:
- id: i2c_as5600
scl: 5
sda: 4
sensor:
- platform: as7341
update_interval: 15s
gain: X8
atime: 120
astep: 99
f1:
name: F1
f2:
name: F2
f3:
name: F3
f4:
name: F4
f5:
name: F5
f6:
name: F6
f7:
name: F7
f8:
name: F8
clear:
name: Clear
nir:
name: NIR

View File

@ -0,0 +1,31 @@
i2c:
- id: i2c_as5600
scl: 5
sda: 4
sensor:
- platform: as7341
update_interval: 15s
gain: X8
atime: 120
astep: 99
f1:
name: F1
f2:
name: F2
f3:
name: F3
f4:
name: F4
f5:
name: F5
f6:
name: F6
f7:
name: F7
f8:
name: F8
clear:
name: Clear
nir:
name: NIR

View File

@ -0,0 +1,13 @@
esp32_ble_tracker:
sensor:
- platform: atc_mithermometer
mac_address: A4:C1:38:4E:16:78
temperature:
name: ATC Temperature
humidity:
name: ATC Humidity
battery_level:
name: ATC Battery-Level
battery_voltage:
name: ATC Battery-Voltage

View File

@ -0,0 +1,13 @@
esp32_ble_tracker:
sensor:
- platform: atc_mithermometer
mac_address: A4:C1:38:4E:16:78
temperature:
name: ATC Temperature
humidity:
name: ATC Humidity
battery_level:
name: ATC Battery-Level
battery_voltage:
name: ATC Battery-Voltage

View File

@ -0,0 +1,13 @@
esp32_ble_tracker:
sensor:
- platform: atc_mithermometer
mac_address: A4:C1:38:4E:16:78
temperature:
name: ATC Temperature
humidity:
name: ATC Humidity
battery_level:
name: ATC Battery-Level
battery_voltage:
name: ATC Battery-Voltage

View File

@ -0,0 +1,13 @@
esp32_ble_tracker:
sensor:
- platform: atc_mithermometer
mac_address: A4:C1:38:4E:16:78
temperature:
name: ATC Temperature
humidity:
name: ATC Humidity
battery_level:
name: ATC Battery-Level
battery_voltage:
name: ATC Battery-Voltage

View File

@ -0,0 +1,26 @@
spi:
- id: spi_atm90e26
clk_pin: 6
mosi_pin: 7
miso_pin: 5
sensor:
- platform: atm90e26
cs_pin: 8
voltage:
name: Line Voltage
current:
name: CT Amps
power:
name: Active Watts
power_factor:
name: Power Factor
frequency:
name: Line Frequency
line_frequency: 50Hz
meter_constant: 1000
pl_const: 1429876
gain_pga: 1X
gain_metering: 7481
gain_voltage: 26400
gain_ct: 31251

View File

@ -0,0 +1,26 @@
spi:
- id: spi_atm90e26
clk_pin: 6
mosi_pin: 7
miso_pin: 5
sensor:
- platform: atm90e26
cs_pin: 8
voltage:
name: Line Voltage
current:
name: CT Amps
power:
name: Active Watts
power_factor:
name: Power Factor
frequency:
name: Line Frequency
line_frequency: 50Hz
meter_constant: 1000
pl_const: 1429876
gain_pga: 1X
gain_metering: 7481
gain_voltage: 26400
gain_ct: 31251

View File

@ -0,0 +1,26 @@
spi:
- id: spi_atm90e26
clk_pin: 16
mosi_pin: 17
miso_pin: 15
sensor:
- platform: atm90e26
cs_pin: 13
voltage:
name: Line Voltage
current:
name: CT Amps
power:
name: Active Watts
power_factor:
name: Power Factor
frequency:
name: Line Frequency
line_frequency: 50Hz
meter_constant: 1000
pl_const: 1429876
gain_pga: 1X
gain_metering: 7481
gain_voltage: 26400
gain_ct: 31251

View File

@ -0,0 +1,26 @@
spi:
- id: spi_atm90e26
clk_pin: 16
mosi_pin: 17
miso_pin: 15
sensor:
- platform: atm90e26
cs_pin: 13
voltage:
name: Line Voltage
current:
name: CT Amps
power:
name: Active Watts
power_factor:
name: Power Factor
frequency:
name: Line Frequency
line_frequency: 50Hz
meter_constant: 1000
pl_const: 1429876
gain_pga: 1X
gain_metering: 7481
gain_voltage: 26400
gain_ct: 31251

View File

@ -0,0 +1,26 @@
spi:
- id: spi_atm90e26
clk_pin: 14
mosi_pin: 13
miso_pin: 12
sensor:
- platform: atm90e26
cs_pin: 5
voltage:
name: Line Voltage
current:
name: CT Amps
power:
name: Active Watts
power_factor:
name: Power Factor
frequency:
name: Line Frequency
line_frequency: 50Hz
meter_constant: 1000
pl_const: 1429876
gain_pga: 1X
gain_metering: 7481
gain_voltage: 26400
gain_ct: 31251

Some files were not shown because too many files have changed in this diff Show More