Hi! This is more or less my first tinkering with a project to have an actuator opening and closing a window. In reference to this tutorial DrZzs Motor Window i have some problems.
When I power up everything (using a proper 12V 5A power suppy) I can see my D1 online and reacting to my template in Home Assistant. The motor although doesnt make a move at all. Also when I push the button, nothing happens. Just to double check, I changed the D1, the motor controller and tested the actuator directly on the power supply.
When I just copy and pasted the code from DrZzs, it gave me some errors. The first was this one:
Compiling /data/zimmer3-motor-oberlicht/.pioenvs/zimmer3-motor-oberlicht/src/main.cpp.o
/config/esphome/zimmer3-motor-oberlicht.yaml: In lambda function:
/config/esphome/zimmer3-motor-oberlicht.yaml:73:21: error: 'class esphome::template_::TemplateCover' has no member named 'state'
if (id(win_open).state == cover::COVER_OPEN) {
^
/config/esphome/zimmer3-motor-oberlicht.yaml:76:26: warning: 'void esphome::cover::Cover::stop()' is deprecated (declared at src/esphome/components/cover/cover.h:141): stop() is deprecated, use make_call().set_command_stop() instead. [-Wdeprecated-declarations]
id(win_open).stop();
^
/config/esphome/zimmer3-motor-oberlicht.yaml:79:27: warning: 'void esphome::cover::Cover::close()' is deprecated (declared at src/esphome/components/cover/cover.h:135): close() is deprecated, use make_call().set_command_close() instead. [-Wdeprecated-declarations]
id(win_open).close();
^
/config/esphome/zimmer3-motor-oberlicht.yaml:84:26: warning: 'void esphome::cover::Cover::stop()' is deprecated (declared at src/esphome/components/cover/cover.h:141): stop() is deprecated, use make_call().set_command_stop() instead. [-Wdeprecated-declarations]
id(win_open).stop();
^
/config/esphome/zimmer3-motor-oberlicht.yaml:87:26: warning: 'void esphome::cover::Cover::open()' is deprecated (declared at src/esphome/components/cover/cover.h:129): open() is deprecated, use make_call().set_command_open() instead. [-Wdeprecated-declarations]
id(win_open).open();
^
*** [/data/zimmer3-motor-oberlicht/.pioenvs/zimmer3-motor-oberlicht/src/main.cpp.o] Error 1
========================== [FAILED] Took 2.66 seconds ==========================
Hi.
I dont see anything obvious in the configuration except that the D3 is usually not a good pin to use if you are using a esp8266. It is connected to flash memory and may give you trouble to boot. ESP8266 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials for future pin selection. Use any of D5,D6 or D7. The D1 and D2 is good pin to use (and you already do)
Hi Mattias!!
Thank you for reviewing my code. So, the changes I made are correct? Iām really a bit confused. BTW, this is the board I use: -Klick- One customer complained about, that the Pins dont correlate with the Gpio, but as far as I can compare, it should be ok. Really strange, that the Push Button shows no reaction at all. Hm.
Tomorrow I will check out the logger function. Since im no expert at all with esp, please forgive me some silly questions ;-). Stay tuned
Well, im an Idiot. I got 5 of those boards, and powered all on, to check if they are working properly. While I flashed the first one, I mixed it up with another unflashed one and left both powered on. So I had all those responses in the HA and wondered why I couldnt measure anything. Wow, I should stop do that stuff after a working day
Anyway, the D1 Mini works as expected, and shows me also in HA when I push the button. Since I reverted to the original code, the actuator isnāt moving. But I will debug this also.
Thank you @birchman! This project is extremely cool, because you can basically do anything with it.
Great that you found the issue. The best issues are the solved ones.
Esphome has found the balance with relative simple configuration and also the flexibility to do more advanced stuff with lambdas and actions.
Hello! Iām also trying to work through DrZzs video to control a transom window. Iāve run into a similar error when compiling.
Compiling /data/3fnw-transom/.pioenvs/3fnw-transom/src/main.cpp.o
/config/esphome/3fnw-transom.yaml: In lambda function:
/config/esphome/3fnw-transom.yaml:75:26: warning: 'void esphome::cover::Cover::stop()' is deprecated (declared at src/esphome/components/cover/cover.h:141): stop() is deprecated, use make_call().set_command_stop() instead. [-Wdeprecated-declarations]
id(win_open).stop();
^
/config/esphome/3fnw-transom.yaml:78:27: warning: 'void esphome::cover::Cover::close()' is deprecated (declared at src/esphome/components/cover/cover.h:135): close() is deprecated, use make_call().set_command_close() instead. [-Wdeprecated-declarations]
id(win_open).close();
^
/config/esphome/3fnw-transom.yaml:83:26: warning: 'void esphome::cover::Cover::stop()' is deprecated (declared at src/esphome/components/cover/cover.h:141): stop() is deprecated, use make_call().set_command_stop() instead. [-Wdeprecated-declarations]
id(win_open).stop();
^
/config/esphome/3fnw-transom.yaml:86:26: warning: 'void esphome::cover::Cover::open()' is deprecated (declared at src/esphome/components/cover/cover.h:129): open() is deprecated, use make_call().set_command_open() instead. [-Wdeprecated-declarations]
id(win_open).open();
^
Linking /data/3fnw-transom/.pioenvs/3fnw-transom/firmware.elf
Retrieving maximum program size /data/3fnw-transom/.pioenvs/3fnw-transom/firmware.elf
Checking size /data/3fnw-transom/.pioenvs/3fnw-transom/firmware.elf
Building /data/3fnw-transom/.pioenvs/3fnw-transom/firmware.bin
RAM: [==== ] 38.6% (used 31588 bytes from 81920 bytes)
Flash: [==== ] 40.2% (used 411456 bytes from 1023984 bytes)
Creating BIN file "/data/3fnw-transom/.pioenvs/3fnw-transom/firmware.bin" using "/root/.platformio/packages/framework-arduinoespressif8266/bootloaders/eboot/eboot.elf" and "/data/3fnw-transom/.pioenvs/3fnw-transom/firmware.elf"
I did change .state to .position like mentioned in the post above but Iām unsure how to use the make_call().set_command_open() in my lambda to get this functioning correctly.
I feel like a goof. I answered my own problem by reading @hundsboog 's code at the top and noticing the implemented code. So I appreciate that being up there.
I am still having an issue where my button rapidly switches from on to off to on until I disconnect it. Iām going to try a different button I have and troubleshoot from there. Unless anyone else has ideas.
Thanks
***Edit
Hereās an example of what the button is doing. as soon as it powers on it begins switching rapidly. I attached a different button and get the same result.
One thing I did notice is that if I press and hold the button in, the log will show it holding in the On position then when I let go of the button it begins switching back and forth again.
Also to note is that none of this switching by the button is having an effect on the actuator. I can see and control it in home assistant but the button does nothing but flood the logs.
[14:40:41][D][api.connection:727]: Home Assistant 2021.10.4 (192.168.1.): Connected successfully
[14:40:41][D][binary_sensor:036]: 'Window Control Button': Sending state OFF
[14:40:41][D][binary_sensor:036]: 'Window Control Button': Sending state ON
[14:40:41][D][binary_sensor:036]: 'Window Control Button': Sending state OFF
[14:40:41][D][binary_sensor:036]: 'Window Control Button': Sending state ON
[14:40:42][D][binary_sensor:036]: 'Window Control Button': Sending state OFF
[14:40:42][D][binary_sensor:036]: 'Window Control Button': Sending state ON
[14:40:43][D][binary_sensor:036]: 'Window Control Button': Sending state OFF
[14:40:43][D][binary_sensor:036]: 'Window Control Button': Sending state ON
[14:40:44][D][binary_sensor:036]: 'Window Control Button': Sending state OFF
[14:40:44][D][binary_sensor:036]: 'Window Control Button': Sending state ON
[14:40:44][D][binary_sensor:036]: 'Window Control Button': Sending state OFF
[14:40:44][D][binary_sensor:036]: 'Window Control Button': Sending state ON
[14:40:45][D][binary_sensor:036]: 'Window Control Button': Sending state OFF
[14:40:45][D][binary_sensor:036]: 'Window Control Button': Sending state ON
[14:40:45][D][binary_sensor:036]: 'Window Control Button': Sending state OFF
[14:40:45][D][binary_sensor:036]: 'Window Control Button': Sending state ON
[14:40:46][D][binary_sensor:036]: 'Window Control Button': Sending state OFF