Closed Lord-Memester closed 1 year ago
Connection errors occur frequently in most of my devices due to sub-optimal WiFi reception. Even in best case scenarios we should assume network errors can occur.
My guess is that the network error is not directly causing the behavior you're seeing, but perhaps it causes your ESP device to reboot. Have you checked the uptime sensor to see if your device reboots?
My advise would be to ensure no servo motion occurs on startup. I.e. the servo state persists between restarts.
Connection errors occur frequently in most of my devices due to sub-optimal WiFi reception. Even in best case scenarios we should assume network errors can occur.
My guess is that the network error is not directly causing the behavior you're seeing, but perhaps it causes your ESP device to reboot. Have you checked the uptime sensor to see if your device reboots?
My advise would be to ensure no servo motion occurs on startup. I.e. the servo state persists between restarts.
I have not checked that, actually. The device has been unplugged for several days because of the issue, so I won't be able to get back to you until it happens again, and there's a few hours until I can get back to a place to test it in.
Connection errors occur frequently in most of my devices due to sub-optimal WiFi reception. Even in best case scenarios we should assume network errors can occur.
My guess is that the network error is not directly causing the behavior you're seeing, but perhaps it causes your ESP device to reboot. Have you checked the uptime sensor to see if your device reboots?
My advise would be to ensure no servo motion occurs on startup. I.e. the servo state persists between restarts.
It does indeed appear to restart. How should I go about ensuring this doesn't happen upon a restart? The configuration for this device is janky enough already, and I'm not sure how I would go about preventing the issue. Could you possibly help, please?
Could you possibly help, please?
I could give it a go, though as I've not played with Servos in ESPHome myself I'm not sure about its exact behavior.
Looking at your config, specifically the servo portion, I found the restore
option. Set this to true such that upon restart the servo will go to its last known position. As you're using an ESP32, i believe restore from flash is enabled by default, so just setting this value should do the trick.
I'd also add auto_detach_time: 5s
(Or anything reasonable related to the longest travel time of your servo motion). This way the servo doesn't remain powered after its motion completes. Probably not necessary, just my personal preference 😉
Could you possibly help, please?
I could give it a go, though as I've not played with Servos in ESPHome myself I'm not sure about its exact behavior.
Looking at your config, specifically the servo portion, I found the
restore
option. Set this to true such that upon restart the servo will go to its last known position. As you're using an ESP32, i believe restore from flash is enabled by default, so just setting this value should do the trick.I'd also add
auto_detach_time: 5s
(Or anything reasonable related to the longest travel time of your servo motion). This way the servo doesn't remain powered after its motion completes. Probably not necessary, just my personal preference 😉
Oh, cool! Didn't know either of those were a thing, which is surprising considering how much time I spent scrolling through the servo documentation. You're suggesting to implement them starting in the same column as the service: control_servo
, right?
Like this:
...
servo:
- id: my_servo
output: pwm_output
restore: true
auto_detach_time: 5s
...
Like this:
... servo: - id: my_servo output: pwm_output restore: true auto_detach_time: 5s ...
Thank you!
Like this:
... servo: - id: my_servo output: pwm_output restore: true auto_detach_time: 10s ...
It seems like that did the trick! It's restarted several times, and has behaved exactly as I desired since the change! Thanks a million!
The problem
I'm using a NodeMCU-32S to control a servo that flips a light switch. I noticed yesterday that the switch just turned on without anyone doing anything, and it just happened again while I was in the same room. I guess the issue here is that the servo moves when a specific error occurs, and I'm not sure how to prevent the error or the issue it causes.
Which version of ESPHome has the issue?
2023.4.4
What type of installation are you using?
Home Assistant Add-on
Which version of Home Assistant has the issue?
2023.5.2
What platform are you using?
ESP32
Board
NodeMCU-32S
Component causing the issue
No response
Example YAML snippet
Anything in the logs that might be useful for us?
Additional information
The X's are me obscuring info.