device_class: occupancy icon: mdi:motion-sensor lambda: |- if ((id(radar_has_target).state) && ((id(radar_z2_end).state < id(radar_detection_distance).state) && (id(radar_detection_distance).state < id(radar_z3_end).state))) { return true; } else { return false; } #Exposes ...
lambda'return 50.0 / 180.0;'# 除了远程控制外,我还接了一个开关,用于手动开门,为了避免误触,我设定开关是长按启动,并设置一个传感器用来接收开关信号binary_sensor:# 这里定义了一个二元传感器,也就是只有ON/OFF两个输出-platform:gpiopin:number:GPIO4inverted:True# 这里是将信号反转,因为我的开关是按下后接...
lambda 'return level / 100.0;'ota:password:"123"servo:-id:my_servooutput:pwm_output# Example output platform# On ESP32, use ledc outputoutput:-platform:esp8266_pwmid:pwm_outputpin:D4frequency:50Hzlight:-platform:monochromaticname:"LED On Board"output:pwm_output D4管脚刚好对应开发板上的LED灯...
ESP_LOGD("virtual_ble_light", "Connected to BLE device"); - binary_sensor.template.publish: id: led_ble_connected_sensor state: ON - switch.turn_off: led_ble_on_off_switch on_disconnect: then: - lambda: |- ESP_LOGD("virtual_ble_light", "Disconnected to BLE device"); - binary_s...
text_sensor: - platform: template name: "${friendly_name} State" update_interval: 1s lambda: |- if( id(run_motor).is_running() ) { return {"Running"}; } else if( id(flash_pos_switch_error).is_running() ) { return {"Jammed"}; } ...
sesame:model:sesame_bot_2⋮bot:id:bot_2running_sensor:name:Bot2 is running The idbot_2can be referenced from lambda sections (seebelowandbelow). Thesesame_botdevices can also be used with thebotsettings. When used with thebotsetting, the device will not expose the lock functionality (Loc...
- lambda: |- bool state_return = false; if (("contrast" == name) && (value >= -2) && (value <= 2)) { id(espcam).set_contrast(value); state_return = true; } if (("brightness" == name) && (value >= -2) && (value <= 2)) { id(espcam).set_brightness(value); stat...
- lambda: if (x < 1.5600) return 0; else return (x - 1.5600); # https://esphome.io/components/sensor/total_daily_energy.html - platform: total_daily_energy name: ${device_name}_total_daily_energy power_id: wattage filters: - multiply: 0.001 ...
有效载荷(必填,lambda):消息内容。qos(可选,int):主题的服务质量级别。默认为0。保留(可选,布尔值):如果已发布的消息是否应该打开保留标志。默认为false。笔记笔记:此操作也可以⽤lambdas编写:mqtt:#GivethemqttcomponentanIDid:mqtt_clientid(mqtt_client).publish_json("the/topic",[=](JsonObjectroot)root[...
# Example configuration entry esphome: name: livingroom esp8266: board: nodemcuv2 binary_sensor: - platform: gpio name: Pin GPIO17 pin: GPIO17 特殊引脚 GPIO0 控制引导模式 GPIO1 UART TX别针 GPIO2 控制引导模式 GPIO3 UART RX引脚 GPIO6 SDIO/Flash CLK引脚 GPIO7 SDIO/闪存数据0针 GPIO8 SDIO...