Cover position shows incorrect state under certain conditons.
See original GitHub issueI’ve noticed the problem occurring after the most recent updates to reduce polling. Entity buttons on various lovelave dashboards with entity buttons that control Serena shades via my Caseta Pro hub have icons, the color of which change based on the open or closed states of the shades are now no longer always correct.
What seems to be happening is that unless the position of the cover object for a shade is set via the position slider in Home Assistant, or via invoking the cover.set_cover_position service, the state information for the object is not kept up to date. If you were to press the up arrow on the object controls, or invoke a cover service without a position parameter, such as cover.open_cover for instance, the shade responds as expected, but the state of the object is not updated and becomes stale. In the cover.open_cover example, the cover object state remains closed
with the curent_position
attribute remaining at 0 (assuming the shade was completely closed of course). Hitting the stop button on the cover object for a shade, no matter if the shade is in motion or not, seems to trigger a state update.
I enabled debug logging for custom components as documented in the troubleshooting section, and captured any logging having to do with custom_components.lutron_caseta_pro
under various circumstances of manipulating a cover object in Home Assistant. Lines with datetime stamps are lifted from the log output, with comments indicating action being taken, and state results following.
Opening from closed/position 0 to position 10 via slider:
2020-11-18 01:56:45 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 9 1 10.000000
2020-11-18 01:56:45 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 9 1 10.00000
State updated in Home Assistant.
Closing from position 10 to position 0 via slider:
2020-11-18 01:58:06 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 9 1 0.000000
2020-11-18 01:58:06 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 9 1 0.000000
State updated in Home Assistant.
Opening from closed/position 0 via up arrow on cover object in Home Assistant:
No log output at start of movement.
No log output when shade opens fully.
No state update in Home Assistant.
Pressing stop button on opening shade:
2020-11-18 01:59:19 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 9 1 29.560000
2020-11-18 01:59:19 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 9 1 29.560000
State updated in Home Assistant.
Closing from position 29.56 to closed/position 0 via down arrow:
No log output at start of movement.
No log output when shade closes fully.
No state update in Home Assistant.
Pressing stop button for already closed shade with stale state in Home Assistant:
2020-11-18 02:01:56 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 9 1 0.000000
2020-11-18 02:01:56 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 9 1 0.000000
State update in Home Assistant, is now proper.
Opening from closed to position 10 via cover.set_cover_position:
2020-11-18 02:20:49 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 9 1 10.000000
2020-11-18 02:20:49 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 9 1 10.000000
State updated in Home Assistant.
Closing from position 10 to position 0 via cover.set_cover_position:
2020-11-18 02:23:00 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 9 1 0.000000
2020-11-18 02:23:00 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 9 1 0.000000
State updated in Home Assistant.
Closing from position 10 to position 0 via cover.close_cover:
No log output at start of movement.
No log output when shade closes fully.
No state update in Home Assistant.
Opening shades via up button on pico remote (button assigned to two shades):
2020-11-18 02:24:51 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: DEVICE 11 5 3.000000
2020-11-18 02:24:51 DEBUG (MainThread) [custom_components.lutron_caseta_pro.sensor] Got DEVICE value: DEVICE 11 5 3
2020-11-18 02:24:51 DEBUG (MainThread) [custom_components.lutron_caseta_pro.sensor] Got Button Press, updating value to: 8
2020-11-18 02:24:54 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: DEVICE 11 5 4.000000
2020-11-18 02:24:54 DEBUG (MainThread) [custom_components.lutron_caseta_pro.sensor] Got DEVICE value: DEVICE 11 5 4
2020-11-18 02:24:54 DEBUG (MainThread) [custom_components.lutron_caseta_pro.sensor] Got Button Release, updating value to: 0
2020-11-18 02:24:54 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 9 1 14.770000
2020-11-18 02:24:54 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 9 1 14.770000
2020-11-18 02:24:54 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 10 1 14.800000
2020-11-18 02:24:54 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 10 1 14.800000
State updated in Home Assistant as soon as button is released.
Closing shades via close button on pico remote (button assigned to two shades)::
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: DEVICE 11 4 3.000000
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro.sensor] Got DEVICE value: DEVICE 11 4 3
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro.sensor] Got Button Press, updating value to: 4
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: DEVICE 11 4 4.000000
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro.sensor] Got DEVICE value: DEVICE 11 4 4
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro.sensor] Got Button Release, updating value to: 0
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 9 1 0.000000
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 9 1 0.000000
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro] Read value for host 10.0.10.85: OUTPUT 10 1 0.000000
2020-11-18 02:25:30 DEBUG (MainThread) [custom_components.lutron_caseta_pro.cover] Got cover OUTPUT value: OUTPUT 10 1 0.000000
State updated in Home Assistant as soon as button is released while shades are in motion.
Toggling shade via cover.toggle:
No log output at start of movement.
No log output when shade opens or closes fully.
Toggle command functions as expected; an open/opening shade will close, and a closed/closing shade will open.
No state update in Home Assistant at any time after invoking command.
The problem for me now is that I have various pieces of Node-RED and yaml automations that have triggers based on the current state of my shades that are no longer operating correctly.
I could work around the problem by replacing any uses of cover.open_cover, or cover.close_cover with cover.set_cover_position and with position parameters that would result in the same results as I was getting before. Nevertheless, it seems like this current behavior is a regression.
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
Can confirm, the issue is resolved.
Tested with opening and closing via arrows controls and cover service calls. The state updates are now operating as expected.
Thanks for the prompt response, it’s appreciated.
@crkochan Can you test with PR #70 ?
While I’m pretty confident it will fix the issue. I’m traveling at the moment so I can’t validate the fix until I get back home.