1
0
mirror of https://github.com/esphome/esphome.git synced 2026-03-21 18:56:45 +01:00

Command retain option for MQTT component (#3078)

This commit is contained in:
VitaliyKurokhtin 2022-01-23 00:05:37 -08:00 committed by GitHub
parent 97681d142e
commit 8187a4bce9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 304 additions and 289 deletions

View File

@ -11,6 +11,7 @@ from esphome.const import (
CONF_BROKER,
CONF_CLIENT_ID,
CONF_COMMAND_TOPIC,
CONF_COMMAND_RETAIN,
CONF_DISCOVERY,
CONF_DISCOVERY_PREFIX,
CONF_DISCOVERY_RETAIN,
@ -392,6 +393,8 @@ async def register_mqtt_component(var, config):
cg.add(var.set_custom_state_topic(config[CONF_STATE_TOPIC]))
if CONF_COMMAND_TOPIC in config:
cg.add(var.set_custom_command_topic(config[CONF_COMMAND_TOPIC]))
if CONF_COMMAND_RETAIN in config:
cg.add(var.set_command_retain(config[CONF_COMMAND_RETAIN]))
if CONF_AVAILABILITY in config:
availability = config[CONF_AVAILABILITY]
if not availability:

View File

@ -92,6 +92,8 @@ bool MQTTComponent::send_discovery_() {
root[MQTT_STATE_TOPIC] = this->get_state_topic_();
if (config.command_topic)
root[MQTT_COMMAND_TOPIC] = this->get_command_topic_();
if (this->command_retain_)
root[MQTT_COMMAND_RETAIN] = true;
if (this->availability_ == nullptr) {
if (!global_mqtt_client->get_availability().topic.empty()) {
@ -165,6 +167,7 @@ void MQTTComponent::set_custom_state_topic(const std::string &custom_state_topic
void MQTTComponent::set_custom_command_topic(const std::string &custom_command_topic) {
this->custom_command_topic_ = custom_command_topic;
}
void MQTTComponent::set_command_retain(bool command_retain) { this->command_retain_ = command_retain; }
void MQTTComponent::set_availability(std::string topic, std::string payload_available,
std::string payload_not_available) {

View File

@ -91,6 +91,8 @@ class MQTTComponent : public Component {
void set_custom_state_topic(const std::string &custom_state_topic);
/// Set a custom command topic. Set to "" for default behavior.
void set_custom_command_topic(const std::string &custom_command_topic);
/// Set whether command message should be retained.
void set_command_retain(bool command_retain);
/// MQTT_COMPONENT setup priority.
float get_setup_priority() const override;
@ -188,6 +190,7 @@ class MQTTComponent : public Component {
std::string custom_state_topic_{};
std::string custom_command_topic_{};
bool command_retain_{false};
bool retain_{true};
bool discovery_enabled_{true};
std::unique_ptr<Availability> availability_;

View File

@ -45,6 +45,7 @@ constexpr const char *const MQTT_CLEANING_TEMPLATE = "cln_tpl";
constexpr const char *const MQTT_COMMAND_OFF_TEMPLATE = "cmd_off_tpl";
constexpr const char *const MQTT_COMMAND_ON_TEMPLATE = "cmd_on_tpl";
constexpr const char *const MQTT_COMMAND_TOPIC = "cmd_t";
constexpr const char *const MQTT_COMMAND_RETAIN = "ret";
constexpr const char *const MQTT_COMMAND_TEMPLATE = "cmd_tpl";
constexpr const char *const MQTT_CODE_ARM_REQUIRED = "cod_arm_req";
constexpr const char *const MQTT_CODE_DISARM_REQUIRED = "cod_dis_req";
@ -297,6 +298,7 @@ constexpr const char *const MQTT_CLEANING_TEMPLATE = "cleaning_template";
constexpr const char *const MQTT_COMMAND_OFF_TEMPLATE = "command_off_template";
constexpr const char *const MQTT_COMMAND_ON_TEMPLATE = "command_on_template";
constexpr const char *const MQTT_COMMAND_TOPIC = "command_topic";
constexpr const char *const MQTT_COMMAND_RETAIN = "retain";
constexpr const char *const MQTT_COMMAND_TEMPLATE = "command_template";
constexpr const char *const MQTT_CODE_ARM_REQUIRED = "code_arm_required";
constexpr const char *const MQTT_CODE_DISARM_REQUIRED = "code_disarm_required";

View File

@ -17,6 +17,7 @@ from esphome.const import (
ALLOWED_NAME_CHARS,
CONF_AVAILABILITY,
CONF_COMMAND_TOPIC,
CONF_COMMAND_RETAIN,
CONF_DISABLED_BY_DEFAULT,
CONF_DISCOVERY,
CONF_ENTITY_CATEGORY,
@ -1591,6 +1592,7 @@ MQTT_COMPONENT_SCHEMA = Schema(
MQTT_COMMAND_COMPONENT_SCHEMA = MQTT_COMPONENT_SCHEMA.extend(
{
Optional(CONF_COMMAND_TOPIC): All(requires_component("mqtt"), subscribe_topic),
Optional(CONF_COMMAND_RETAIN): All(requires_component("mqtt"), boolean),
}
)

View File

@ -106,6 +106,7 @@ CONF_COLOR_MODE = "color_mode"
CONF_COLOR_TEMPERATURE = "color_temperature"
CONF_COLORS = "colors"
CONF_COMMAND = "command"
CONF_COMMAND_RETAIN = "command_retain"
CONF_COMMAND_TOPIC = "command_topic"
CONF_COMMENT = "comment"
CONF_COMMIT = "commit"

View File

@ -29,7 +29,7 @@ esphome:
range_from: 0
range_to: 100
red: 100%
green: !lambda 'return 255;'
green: !lambda "return 255;"
blue: 0%
white: 100%
- http_request.get:
@ -43,18 +43,18 @@ esphome:
json:
key: !lambda |-
return id(${textname}_text).state;
greeting: 'Hello World'
greeting: "Hello World"
- http_request.send:
method: PUT
url: https://esphome.io
headers:
Content-Type: application/json
body: 'Some data'
body: "Some data"
verify_ssl: false
on_response:
then:
- logger.log:
format: 'Response status: %d'
format: "Response status: %d"
args:
- status_code
build_path: build/test1
@ -65,12 +65,12 @@ packages:
wifi:
networks:
- ssid: 'MySSID'
password: 'password1'
- ssid: 'MySSID2'
password: ''
- ssid: "MySSID"
password: "password1"
- ssid: "MySSID2"
password: ""
channel: 14
bssid: 'A1:63:95:47:D3:1D'
bssid: "A1:63:95:47:D3:1D"
manual_ip:
static_ip: 192.168.178.230
gateway: 192.168.178.1
@ -89,10 +89,10 @@ http_request:
timeout: 10s
mqtt:
broker: '192.168.178.84'
broker: "192.168.178.84"
port: 1883
username: 'debug'
password: 'debug'
username: "debug"
password: "debug"
client_id: someclient
use_abbreviations: false
discovery: True
@ -153,7 +153,7 @@ mqtt:
return effect;
- light.control:
id: ${roomname}_lights
brightness: !lambda 'return id(${roomname}_lights).current_values.get_brightness() + 0.5;'
brightness: !lambda "return id(${roomname}_lights).current_values.get_brightness() + 0.5;"
- light.dim_relative:
id: ${roomname}_lights
relative_brightness: 5%
@ -215,7 +215,7 @@ uart:
ota:
safe_mode: True
password: 'superlongpasswordthatnoonewillknow'
password: "superlongpasswordthatnoonewillknow"
port: 3286
reboot_timeout: 2min
num_attempts: 5
@ -252,7 +252,7 @@ web_server:
js_url: https://esphome.io/_static/webserver-v1.min.js
power_supply:
id: 'atx_power_supply'
id: "atx_power_supply"
enable_time: 20ms
keep_on_time: 10s
pin:
@ -294,22 +294,22 @@ ble_client:
then:
- switch.turn_on: ble1_status
mcp23s08:
- id: 'mcp23s08_hub'
- id: "mcp23s08_hub"
cs_pin: GPIO12
deviceaddress: 0
mcp23s17:
- id: 'mcp23s17_hub'
- id: "mcp23s17_hub"
cs_pin: GPIO12
deviceaddress: 1
sensor:
- platform: ble_client
ble_client_id: ble_foo
name: 'Green iTag btn'
service_uuid: 'ffe0'
characteristic_uuid: 'ffe1'
descriptor_uuid: 'ffe2'
name: "Green iTag btn"
service_uuid: "ffe0"
characteristic_uuid: "ffe1"
descriptor_uuid: "ffe2"
notify: true
update_interval: never
lambda: |-
@ -321,11 +321,11 @@ sensor:
ESP_LOGD("green_btn", "Button was pressed, val%f", x);
- platform: adc
pin: A0
name: 'Living Room Brightness'
update_interval: '1:01'
name: "Living Room Brightness"
update_interval: "1:01"
attenuation: 2.5db
unit_of_measurement: '°C'
icon: 'mdi:water-percent'
unit_of_measurement: "°C"
icon: "mdi:water-percent"
accuracy_decimals: 5
expire_after: 120s
setup_priority: -100
@ -390,9 +390,9 @@ sensor:
ESP_LOGD("main", "Got raw value %f", x);
- logger.log:
level: DEBUG
format: 'Got raw value %f'
args: ['x']
- logger.log: 'Got raw value NAN'
format: "Got raw value %f"
args: ["x"]
- logger.log: "Got raw value NAN"
- mqtt.publish:
topic: some/topic
payload: Hello
@ -401,7 +401,7 @@ sensor:
- platform: esp32_hall
name: ESP32 Hall Sensor
- platform: ads1115
multiplexer: 'A0_A1'
multiplexer: "A0_A1"
gain: 1.024
id: ${sensorname}_sensor
filters:
@ -412,48 +412,48 @@ sensor:
cs_pin: 5
phase_a:
voltage:
name: 'EMON Line Voltage A'
name: "EMON Line Voltage A"
current:
name: 'EMON CT1 Current'
name: "EMON CT1 Current"
power:
name: 'EMON Active Power CT1'
name: "EMON Active Power CT1"
reactive_power:
name: 'EMON Reactive Power CT1'
name: "EMON Reactive Power CT1"
power_factor:
name: 'EMON Power Factor CT1'
name: "EMON Power Factor CT1"
gain_voltage: 7305
gain_ct: 27961
phase_b:
current:
name: 'EMON CT2 Current'
name: "EMON CT2 Current"
power:
name: 'EMON Active Power CT2'
name: "EMON Active Power CT2"
reactive_power:
name: 'EMON Reactive Power CT2'
name: "EMON Reactive Power CT2"
power_factor:
name: 'EMON Power Factor CT2'
name: "EMON Power Factor CT2"
gain_voltage: 7305
gain_ct: 27961
phase_c:
current:
name: 'EMON CT3 Current'
name: "EMON CT3 Current"
power:
name: 'EMON Active Power CT3'
name: "EMON Active Power CT3"
reactive_power:
name: 'EMON Reactive Power CT3'
name: "EMON Reactive Power CT3"
power_factor:
name: 'EMON Power Factor CT3'
name: "EMON Power Factor CT3"
gain_voltage: 7305
gain_ct: 27961
frequency:
name: 'EMON Line Frequency'
name: "EMON Line Frequency"
chip_temperature:
name: 'EMON Chip Temp A'
name: "EMON Chip Temp A"
line_frequency: 60Hz
current_phases: 3
gain_pga: 2X
- platform: bh1750
name: 'Living Room Brightness 3'
name: "Living Room Brightness 3"
internal: true
address: 0x23
resolution: 1.0
@ -465,13 +465,13 @@ sensor:
i2c_id: i2c_bus
- platform: bme280
temperature:
name: 'Outside Temperature'
name: "Outside Temperature"
oversampling: 16x
pressure:
name: 'Outside Pressure'
name: "Outside Pressure"
oversampling: none
humidity:
name: 'Outside Humidity'
name: "Outside Humidity"
oversampling: 8x
address: 0x77
iir_filter: 16x
@ -479,14 +479,14 @@ sensor:
i2c_id: i2c_bus
- platform: bme680
temperature:
name: 'Outside Temperature'
name: "Outside Temperature"
oversampling: 16x
pressure:
name: 'Outside Pressure'
name: "Outside Pressure"
humidity:
name: 'Outside Humidity'
name: "Outside Humidity"
gas_resistance:
name: 'Outside Gas Sensor'
name: "Outside Gas Sensor"
address: 0x77
heater:
temperature: 320
@ -495,9 +495,9 @@ sensor:
i2c_id: i2c_bus
- platform: bmp085
temperature:
name: 'Outside Temperature'
name: "Outside Temperature"
pressure:
name: 'Outside Pressure'
name: "Outside Pressure"
filters:
- lambda: >-
return x / powf(1.0 - (x / 44330.0), 5.255);
@ -505,47 +505,47 @@ sensor:
i2c_id: i2c_bus
- platform: bmp280
temperature:
name: 'Outside Temperature'
name: "Outside Temperature"
oversampling: 16x
pressure:
name: 'Outside Pressure'
name: "Outside Pressure"
address: 0x77
update_interval: 15s
iir_filter: 16x
i2c_id: i2c_bus
- platform: dallas
address: 0x1C0000031EDD2A28
name: 'Living Room Temperature'
name: "Living Room Temperature"
resolution: 9
- platform: dallas
index: 1
name: 'Living Room Temperature 2'
name: "Living Room Temperature 2"
- platform: dht
pin: GPIO26
temperature:
name: 'Living Room Temperature 3'
name: "Living Room Temperature 3"
humidity:
name: 'Living Room Humidity 3'
name: "Living Room Humidity 3"
model: AM2302
update_interval: 15s
- platform: dht12
temperature:
name: 'Living Room Temperature 4'
name: "Living Room Temperature 4"
humidity:
name: 'Living Room Humidity 4'
name: "Living Room Humidity 4"
update_interval: 15s
i2c_id: i2c_bus
- platform: duty_cycle
pin: GPIO25
name: Duty Cycle Sensor
- platform: esp32_hall
name: 'ESP32 Hall Sensor'
name: "ESP32 Hall Sensor"
update_interval: 15s
- platform: hdc1080
temperature:
name: 'Living Room Temperature 5'
name: "Living Room Temperature 5"
humidity:
name: 'Living Room Pressure 5'
name: "Living Room Pressure 5"
update_interval: 15s
i2c_id: i2c_bus
- platform: hlw8012
@ -553,14 +553,14 @@ sensor:
cf_pin: 14
cf1_pin: 13
current:
name: 'HLW8012 Current'
name: "HLW8012 Current"
voltage:
name: 'HLW8012 Voltage'
name: "HLW8012 Voltage"
power:
name: 'HLW8012 Power'
name: "HLW8012 Power"
id: hlw8012_power
energy:
name: 'HLW8012 Energy'
name: "HLW8012 Energy"
id: hlw8012_energy
update_interval: 15s
current_resistor: 0.001 ohm
@ -570,26 +570,26 @@ sensor:
model: hlw8012
- platform: total_daily_energy
power_id: hlw8012_power
name: 'HLW8012 Total Daily Energy'
name: "HLW8012 Total Daily Energy"
- platform: integration
sensor: hlw8012_power
name: 'Integration Sensor'
name: "Integration Sensor"
time_unit: s
- platform: integration
sensor: hlw8012_power
name: 'Integration Sensor lazy'
name: "Integration Sensor lazy"
time_unit: s
min_save_interval: 60s
- platform: hmc5883l
address: 0x68
field_strength_x:
name: 'HMC5883L Field Strength X'
name: "HMC5883L Field Strength X"
field_strength_y:
name: 'HMC5883L Field Strength Y'
name: "HMC5883L Field Strength Y"
field_strength_z:
name: 'HMC5883L Field Strength Z'
name: "HMC5883L Field Strength Z"
heading:
name: 'HMC5883L Heading'
name: "HMC5883L Heading"
range: 130uT
oversampling: 8x
update_interval: 15s
@ -597,19 +597,19 @@ sensor:
- platform: qmc5883l
address: 0x0D
field_strength_x:
name: 'QMC5883L Field Strength X'
name: "QMC5883L Field Strength X"
field_strength_y:
name: 'QMC5883L Field Strength Y'
name: "QMC5883L Field Strength Y"
field_strength_z:
name: 'QMC5883L Field Strength Z'
name: "QMC5883L Field Strength Z"
heading:
name: 'QMC5883L Heading'
name: "QMC5883L Heading"
range: 800uT
oversampling: 256x
update_interval: 15s
i2c_id: i2c_bus
- platform: hx711
name: 'HX711 Value'
name: "HX711 Value"
dout_pin: GPIO23
clk_pin: GPIO25
gain: 128
@ -618,13 +618,13 @@ sensor:
address: 0x40
shunt_resistance: 0.1 ohm
current:
name: 'INA219 Current'
name: "INA219 Current"
power:
name: 'INA219 Power'
name: "INA219 Power"
bus_voltage:
name: 'INA219 Bus Voltage'
name: "INA219 Bus Voltage"
shunt_voltage:
name: 'INA219 Shunt Voltage'
name: "INA219 Shunt Voltage"
max_voltage: 32.0V
max_current: 3.2A
update_interval: 15s
@ -633,13 +633,13 @@ sensor:
address: 0x40
shunt_resistance: 0.1 ohm
current:
name: 'INA226 Current'
name: "INA226 Current"
power:
name: 'INA226 Power'
name: "INA226 Power"
bus_voltage:
name: 'INA226 Bus Voltage'
name: "INA226 Bus Voltage"
shunt_voltage:
name: 'INA226 Shunt Voltage'
name: "INA226 Shunt Voltage"
max_current: 3.2A
update_interval: 15s
i2c_id: i2c_bus
@ -648,13 +648,13 @@ sensor:
channel_1:
shunt_resistance: 0.1 ohm
current:
name: 'INA3221 Channel 1 Current'
name: "INA3221 Channel 1 Current"
power:
name: 'INA3221 Channel 1 Power'
name: "INA3221 Channel 1 Power"
bus_voltage:
name: 'INA3221 Channel 1 Bus Voltage'
name: "INA3221 Channel 1 Bus Voltage"
shunt_voltage:
name: 'INA3221 Channel 1 Shunt Voltage'
name: "INA3221 Channel 1 Shunt Voltage"
update_interval: 15s
i2c_id: i2c_bus
- platform: kalman_combinator
@ -668,62 +668,62 @@ sensor:
error: 1.5
- platform: htu21d
temperature:
name: 'Living Room Temperature 6'
name: "Living Room Temperature 6"
humidity:
name: 'Living Room Humidity 6'
name: "Living Room Humidity 6"
update_interval: 15s
i2c_id: i2c_bus
- platform: max6675
name: 'Living Room Temperature'
name: "Living Room Temperature"
cs_pin: GPIO23
update_interval: 15s
- platform: max31855
name: 'Den Temperature'
name: "Den Temperature"
cs_pin: GPIO23
update_interval: 15s
reference_temperature:
name: 'MAX31855 Internal Temperature'
name: "MAX31855 Internal Temperature"
- platform: max31856
name: 'BBQ Temperature'
name: "BBQ Temperature"
cs_pin: GPIO17
update_interval: 15s
mains_filter: 50Hz
- platform: max31865
name: 'Water Tank Temperature'
name: "Water Tank Temperature"
cs_pin: GPIO23
update_interval: 15s
reference_resistance: '430 Ω'
rtd_nominal_resistance: '100 Ω'
reference_resistance: "430 Ω"
rtd_nominal_resistance: "100 Ω"
- platform: mhz19
uart_id: uart0
co2:
name: 'MH-Z19 CO2 Value'
name: "MH-Z19 CO2 Value"
temperature:
name: 'MH-Z19 Temperature'
name: "MH-Z19 Temperature"
update_interval: 15s
automatic_baseline_calibration: false
- platform: mpu6050
address: 0x68
accel_x:
name: 'MPU6050 Accel X'
name: "MPU6050 Accel X"
accel_y:
name: 'MPU6050 Accel Y'
name: "MPU6050 Accel Y"
accel_z:
name: 'MPU6050 Accel z'
name: "MPU6050 Accel z"
gyro_x:
name: 'MPU6050 Gyro X'
name: "MPU6050 Gyro X"
gyro_y:
name: 'MPU6050 Gyro Y'
name: "MPU6050 Gyro Y"
gyro_z:
name: 'MPU6050 Gyro z'
name: "MPU6050 Gyro z"
temperature:
name: 'MPU6050 Temperature'
name: "MPU6050 Temperature"
i2c_id: i2c_bus
- platform: ms5611
temperature:
name: 'Outside Temperature'
name: "Outside Temperature"
pressure:
name: 'Outside Pressure'
name: "Outside Pressure"
address: 0x77
update_interval: 15s
i2c_id: i2c_bus
@ -750,7 +750,7 @@ sensor:
standard_units: True
i2c_id: i2c_bus
- platform: pulse_counter
name: 'Pulse Counter'
name: "Pulse Counter"
pin: GPIO12
count_mode:
rising_edge: INCREMENT
@ -758,7 +758,7 @@ sensor:
internal_filter: 13us
update_interval: 15s
- platform: pulse_meter
name: 'Pulse Meter'
name: "Pulse Meter"
id: pulse_meter_sensor
pin: GPIO12
internal_filter: 100ms
@ -768,9 +768,9 @@ sensor:
id: pulse_meter_sensor
value: 12345
total:
name: 'Pulse Meter Total'
name: "Pulse Meter Total"
- platform: rotary_encoder
name: 'Rotary Encoder'
name: "Rotary Encoder"
id: rotary_encoder1
pin_a: GPIO23
pin_b: GPIO25
@ -788,51 +788,51 @@ sensor:
value: 10
- sensor.rotary_encoder.set_value:
id: rotary_encoder1
value: !lambda 'return -1;'
value: !lambda "return -1;"
on_clockwise:
- logger.log: 'Clockwise'
- logger.log: "Clockwise"
on_anticlockwise:
- logger.log: 'Anticlockwise'
- logger.log: "Anticlockwise"
- platform: pulse_width
name: Pulse Width
pin: GPIO12
- platform: sm300d2
uart_id: uart0
co2:
name: 'SM300D2 CO2 Value'
name: "SM300D2 CO2 Value"
formaldehyde:
name: 'SM300D2 Formaldehyde Value'
name: "SM300D2 Formaldehyde Value"
tvoc:
name: 'SM300D2 TVOC Value'
name: "SM300D2 TVOC Value"
pm_2_5:
name: 'SM300D2 PM2.5 Value'
name: "SM300D2 PM2.5 Value"
pm_10_0:
name: 'SM300D2 PM10 Value'
name: "SM300D2 PM10 Value"
temperature:
name: 'SM300D2 Temperature Value'
name: "SM300D2 Temperature Value"
humidity:
name: 'SM300D2 Humidity Value'
name: "SM300D2 Humidity Value"
update_interval: 60s
- platform: sht3xd
temperature:
name: 'Living Room Temperature 8'
name: "Living Room Temperature 8"
humidity:
name: 'Living Room Humidity 8'
name: "Living Room Humidity 8"
address: 0x44
i2c_id: i2c_bus
update_interval: 15s
- platform: sts3x
name: 'Living Room Temperature 9'
name: "Living Room Temperature 9"
address: 0x4A
i2c_id: i2c_bus
- platform: scd30
co2:
name: 'Living Room CO2 9'
name: "Living Room CO2 9"
temperature:
id: scd30_temperature
name: 'Living Room Temperature 9'
name: "Living Room Temperature 9"
humidity:
name: 'Living Room Humidity 9'
name: "Living Room Humidity 9"
address: 0x61
update_interval: 15s
automatic_self_calibration: true
@ -856,63 +856,63 @@ sensor:
i2c_id: i2c_bus
- platform: sgp30
eco2:
name: 'Workshop eCO2'
name: "Workshop eCO2"
accuracy_decimals: 1
tvoc:
name: 'Workshop TVOC'
name: "Workshop TVOC"
accuracy_decimals: 1
address: 0x58
update_interval: 5s
i2c_id: i2c_bus
- platform: sps30
pm_1_0:
name: 'Workshop PM <1µm Weight concentration'
id: 'workshop_PM_1_0'
name: "Workshop PM <1µm Weight concentration"
id: "workshop_PM_1_0"
pm_2_5:
name: 'Workshop PM <2.5µm Weight concentration'
id: 'workshop_PM_2_5'
name: "Workshop PM <2.5µm Weight concentration"
id: "workshop_PM_2_5"
pm_4_0:
name: 'Workshop PM <4µm Weight concentration'
id: 'workshop_PM_4_0'
name: "Workshop PM <4µm Weight concentration"
id: "workshop_PM_4_0"
pm_10_0:
name: 'Workshop PM <10µm Weight concentration'
id: 'workshop_PM_10_0'
name: "Workshop PM <10µm Weight concentration"
id: "workshop_PM_10_0"
pmc_0_5:
name: 'Workshop PM <0.5µm Number concentration'
id: 'workshop_PMC_0_5'
name: "Workshop PM <0.5µm Number concentration"
id: "workshop_PMC_0_5"
pmc_1_0:
name: 'Workshop PM <1µm Number concentration'
id: 'workshop_PMC_1_0'
name: "Workshop PM <1µm Number concentration"
id: "workshop_PMC_1_0"
pmc_2_5:
name: 'Workshop PM <2.5µm Number concentration'
id: 'workshop_PMC_2_5'
name: "Workshop PM <2.5µm Number concentration"
id: "workshop_PMC_2_5"
pmc_4_0:
name: 'Workshop PM <4µm Number concentration'
id: 'workshop_PMC_4_0'
name: "Workshop PM <4µm Number concentration"
id: "workshop_PMC_4_0"
pmc_10_0:
name: 'Workshop PM <10µm Number concentration'
id: 'workshop_PMC_10_0'
name: "Workshop PM <10µm Number concentration"
id: "workshop_PMC_10_0"
address: 0x69
update_interval: 10s
i2c_id: i2c_bus
- platform: sht4x
temperature:
name: 'SHT4X Temperature'
name: "SHT4X Temperature"
humidity:
name: 'SHT4X Humidity'
name: "SHT4X Humidity"
address: 0x44
update_interval: 15s
i2c_id: i2c_bus
- platform: shtcx
temperature:
name: 'Living Room Temperature 10'
name: "Living Room Temperature 10"
humidity:
name: 'Living Room Humidity 10'
name: "Living Room Humidity 10"
address: 0x70
update_interval: 15s
i2c_id: i2c_bus
- platform: template
name: 'Template Sensor'
name: "Template Sensor"
state_class: measurement
id: template_sensor
lambda: |-
@ -928,9 +928,9 @@ sensor:
state: 43.0
- sensor.template.publish:
id: template_sensor
state: !lambda 'return NAN;'
state: !lambda "return NAN;"
- platform: tsl2561
name: 'TSL2561 Ambient Light'
name: "TSL2561 Ambient Light"
address: 0x39
update_interval: 15s
is_cs_package: true
@ -946,7 +946,7 @@ sensor:
visible:
name: "tsl2591 visible"
id: tsl2591_vis
unit_of_measurement: 'pH'
unit_of_measurement: "pH"
infrared:
name: "tsl2591 infrared"
id: tsl2591_ir
@ -962,17 +962,17 @@ sensor:
echo_pin:
number: GPIO23
inverted: true
name: 'Ultrasonic Sensor'
name: "Ultrasonic Sensor"
timeout: 5.5m
id: ultrasonic_sensor1
- platform: uptime
name: Uptime Sensor
- platform: wifi_signal
name: 'WiFi Signal Sensor'
name: "WiFi Signal Sensor"
update_interval: 15s
- platform: mqtt_subscribe
name: 'MQTT Subscribe Sensor 1'
topic: 'mqtt/topic'
name: "MQTT Subscribe Sensor 1"
topic: "mqtt/topic"
id: the_sensor
qos: 2
on_value:
@ -984,9 +984,9 @@ sensor:
- platform: sds011
uart_id: uart0
pm_2_5:
name: 'SDS011 PM2.5'
name: "SDS011 PM2.5"
pm_10_0:
name: 'SDS011 PM10.0'
name: "SDS011 PM10.0"
update_interval: 5min
rx_only: false
- platform: ccs811
@ -999,9 +999,9 @@ sensor:
i2c_id: i2c_bus
- platform: tx20
wind_speed:
name: 'Windspeed'
name: "Windspeed"
wind_direction_degrees:
name: 'Winddirection Degrees'
name: "Winddirection Degrees"
pin:
number: GPIO04
mode: INPUT
@ -1009,30 +1009,30 @@ sensor:
clock_pin: GPIO5
data_pin: GPIO4
co2:
name: 'ZyAura CO2'
name: "ZyAura CO2"
temperature:
name: 'ZyAura Temperature'
name: "ZyAura Temperature"
humidity:
name: 'ZyAura Humidity'
name: "ZyAura Humidity"
- platform: as3935
lightning_energy:
name: 'Lightning Energy'
name: "Lightning Energy"
distance:
name: 'Distance Storm'
name: "Distance Storm"
- platform: tmp117
name: 'TMP117 Temperature'
name: "TMP117 Temperature"
update_interval: 5s
i2c_id: i2c_bus
- platform: hm3301
pm_1_0:
name: 'PM1.0'
name: "PM1.0"
pm_2_5:
name: 'PM2.5'
name: "PM2.5"
pm_10_0:
name: 'PM10.0'
name: "PM10.0"
aqi:
name: 'AQI'
calculation_type: 'CAQI'
name: "AQI"
calculation_type: "CAQI"
i2c_id: i2c_bus
- platform: teleinfo
tag_name: "HCHC"
@ -1041,13 +1041,13 @@ sensor:
icon: mdi:flash
teleinfo_id: myteleinfo
- platform: mcp9808
name: 'MCP9808 Temperature'
name: "MCP9808 Temperature"
update_interval: 15s
i2c_id: i2c_bus
- platform: ezo
id: ph_ezo
address: 99
unit_of_measurement: 'pH'
unit_of_measurement: "pH"
i2c_id: i2c_bus
- platform: sdp3x
name: "HVAC Filter Pressure drop"
@ -1089,7 +1089,7 @@ esp32_touch:
binary_sensor:
- platform: gpio
name: 'MCP23S08 Pin #1'
name: "MCP23S08 Pin #1"
pin:
mcp23xxx: mcp23s08_hub
# Use pin number 1
@ -1098,7 +1098,7 @@ binary_sensor:
mode: INPUT_PULLUP
inverted: False
- platform: gpio
name: 'MCP23S17 Pin #1'
name: "MCP23S17 Pin #1"
pin:
mcp23xxx: mcp23s17_hub
# Use pin number 1
@ -1107,7 +1107,7 @@ binary_sensor:
mode: INPUT_PULLUP
inverted: False
- platform: gpio
name: 'MCP23S17 Pin #1 with interrupt'
name: "MCP23S17 Pin #1 with interrupt"
pin:
mcp23xxx: mcp23s17_hub
# Use pin number 1
@ -1118,7 +1118,7 @@ binary_sensor:
interrupt: FALLING
- platform: gpio
pin: GPIO9
name: 'Living Room Window'
name: "Living Room Window"
device_class: window
filters:
- invert:
@ -1158,7 +1158,7 @@ binary_sensor:
- OFF for at least 0.2s
then:
- logger.log:
format: 'Multi Clicked TWO'
format: "Multi Clicked TWO"
level: warn
- timing:
- OFF for 1s to 2s
@ -1166,30 +1166,30 @@ binary_sensor:
- OFF for at least 0.5s
then:
- logger.log:
format: 'Multi Clicked LONG SINGLE'
format: "Multi Clicked LONG SINGLE"
level: warn
- timing:
- ON for at most 1s
- OFF for at least 0.5s
then:
- logger.log:
format: 'Multi Clicked SINGLE'
format: "Multi Clicked SINGLE"
level: warn
id: binary_sensor1
- platform: gpio
pin:
number: GPIO9
mode: INPUT_PULLUP
name: 'Living Room Window 2'
name: "Living Room Window 2"
- platform: status
name: 'Living Room Status'
name: "Living Room Status"
- platform: esp32_touch
name: 'ESP32 Touch Pad GPIO27'
name: "ESP32 Touch Pad GPIO27"
pin: GPIO27
threshold: 1000
id: btn_left
- platform: template
name: 'Garage Door Open'
name: "Garage Door Open"
id: garage_door
lambda: |-
if (isnan(id(${sensorname}_sensor).state)) {
@ -1213,37 +1213,37 @@ binary_sensor:
frequency: 500.0Hz
- output.ledc.set_frequency:
id: gpio_19
frequency: !lambda 'return 500.0;'
frequency: !lambda "return 500.0;"
- platform: pn532
pn532_id: pn532_bs
uid: 74-10-37-94
name: 'PN532 NFC Tag'
name: "PN532 NFC Tag"
- platform: rdm6300
uid: 7616525
name: 'RDM6300 NFC Tag'
name: "RDM6300 NFC Tag"
- platform: gpio
name: 'PCF binary sensor'
name: "PCF binary sensor"
pin:
pcf8574: pcf8574_hub
number: 1
mode: INPUT
inverted: True
- platform: gpio
name: 'MCP21 binary sensor'
name: "MCP21 binary sensor"
pin:
mcp23xxx: mcp23017_hub
number: 1
mode: INPUT
inverted: True
- platform: gpio
name: 'MCP22 binary sensor'
name: "MCP22 binary sensor"
pin:
mcp23xxx: mcp23008_hub
number: 7
mode: INPUT_PULLUP
inverted: False
- platform: gpio
name: 'MCP23 binary sensor'
name: "MCP23 binary sensor"
pin:
mcp23016: mcp23016_hub
number: 7
@ -1251,7 +1251,7 @@ binary_sensor:
inverted: False
- platform: remote_receiver
name: 'Raw Remote Receiver Test'
name: "Raw Remote Receiver Test"
raw:
code:
[
@ -1292,7 +1292,7 @@ binary_sensor:
1709,
]
- platform: as3935
name: 'Storm Alert'
name: "Storm Alert"
pca9685:
frequency: 500
@ -1356,39 +1356,39 @@ output:
- platform: tlc59208f
id: tlc_0
channel: 0
tlc59208f_id: 'tlc59208f_1'
tlc59208f_id: "tlc59208f_1"
- platform: tlc59208f
id: tlc_1
channel: 1
tlc59208f_id: 'tlc59208f_1'
tlc59208f_id: "tlc59208f_1"
- platform: tlc59208f
id: tlc_2
channel: 2
tlc59208f_id: 'tlc59208f_1'
tlc59208f_id: "tlc59208f_1"
- platform: tlc59208f
id: tlc_3
channel: 0
tlc59208f_id: 'tlc59208f_2'
tlc59208f_id: "tlc59208f_2"
- platform: tlc59208f
id: tlc_4
channel: 1
tlc59208f_id: 'tlc59208f_2'
tlc59208f_id: "tlc59208f_2"
- platform: tlc59208f
id: tlc_5
channel: 2
tlc59208f_id: 'tlc59208f_2'
tlc59208f_id: "tlc59208f_2"
- platform: tlc59208f
id: tlc_6
channel: 0
tlc59208f_id: 'tlc59208f_3'
tlc59208f_id: "tlc59208f_3"
- platform: tlc59208f
id: tlc_7
channel: 1
tlc59208f_id: 'tlc59208f_3'
tlc59208f_id: "tlc59208f_3"
- platform: tlc59208f
id: tlc_8
channel: 2
tlc59208f_id: 'tlc59208f_3'
tlc59208f_id: "tlc59208f_3"
- platform: gpio
id: id2
pin:
@ -1454,12 +1454,12 @@ e131:
light:
- platform: binary
name: 'Desk Lamp'
name: "Desk Lamp"
output: gpio_26
effects:
- strobe:
- strobe:
name: 'My Strobe'
name: "My Strobe"
colors:
- state: True
duration: 250ms
@ -1474,7 +1474,7 @@ light:
id: livingroom_lights
state: yes
- platform: monochromatic
name: 'Kitchen Lights'
name: "Kitchen Lights"
id: kitchen
output: gpio_19
gamma_correct: 2.8
@ -1483,7 +1483,7 @@ light:
- strobe:
- flicker:
- flicker:
name: 'My Flicker'
name: "My Flicker"
alpha: 98%
intensity: 1.5%
- lambda:
@ -1495,20 +1495,20 @@ light:
if (state == 4)
state = 0;
- platform: rgb
name: 'Living Room Lights'
name: "Living Room Lights"
id: ${roomname}_lights
red: pca_0
green: pca_1
blue: pca_2
- platform: rgbw
name: 'Living Room Lights 2'
name: "Living Room Lights 2"
red: pca_3
green: pca_4
blue: pca_5
white: pca_6
color_interlock: true
- platform: rgbww
name: 'Living Room Lights 2'
name: "Living Room Lights 2"
red: pca_3
green: pca_4
blue: pca_5
@ -1518,7 +1518,7 @@ light:
warm_white_color_temperature: 500 mireds
color_interlock: true
- platform: rgbct
name: 'Living Room Lights 2'
name: "Living Room Lights 2"
red: pca_3
green: pca_4
blue: pca_5
@ -1528,14 +1528,14 @@ light:
warm_white_color_temperature: 500 mireds
color_interlock: true
- platform: cwww
name: 'Living Room Lights 2'
name: "Living Room Lights 2"
cold_white: pca_6
warm_white: pca_6
cold_white_color_temperature: 153 mireds
warm_white_color_temperature: 500 mireds
constant_brightness: true
- platform: color_temperature
name: 'Living Room Lights 2'
name: "Living Room Lights 2"
color_temperature: pca_6
brightness: pca_6
cold_white_color_temperature: 153 mireds
@ -1549,7 +1549,7 @@ light:
max_refresh_rate: 20ms
power_supply: atx_power_supply
color_correct: [75%, 100%, 50%]
name: 'FastLED WS2811 Light'
name: "FastLED WS2811 Light"
effects:
- addressable_color_wipe:
- addressable_color_wipe:
@ -1592,7 +1592,7 @@ light:
update_interval: 16ms
intensity: 5%
- addressable_lambda:
name: 'Test For Custom Lambda Effect'
name: "Test For Custom Lambda Effect"
lambda: |-
if (initial_run) {
it[0] = current_color;
@ -1628,10 +1628,10 @@ light:
data_rate: 2MHz
num_leds: 60
rgb_order: BRG
name: 'FastLED SPI Light'
name: "FastLED SPI Light"
- platform: neopixelbus
id: addr3
name: 'Neopixelbus Light'
name: "Neopixelbus Light"
gamma_correct: 2.8
color_correct: [0.0, 0.0, 0.0, 0.0]
default_transition_length: 10s
@ -1647,7 +1647,7 @@ light:
num_leds: 60
pin: GPIO23
- platform: partition
name: 'Partition Light'
name: "Partition Light"
segments:
- id: addr1
from: 0
@ -1677,7 +1677,7 @@ climate:
away_state_topic: away/state/topic
current_temperature_state_topic: current/temperature/state/topic
fan_mode_command_topic: fan_mode/mode/command/topic
fan_mode_state_topic: fan_mode/mode/state/topic
fan_mode_state_topic: fan_mode/mode/state/topic
mode_command_topic: mode/command/topic
mode_state_topic: mode/state/topic
swing_mode_command_topic: swing_mode/command/topic
@ -1803,7 +1803,7 @@ switch:
remote_transmitter.transmit_midea:
code: [0xA2, 0x08, 0xFF, 0xFF, 0xFF]
- platform: gpio
name: 'MCP23S08 Pin #0'
name: "MCP23S08 Pin #0"
pin:
mcp23xxx: mcp23s08_hub
# Use pin number 0
@ -1811,7 +1811,7 @@ switch:
mode: OUTPUT
inverted: False
- platform: gpio
name: 'MCP23S17 Pin #0'
name: "MCP23S17 Pin #0"
pin:
mcp23xxx: mcp23s17_hub
# Use pin number 0
@ -1820,10 +1820,11 @@ switch:
inverted: False
- platform: gpio
pin: GPIO25
name: 'Living Room Dehumidifier'
icon: 'mdi:restart'
name: "Living Room Dehumidifier"
icon: "mdi:restart"
inverted: True
command_topic: custom_command_topic
command_retain: true
restore_mode: ALWAYS_OFF
- platform: template
name: JVC Off
@ -1885,14 +1886,14 @@ switch:
name: RC Switch Raw
turn_on_action:
remote_transmitter.transmit_rc_switch_raw:
code: '00101001100111110101xxxx'
code: "00101001100111110101xxxx"
protocol: 1
- platform: template
name: RC Switch Type A
turn_on_action:
remote_transmitter.transmit_rc_switch_type_a:
group: '11001'
device: '01000'
group: "11001"
device: "01000"
state: True
protocol:
pulse_length: 175
@ -1911,7 +1912,7 @@ switch:
name: RC Switch Type C
turn_on_action:
remote_transmitter.transmit_rc_switch_type_c:
family: 'a'
family: "a"
group: 1
device: 2
state: True
@ -1919,7 +1920,7 @@ switch:
name: RC Switch Type D
turn_on_action:
remote_transmitter.transmit_rc_switch_type_d:
group: 'a'
group: "a"
device: 2
state: True
- platform: template
@ -1945,16 +1946,16 @@ switch:
level: 50%
- output.set_level:
id: gpio_19
level: !lambda 'return 0.5;'
level: !lambda "return 0.5;"
- output.set_level:
id: dac_output
level: 50%
- output.set_level:
id: dac_output
level: !lambda 'return 0.5;'
level: !lambda "return 0.5;"
- output.set_level:
id: mcp4725_dac_output
level: !lambda 'return 0.5;'
level: !lambda "return 0.5;"
turn_off_action:
- switch.turn_on: living_room_lights_off
restore_state: False
@ -1963,16 +1964,16 @@ switch:
id: livingroom_lights
state: yes
- platform: restart
name: 'Living Room Restart'
name: "Living Room Restart"
- platform: safe_mode
name: 'Living Room Restart (Safe Mode)'
name: "Living Room Restart (Safe Mode)"
- platform: shutdown
name: 'Living Room Shutdown'
name: "Living Room Shutdown"
- platform: output
name: 'Generic Output'
name: "Generic Output"
output: pca_6
- platform: template
name: 'Template Switch'
name: "Template Switch"
id: my_switch
lambda: |-
if (id(binary_sensor1).state) {
@ -1995,18 +1996,18 @@ switch:
on_turn_off:
- switch.template.publish:
id: my_switch
state: !lambda 'return false;'
state: !lambda "return false;"
- platform: uart
uart_id: uart0
name: 'UART String Output'
data: 'DataToSend'
name: "UART String Output"
data: "DataToSend"
- platform: uart
uart_id: uart0
name: 'UART Bytes Output'
name: "UART Bytes Output"
data: [0xDE, 0xAD, 0xBE, 0xEF]
- platform: uart
uart_id: uart0
name: 'UART Recurring Output'
name: "UART Recurring Output"
data: [0xDE, 0xAD, 0xBE, 0xEF]
send_every: 1s
- platform: template
@ -2027,7 +2028,7 @@ switch:
position: 0
- platform: gpio
name: 'SN74HC595 Pin #0'
name: "SN74HC595 Pin #0"
pin:
sn74hc595: sn74hc595_hub
# Use pin number 0
@ -2040,7 +2041,7 @@ switch:
fan:
- platform: binary
output: gpio_26
name: 'Living Room Fan 1'
name: "Living Room Fan 1"
oscillation_output: gpio_19
direction_output: gpio_26
- platform: speed
@ -2048,7 +2049,7 @@ fan:
icon: mdi:weather-windy
output: pca_6
speed_count: 10
name: 'Living Room Fan 2'
name: "Living Room Fan 2"
oscillation_output: gpio_19
direction_output: gpio_26
oscillation_state_topic: oscillation/state/topic
@ -2084,7 +2085,7 @@ interval:
id: display1
page_id: page1
then:
- logger.log: 'Seeing page 1'
- logger.log: "Seeing page 1"
color:
- id: kbx_red
@ -2145,7 +2146,7 @@ display:
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
- platform: ssd1306_i2c
model: 'SSD1306_128X64'
model: "SSD1306_128X64"
reset_pin: GPIO23
address: 0x3C
id: display1
@ -2165,28 +2166,28 @@ display:
ESP_LOGD("display", "1 -> 2");
i2c_id: i2c_bus
- platform: ssd1306_spi
model: 'SSD1306 128x64'
model: "SSD1306 128x64"
cs_pin: GPIO23
dc_pin: GPIO23
reset_pin: GPIO23
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
- platform: ssd1322_spi
model: 'SSD1322 256x64'
model: "SSD1322 256x64"
cs_pin: GPIO23
dc_pin: GPIO23
reset_pin: GPIO23
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
- platform: ssd1325_spi
model: 'SSD1325 128x64'
model: "SSD1325 128x64"
cs_pin: GPIO23
dc_pin: GPIO23
reset_pin: GPIO23
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
- platform: ssd1327_i2c
model: 'SSD1327 128X128'
model: "SSD1327 128X128"
reset_pin: GPIO23
address: 0x3D
id: display1327
@ -2200,7 +2201,7 @@ display:
// Nothing
i2c_id: i2c_bus
- platform: ssd1327_spi
model: 'SSD1327 128x128'
model: "SSD1327 128x128"
cs_pin: GPIO23
dc_pin: GPIO23
reset_pin: GPIO23
@ -2213,7 +2214,7 @@ display:
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
- platform: ssd1351_spi
model: 'SSD1351 128x128'
model: "SSD1351 128x128"
cs_pin: GPIO23
dc_pin: GPIO23
reset_pin: GPIO23
@ -2235,7 +2236,7 @@ display:
lambda: |-
it.rectangle(0, 0, it.get_width(), it.get_height());
- platform: st7735
model: 'INITR_BLACKTAB'
model: "INITR_BLACKTAB"
cs_pin: GPIO5
dc_pin: GPIO16
reset_pin: GPIO23
@ -2293,13 +2294,13 @@ pn532_spi:
ESP_LOGD("main", "Found tag %s", x.c_str());
- mqtt.publish:
topic: the/topic
payload: !lambda 'return x;'
payload: !lambda "return x;"
on_tag_removed:
- lambda: |-
ESP_LOGD("main", "Removed tag %s", x.c_str());
- mqtt.publish:
topic: the/topic
payload: !lambda 'return x;'
payload: !lambda "return x;"
pn532_i2c:
i2c_id: i2c_bus
@ -2338,7 +2339,7 @@ time:
- 1.pool.ntp.org
- 192.168.178.1
on_time:
cron: '/30 0-30,30/5 * ? JAN-DEC MON,SAT-SUN,TUE-FRI'
cron: "/30 0-30,30/5 * ? JAN-DEC MON,SAT-SUN,TUE-FRI"
then:
- lambda: 'ESP_LOGD("main", "time");'
- platform: gps
@ -2356,7 +2357,7 @@ time:
cover:
- platform: template
name: 'Template Cover'
name: "Template Cover"
id: template_cover
lambda: |-
if (id(binary_sensor1).state) {
@ -2373,7 +2374,7 @@ cover:
has_position: yes
position_state_topic: position/state/topic
position_command_topic: position/command/topic
tilt_lambda: !lambda 'return 0.5;'
tilt_lambda: !lambda "return 0.5;"
tilt_state_topic: tilt/state/topic
tilt_command_topic: tilt/command/topic
on_open:
@ -2383,7 +2384,7 @@ cover:
then:
- lambda: 'ESP_LOGD("cover", "closed");'
- platform: am43
name: 'Test AM43'
name: "Test AM43"
id: am43_test
ble_client_id: ble_foo
icon: mdi:blinds
@ -2402,24 +2403,24 @@ tca9548a:
i2c_id: multiplex0_chan0
pcf8574:
- id: 'pcf8574_hub'
- id: "pcf8574_hub"
address: 0x21
pcf8575: False
i2c_id: i2c_bus
mcp23017:
- id: 'mcp23017_hub'
open_drain_interrupt: 'true'
- id: "mcp23017_hub"
open_drain_interrupt: "true"
i2c_id: i2c_bus
mcp23008:
- id: 'mcp23008_hub'
- id: "mcp23008_hub"
address: 0x22
open_drain_interrupt: 'true'
open_drain_interrupt: "true"
i2c_id: i2c_bus
mcp23016:
- id: 'mcp23016_hub'
- id: "mcp23016_hub"
address: 0x23
i2c_id: i2c_bus
@ -2437,15 +2438,15 @@ globals:
- id: glob_int
type: int
restore_value: yes
initial_value: '0'
initial_value: "0"
- id: glob_float
type: float
restore_value: yes
initial_value: '0.0f'
initial_value: "0.0f"
- id: glob_bool
type: bool
restore_value: no
initial_value: 'true'
initial_value: "true"
- id: glob_string
type: std::string
restore_value: no
@ -2453,12 +2454,12 @@ globals:
- id: glob_bool_processed
type: bool
restore_value: no
initial_value: 'false'
initial_value: "false"
text_sensor:
- platform: mqtt_subscribe
name: 'MQTT Subscribe Text'
topic: 'the/topic'
name: "MQTT Subscribe Text"
topic: "the/topic"
qos: 2
on_value:
- text_sensor.template.publish:
@ -2470,7 +2471,7 @@ text_sensor:
return "Hello World2";
- globals.set:
id: glob_int
value: '0'
value: "0"
- canbus.send:
canbus_id: mcp2515_can
can_id: 23
@ -2484,17 +2485,17 @@ text_sensor:
id: ${textname}_text
- platform: wifi_info
scan_results:
name: 'Scan Results'
name: "Scan Results"
ip_address:
name: 'IP Address'
name: "IP Address"
ssid:
name: 'SSID'
name: "SSID"
bssid:
name: 'BSSID'
name: "BSSID"
mac_address:
name: 'Mac Address'
name: "Mac Address"
- platform: version
name: 'ESPHome Version No Timestamp'
name: "ESPHome Version No Timestamp"
hide_timestamp: True
- platform: teleinfo
tag_name: "OPTARIF"
@ -2502,7 +2503,7 @@ text_sensor:
teleinfo_id: myteleinfo
sn74hc595:
- id: 'sn74hc595_hub'
- id: "sn74hc595_hub"
data_pin: GPIO21
clock_pin: GPIO23
latch_pin: GPIO22
@ -2528,7 +2529,7 @@ canbus:
then:
- if:
condition:
lambda: 'return x[0] == 0x11;'
lambda: "return x[0] == 0x11;"
then:
light.toggle: ${roomname}_lights
- platform: esp32_can
@ -2547,7 +2548,7 @@ canbus:
then:
- if:
condition:
lambda: 'return x[0] == 0x11;'
lambda: "return x[0] == 0x11;"
then:
light.toggle: ${roomname}_lights