大佬 是不是直接用第一段代码就行了,不用二楼的代码了吧
我用一楼代码现在问题是这样的
Couldn't find ID 'ctrl_text'. Please check you have defined an ID with that name in your configuration.
Couldn't find ID 'led_switch'. Please check you have defined an ID with that name in your configuration.
lambda: !lambda |-
id(Voltage).publish_state(id(y_voltage).state + 116.3);
id(Amperage).publish_state(id(Wattage).state / (id(y_voltage).state + 116.3) );
if( id(Wattage).state > 3){
id(Power).publish_state(true);
if(id(led_switch).state){
id(led).turn_on();
}
}else{
id(Power).publish_state(false);
id(led).turn_off();
} [source /config/esphome/444.yaml:131]
Couldn't find ID 'led'. Please check you have defined an ID with that name in your configuration.
请问该如何操作呀,搞了两天了,现在就是这里弄不好
INFO Reading configuration /config/esphome/jtest.yaml...
WARNING GPIO4 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.ht ... bout-strapping-pins
WARNING GPIO0 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.ht ... bout-strapping-pins
WARNING GPIO2 is a Strapping PIN and should be avoided.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.ht ... bout-strapping-pins
INFO Generating C++ source...
INFO Core config or version changed, cleaning build files...
INFO Compiling app...
Processing justest (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 5.3.0)
--------------------------------------------------------------------------------
Error! Failed to extract upstream toolchainconfigurations:
Bad package version `1.22.0-97-gc752ad5-5.2.0`
You can disable this feature via the `board_build.arduino.upstream_packages = no` setting in your `platformio.ini` file.