question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cover position shows incorrect state under certain conditons.

See original GitHub issue

I’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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
crkochancommented, Nov 22, 2020

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.

0reactions
bdracocommented, Nov 21, 2020

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

COMMON ERRORS IN KRONOS AND HOW TO FIX THEM
Incorrectly recording overtime hours. Non-exempt employees who have approval to work overtime should record their total hours worked each day without using any ......
Read more >
faq-providers-no-surprises-rules-april-2022.pdf
Generally, the No Surprises protections apply to individuals enrolled in a health care plan, through an employer (whether self-funded or insured ...
Read more >
Chapter 32 - Interim Relief Actions, Corrections, ...
a. A correction changes information shown on an earlier action on which an error occurred or adds information that was omitted from an...
Read more >
States | FMCSA - Department of Transportation
In certain circumstances, States are permitted to issue a CDL to an individual who is not domiciled within its jurisdiction.
Read more >
AS 3101: The Auditor's Report on an Audit of Financial ...
A statement that the auditor is a public accounting firm registered with the PCAOB (United States) and is required to be independent with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found