basbruss / adaptive-cover

An Adaptive Cover component for HomeAsisstant to control covers based on the sun's position
MIT License
90 stars 11 forks source link

"Always adjust position to sunset default at end time" not working. #232

Closed maxowner1 closed 1 month ago

maxowner1 commented 3 months ago

What version of Adaptive Cover are you using?

1.3.2

What version of Home Assistant are you using?

2024.5.1

Checklist

Describe the issue

I have a blind which I want to close completely at noon, regardless of sun position. So I set the sunset default position to 0%, set the "End Time" to noon, and checked the box to "always adjust position to sunset default." But the blind stays open at its current position when the end time comes.

Reproduction steps

  1. set the sunset default position to 0%
  2. set the "End Time" to noon
  3. check the box to "always adjust position to sunset default."
  4. Have the blind in an open position and wait until noon ...

Diagnostics dump

config_entry-adaptive_cover-4f78a65dc2396f0137149b76ed4405a9.json

basbruss commented 3 months ago

Do you have any debug logs from around noon? Or any other logs regarding this integration that could potentially identify the problem? I assume the toggle control switch is on, otherwise the integration is not allowed to make any position changes to your covers.

maxowner1 commented 3 months ago

Thanks for the response. Yes the toggle is definitely on. I don’t have any logs but will try to get some. What is the easiest way to do that?

basbruss commented 3 months ago

You can turn on debug logging from the integration tab just before the set end time and disable it some minutes afterwards.

Screen Shot 2024-06-21 at 13 59 01

Does it also not work when you set the end time to some other time?

maxowner1 commented 3 months ago

Yes, when I change the time to a few minutes from the present time, it will work. But when I leave it set for noon or around noon and I come home later, it hasn’t worked.

maxowner1 commented 3 months ago

The issue occurred again, I had the end time set to 11:50am, and the blind did not move. I had debugging on, but there was no debug entry in the log at that time. Otherwise all the same settings as above

swa72 commented 3 months ago

Sounds similar to https://github.com/basbruss/adaptive-cover/issues/188.

Dielee commented 3 months ago

I have the same issue...

basbruss commented 3 months ago

The issue occurred again, I had the end time set to 11:50am, and the blind did not move. I had debugging on, but there was no debug entry in the log at that time. Otherwise all the same settings as above

I did try to replicate it by setting both my dev and production instance to 11:59:00,11:50:00,11:45:00,11:40:00, but in each case, both systems did trigger at the correct millisecond.

@Dielee Could you also share your diagnostics so I can investigate it more?

swa72 commented 3 months ago

I have an odd behavior. I have - among other covers in the house - two covers in my bedroom, one left, one right. Both end time set to 21:00 and "Always adjust position to sunset default at end time; Useful if end time is before actual sunset" is checked.

cover.shelly25_og_schlafli with sunset position of 40% cover.shelly25_og_schlafre with sunset position of 0%

Left cover (cover.shelly25_og_schlafli) did move, right (cover.shelly25_og_schlafre) did not. The right one does not get an order to move.

Running 1.3.2


2024-06-25 21:00:00.239 DEBUG (MainThread) [custom_components.adaptive_cover.const] Timed refresh triggered
2024-06-25 21:00:00.240 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-06-25 21:00:00.240 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.shelly25_og_schlafli': True} and target call {'cover.shelly25_og_schlafli': 40.0}
2024-06-25 21:00:00.240 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.shelly25_og_schlafli', 'position': 40.0}
2024-06-25 21:00:02.351 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 2.112 seconds (success: True)
2024-06-25 21:00:02.985 DEBUG (MainThread) [custom_components.adaptive_cover.const] Cover state change
2024-06-25 21:00:02.985 DEBUG (MainThread) [custom_components.adaptive_cover.const] Processing state change event: StateChangedData(entity_id='cover.shelly25_og_schlafli', old_state=<state cover.shelly25_og_schlafli=open; current_position=100, device_class=shutter, friendly_name=shelly25_og_schlafli, supported_features=15 @ 2024-06-25T20:43:53.814775+02:00>, new_state=<state cover.shelly25_og_schlafli=closing; current_position=40, device_class=shutter, friendly_name=shelly25_og_schlafli, supported_features=15 @ 2024-06-25T21:00:02.397924+02:00>)
2024-06-25 21:00:02.986 DEBUG (MainThread) [custom_components.adaptive_cover.const] Position 40 reached for cover.shelly25_og_schlafli
2024-06-25 21:00:02.986 DEBUG (MainThread) [custom_components.adaptive_cover.const] Wait for target: {'cover.shelly25_og_schlafli': False}
2024-06-25 21:00:02.988 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-06-25 21:00:02.989 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set manual control for cover.shelly25_og_schlafli, for at least 900.0 seconds, reset_allowed: False
2024-06-25 21:00:02.989 DEBUG (MainThread) [custom_components.adaptive_cover.const] Updating last updated to 2024-06-25 19:00:02.397924+00:00 for cover.shelly25_og_schlafli. Allow reset:False
2024-06-25 21:00:04.462 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 1.476 seconds (success: True)
2024-06-25 21:00:07.812 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:00:07.817 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 8
2024-06-25 21:00:07.818 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.shelly25_dg_anna_rolladen,  position: 12, state: 8, delta position: 4, min_change: 5.0, condition: False
2024-06-25 21:00:07.818 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:00:07.821 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 90
2024-06-25 21:00:07.821 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover_2,  position: 90, state: 90, delta position: 0, min_change: 5.0, condition: False
2024-06-25 21:00:07.821 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover_2, time delta: 0:55:56.267774, threshold: 10.0, condition: True
2024-06-25 21:00:07.822 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-06-26 00:00:00, now: 2024-06-25 21:00:07.822342, now < time: True
2024-06-25 21:00:07.822 DEBUG (MainThread) [custom_components.adaptive_cover.const] Start time: 2024-06-25 07:30:00, now: 2024-06-25 21:00:07.822527, now >= time: True
2024-06-25 21:00:07.822 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.velux_external_cover_2': True} and target call {'cover.velux_external_cover_2': 90}
2024-06-25 21:00:07.924 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.velux_external_cover_2', 'position': 90}
2024-06-25 21:00:07.945 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:00:07.948 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-06-25 21:00:07.949 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover,  position: 100, state: 100, delta position: 0, min_change: 3.0, condition: False
2024-06-25 21:00:07.954 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover, time delta: 6:06:51.321215, threshold: 5.0, condition: True
2024-06-25 21:00:07.955 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-06-26 00:00:00, now: 2024-06-25 21:00:07.955647, now < time: True
2024-06-25 21:00:07.956 DEBUG (MainThread) [custom_components.adaptive_cover.const] Start time: 2024-06-25 07:30:00, now: 2024-06-25 21:00:07.955873, now >= time: True
2024-06-25 21:00:07.956 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.velux_external_cover': True} and target call {'cover.velux_external_cover': 100}
2024-06-25 21:00:07.956 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.velux_external_cover', 'position': 100}
2024-06-25 21:00:13.278 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 5.465 seconds (success: True)
2024-06-25 21:00:13.278 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 5.333 seconds (success: True)
2024-06-25 21:00:13.279 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 5.461 seconds (success: True)
2024-06-25 21:00:15.009 DEBUG (MainThread) [custom_components.adaptive_cover.const] Cover state change
2024-06-25 21:00:15.010 DEBUG (MainThread) [custom_components.adaptive_cover.const] Processing state change event: StateChangedData(entity_id='cover.shelly25_og_schlafli', old_state=<state cover.shelly25_og_schlafli=closing; current_position=40, device_class=shutter, friendly_name=shelly25_og_schlafli, supported_features=15 @ 2024-06-25T21:00:02.397924+02:00>, new_state=<state cover.shelly25_og_schlafli=open; current_position=40, device_class=shutter, friendly_name=shelly25_og_schlafli, supported_features=15 @ 2024-06-25T21:00:15.005537+02:00>)
2024-06-25 21:00:15.010 DEBUG (MainThread) [custom_components.adaptive_cover.const] Wait for target: {'cover.shelly25_og_schlafli': False}
2024-06-25 21:00:15.014 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-06-25 21:00:15.014 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set manual control for cover.shelly25_og_schlafli, for at least 900.0 seconds, reset_allowed: False
2024-06-25 21:00:15.014 DEBUG (MainThread) [custom_components.adaptive_cover.const] Already time specified for cover.shelly25_og_schlafli, reset is not allowed by user setting:False
2024-06-25 21:00:15.844 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 0.833 seconds (success: True)
2024-06-25 21:00:18.205 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:00:18.208 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 8
2024-06-25 21:00:18.208 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.shelly25_dg_anna_rolladen,  position: 12, state: 8, delta position: 4, min_change: 5.0, condition: False
2024-06-25 21:00:18.209 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:00:18.210 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 16
2024-06-25 21:00:18.210 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.shelly25_og_schlafre,  position: 17, state: 16, delta position: 1, min_change: 5.0, condition: False
2024-06-25 21:00:18.210 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:00:18.218 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 90
2024-06-25 21:00:18.218 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover_2,  position: 90, state: 90, delta position: 0, min_change: 5.0, condition: False
2024-06-25 21:00:18.218 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover_2, time delta: 0:56:06.664766, threshold: 10.0, condition: True
2024-06-25 21:00:18.219 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-06-26 00:00:00, now: 2024-06-25 21:00:18.219323, now < time: True
2024-06-25 21:00:18.219 DEBUG (MainThread) [custom_components.adaptive_cover.const] Start time: 2024-06-25 07:30:00, now: 2024-06-25 21:00:18.219519, now >= time: True
2024-06-25 21:00:18.219 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.velux_external_cover_2': True} and target call {'cover.velux_external_cover_2': 90}
2024-06-25 21:00:18.219 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.velux_external_cover_2', 'position': 90}
2024-06-25 21:00:18.254 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:00:18.256 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-06-25 21:00:18.256 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.shelly25_og_schlafli,  position: 40, state: 100, delta position: 60, min_change: 5.0, condition: True
2024-06-25 21:00:18.256 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.shelly25_og_schlafli, time delta: 0:00:03.251160, threshold: 10.0, condition: False
2024-06-25 21:00:18.257 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:00:18.259 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-06-25 21:00:18.259 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover,  position: 100, state: 100, delta position: 0, min_change: 3.0, condition: False
2024-06-25 21:00:18.281 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover, time delta: 6:07:01.626099, threshold: 5.0, condition: True
2024-06-25 21:00:18.281 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-06-26 00:00:00, now: 2024-06-25 21:00:18.281651, now < time: True
2024-06-25 21:00:18.282 DEBUG (MainThread) [custom_components.adaptive_cover.const] Start time: 2024-06-25 07:30:00, now: 2024-06-25 21:00:18.282011, now >= time: True
2024-06-25 21:00:18.282 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.velux_external_cover': True} and target call {'cover.velux_external_cover': 100}
2024-06-25 21:00:18.282 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.velux_external_cover', 'position': 100}
2024-06-25 21:00:25.059 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 6.849 seconds (success: True)
2024-06-25 21:00:25.060 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 6.803 seconds (success: True)
2024-06-25 21:00:25.061 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 6.852 seconds (success: True)
2024-06-25 21:00:25.061 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 6.855 seconds (success: True)
2024-06-25 21:00:25.062 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 6.808 seconds (success: True)
2024-06-25 21:01:07.220 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:01:07.224 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 8
2024-06-25 21:01:07.224 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.shelly25_dg_anna_rolladen,  position: 12, state: 8, delta position: 4, min_change: 5.0, condition: False
2024-06-25 21:01:07.224 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:01:07.233 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 90
2024-06-25 21:01:07.233 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover_2,  position: 90, state: 90, delta position: 0, min_change: 5.0, condition: False
2024-06-25 21:01:07.233 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover_2, time delta: 0:56:55.679856, threshold: 10.0, condition: True
2024-06-25 21:01:07.234 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-06-26 00:00:00, now: 2024-06-25 21:01:07.234452, now < time: True
2024-06-25 21:01:07.234 DEBUG (MainThread) [custom_components.adaptive_cover.const] Start time: 2024-06-25 07:30:00, now: 2024-06-25 21:01:07.234612, now >= time: True
2024-06-25 21:01:07.234 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.velux_external_cover_2': True} and target call {'cover.velux_external_cover_2': 90}
2024-06-25 21:01:07.235 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.velux_external_cover_2', 'position': 90}
2024-06-25 21:01:07.247 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:01:07.249 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-06-25 21:01:07.249 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover,  position: 100, state: 100, delta position: 0, min_change: 3.0, condition: False
2024-06-25 21:01:07.249 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover, time delta: 6:07:50.615909, threshold: 5.0, condition: True
2024-06-25 21:01:07.249 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-06-26 00:00:00, now: 2024-06-25 21:01:07.249962, now < time: True
2024-06-25 21:01:07.250 DEBUG (MainThread) [custom_components.adaptive_cover.const] Start time: 2024-06-25 07:30:00, now: 2024-06-25 21:01:07.250096, now >= time: True
2024-06-25 21:01:07.250 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.velux_external_cover': True} and target call {'cover.velux_external_cover': 100}
2024-06-25 21:01:07.250 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.velux_external_cover', 'position': 100}
2024-06-25 21:01:11.921 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 4.696 seconds (success: True)
2024-06-25 21:01:11.922 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 4.702 seconds (success: True)
2024-06-25 21:01:11.922 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 4.676 seconds (success: True)
2024-06-25 21:02:07.221 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:02:07.226 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 8
2024-06-25 21:02:07.229 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.shelly25_dg_anna_rolladen,  position: 12, state: 8, delta position: 4, min_change: 5.0, condition: False
2024-06-25 21:02:07.229 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:02:07.231 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 90
2024-06-25 21:02:07.232 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover_2,  position: 90, state: 90, delta position: 0, min_change: 5.0, condition: False
2024-06-25 21:02:07.232 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover_2, time delta: 0:57:55.678177, threshold: 10.0, condition: True
2024-06-25 21:02:07.232 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-06-26 00:00:00, now: 2024-06-25 21:02:07.232628, now < time: True
2024-06-25 21:02:07.232 DEBUG (MainThread) [custom_components.adaptive_cover.const] Start time: 2024-06-25 07:30:00, now: 2024-06-25 21:02:07.232763, now >= time: True
2024-06-25 21:02:07.233 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.velux_external_cover_2': True} and target call {'cover.velux_external_cover_2': 90}
2024-06-25 21:02:07.233 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.velux_external_cover_2', 'position': 90}
2024-06-25 21:02:07.257 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:02:07.260 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-06-25 21:02:07.260 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover,  position: 100, state: 100, delta position: 0, min_change: 3.0, condition: False
2024-06-25 21:02:07.260 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.velux_external_cover, time delta: 6:08:50.627198, threshold: 5.0, condition: True
2024-06-25 21:02:07.261 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-06-26 00:00:00, now: 2024-06-25 21:02:07.261277, now < time: True
2024-06-25 21:02:07.262 DEBUG (MainThread) [custom_components.adaptive_cover.const] Start time: 2024-06-25 07:30:00, now: 2024-06-25 21:02:07.261454, now >= time: True
2024-06-25 21:02:07.267 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.velux_external_cover': True} and target call {'cover.velux_external_cover': 100}
2024-06-25 21:02:07.267 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.velux_external_cover', 'position': 100}
2024-06-25 21:02:11.223 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 4.001 seconds (success: True)
2024-06-25 21:02:11.233 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 4.003 seconds (success: True)
2024-06-25 21:02:11.234 DEBUG (MainThread) [custom_components.adaptive_cover] Finished fetching adaptive_cover data in 3.977 seconds (success: True)
2024-06-25 21:02:18.194 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:02:18.197 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 8
2024-06-25 21:02:18.197 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.shelly25_dg_anna_rolladen,  position: 12, state: 8, delta position: 4, min_change: 5.0, condition: False
2024-06-25 21:02:18.197 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:02:18.198 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 16
2024-06-25 21:02:18.198 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.shelly25_og_schlafre,  position: 17, state: 16, delta position: 1, min_change: 5.0, condition: False
2024-06-25 21:02:18.199 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-06-25 21:02:18.201 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 90
swa72 commented 3 months ago

Even funnier, I've just set the end time for the right one to 21:25 and it did move. Odd.

travisp commented 3 months ago

I'm currently experiencing this issue as well. I have a room set to an end time of 7:30pm. It's currently 7:54pm and the shade is 1% open (and adaptive cover reports that as the correct amount). The sun doesn't set for another 30 minutes. It should be moving to 0% (fully closed).

I'll try to capture some good debug logging of this.

basbruss commented 3 months ago

Please also add the diagnostics from the integration showing the parameter settings in addition to the debug logs. I will take a look again in the coming weeks when I can compare your settings to find the bug

Lipown commented 2 months ago

Well I have similar behavior and will send log later. If I will add entity for dusk the blinds retract at 2am in the morning exactly. When I set only the time without entity for 9:00 pm it will retract at 8:40 pm exactly :)

image

travisp commented 2 months ago

I have this issue with several shades. For this shade I have the following settings:

End time: 7:30pm Sunset position: 0% (closed) Always adjust position to sunset default at end time: on Actual sunset time on the day of debug log: approximately 8:04pm

What happens: The shade gets stuck in position 1. Nothing seems to happen at the end time. Instead, around 7:50pm, adaptive cover says the calculated position is now 0 (because of the angle of the sun). It won't adjust to 0 because we are past the end time. However, at the end time, the shade was never adjusted.

It seems like the end time is correctly preventing the shade from being adjusted after the end time, but it does not adjust to sunset default at the end time.

Here is the debug log filtered to just this entity:

2024-08-02 19:25:09.863 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:25:10.312 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:25:10.312 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 2, state: 1, delta position: 1, min_change: 1.0, condition: True
2024-08-02 19:25:10.312 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:27:01.712800, threshold: 2.0, condition: True
2024-08-02 19:25:10.312 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 19:25:10.312898, now < time: True
2024-08-02 19:25:10.313 DEBUG (MainThread) [custom_components.adaptive_cover.const] Start time: 2024-08-02 08:00:00, now: 2024-08-02 19:25:10.312951, now >= time: True
2024-08-02 19:25:10.313 DEBUG (MainThread) [custom_components.adaptive_cover.const] Set wait for target {'cover.kids_bedroom_2_orig': True} and target call {'cover.kids_bedroom_2_orig': 1}
2024-08-02 19:25:10.313 DEBUG (MainThread) [custom_components.adaptive_cover.const] Run set_cover_position with data {'entity_id': 'cover.kids_bedroom_2_orig', 'position': 1}
2024-08-02 19:25:12.788 DEBUG (MainThread) [custom_components.adaptive_cover.const] Cover state change
2024-08-02 19:25:12.788 DEBUG (MainThread) [custom_components.adaptive_cover.const] Processing state change event: StateChangedData(entity_id='cover.kids_bedroom_2_orig', old_state=<state cover.kids_bedroom_2_orig=open; current_position=2, assumed_state=True, device_class=shade, friendly_name=Kid's bedroom 2 original, supported_features=15 @ 2024-08-02T08:00:29.657813-04:00>, new_state=<state cover.kids_bedroom_2_orig=open; current_position=1, assumed_state=True, device_class=shade, friendly_name=Kid's bedroom 2 original, supported_features=15 @ 2024-08-02T08:00:29.657813-04:00>)
2024-08-02 19:25:12.788 DEBUG (MainThread) [custom_components.adaptive_cover.const] Position 1 reached for cover.kids_bedroom_2_orig
2024-08-02 19:25:12.788 DEBUG (MainThread) [custom_components.adaptive_cover.const] Wait for target: {'cover.kids_bedroom_2_orig': False}
2024-08-02 19:25:12.789 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:27:10.100 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:27:10.100 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:27:10.100 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:27:39.933 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:27:39.934 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:27:39.934 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:29:10.763 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:29:10.764 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:29:10.764 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:30:39.937 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:30:39.938 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:30:39.938 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:33:10.092 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:33:10.093 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:33:10.093 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:33:39.938 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:33:39.939 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:33:39.939 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:35:46.237 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:35:46.846 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:35:46.846 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:36:39.942 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:36:39.943 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:36:39.943 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:39:09.875 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:39:09.875 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:39:09.875 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:39:39.943 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:39:39.944 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:39:39.944 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:42:39.945 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:42:39.946 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:42:39.946 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:45:39.950 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:45:39.950 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:45:39.950 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:47:10.338 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:47:10.339 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:47:10.339 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:48:39.953 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:48:39.954 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:48:39.954 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:49:10.101 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:49:10.102 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:49:10.102 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:51:10.345 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:51:10.346 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:51:10.346 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:51:39.957 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:51:39.958 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 1
2024-08-02 19:51:39.958 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 1, delta position: 0, min_change: 1.0, condition: False
2024-08-02 19:53:10.047 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:53:10.047 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 0
2024-08-02 19:53:10.047 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 0, delta position: 1, min_change: 1.0, condition: True
2024-08-02 19:53:10.047 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:27:57.259845, threshold: 2.0, condition: True
2024-08-02 19:53:10.047 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 19:53:10.047948, now < time: False
2024-08-02 19:55:09.885 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:55:09.886 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 0
2024-08-02 19:55:09.886 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 0, delta position: 1, min_change: 1.0, condition: True
2024-08-02 19:55:09.886 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:29:57.098148, threshold: 2.0, condition: True
2024-08-02 19:55:09.886 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 19:55:09.886286, now < time: False
2024-08-02 19:57:10.883 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:57:10.884 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 0
2024-08-02 19:57:10.884 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 0, delta position: 1, min_change: 1.0, condition: True
2024-08-02 19:57:10.884 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:31:58.096385, threshold: 2.0, condition: True
2024-08-02 19:57:10.884 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 19:57:10.884462, now < time: False
2024-08-02 19:57:39.965 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:57:39.965 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 0
2024-08-02 19:57:39.965 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 0, delta position: 1, min_change: 1.0, condition: True
2024-08-02 19:57:39.965 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:32:27.178011, threshold: 2.0, condition: True
2024-08-02 19:57:39.966 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 19:57:39.966085, now < time: False
2024-08-02 19:59:10.348 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 19:59:10.348 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 0
2024-08-02 19:59:10.348 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 0, delta position: 1, min_change: 1.0, condition: True
2024-08-02 19:59:10.349 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:33:57.561065, threshold: 2.0, condition: True
2024-08-02 19:59:10.349 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 19:59:10.349136, now < time: False
2024-08-02 20:00:39.968 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 20:00:39.969 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 0
2024-08-02 20:00:39.969 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 0, delta position: 1, min_change: 1.0, condition: True
2024-08-02 20:00:39.969 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:35:27.181276, threshold: 2.0, condition: True
2024-08-02 20:00:39.969 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 20:00:39.969423, now < time: False
2024-08-02 20:01:10.109 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 20:01:10.110 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 0
2024-08-02 20:01:10.110 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 0, delta position: 1, min_change: 1.0, condition: True
2024-08-02 20:01:10.110 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:35:57.322692, threshold: 2.0, condition: True
2024-08-02 20:01:10.110 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 20:01:10.110832, now < time: False
2024-08-02 20:02:46.305 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 20:02:46.306 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-08-02 20:02:46.306 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 100, delta position: 99, min_change: 1.0, condition: True
2024-08-02 20:02:46.306 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:37:33.518278, threshold: 2.0, condition: True
2024-08-02 20:02:46.306 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 20:02:46.306389, now < time: False
2024-08-02 20:03:09.885 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 20:03:10.629 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-08-02 20:03:10.630 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 100, delta position: 99, min_change: 1.0, condition: True
2024-08-02 20:03:10.630 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:37:57.842088, threshold: 2.0, condition: True
2024-08-02 20:03:10.630 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 20:03:10.630195, now < time: False
2024-08-02 20:05:10.114 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 20:05:10.115 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-08-02 20:05:10.115 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 100, delta position: 99, min_change: 1.0, condition: True
2024-08-02 20:05:10.115 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:39:57.327369, threshold: 2.0, condition: True
2024-08-02 20:05:10.115 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 20:05:10.115482, now < time: False
2024-08-02 20:06:39.976 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity state change
2024-08-02 20:06:39.977 DEBUG (MainThread) [custom_components.adaptive_cover.const] Calculated position: 100
2024-08-02 20:06:39.977 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig,  position: 1, state: 100, delta position: 99, min_change: 1.0, condition: True
2024-08-02 20:06:39.977 DEBUG (MainThread) [custom_components.adaptive_cover.const] Entity: cover.kids_bedroom_2_orig, time delta: 0:41:27.189240, threshold: 2.0, condition: True
2024-08-02 20:06:39.977 DEBUG (MainThread) [custom_components.adaptive_cover.const] End time: 2024-08-02 19:30:00, now: 2024-08-02 20:06:39.977332, now < time: False

Here is the relevant section from the config:

{
  "data": {
    "title": "Adaptive Cover Configuration",
    "type": "config_entry",
    "identifier": "a267c3ce35881fb0c6ccf86244211fec",
    "config_data": {
      "__type": "<class 'mappingproxy'>",
      "repr": "mappingproxy({'name': 'Kids West', 'sensor_type': 'cover_blind'})"
    },
    "config_options": {
      "__type": "<class 'mappingproxy'>",
      "repr": "mappingproxy({'mode': 'basic', 'set_azimuth': 299.0, 'window_height': 1.8, 'distance_shaded_area': 0.2, 'default_percentage': 100.0, 'max_position': 100.0, 'fov_left': 90.0, 'fov_right': 90.0, 'group': ['cover.kids_bedroom_2_orig'], 'inverse_state': False, 'sunset_position': 0.0, 'sunset_offset': 0.0, 'sunrise_offset': 0.0, 'length_awning': None, 'angle': None, 'slat_distance': None, 'slat_depth': None, 'tilt_mode': None, 'temp_entity': 'climate.kids_bedroom_ecobee', 'presence_entity': None, 'weather_entity': 'weather.kids_bedroom_ecobee', 'temp_low': 40.0, 'temp_high': 80.0, 'outside_temp': None, 'climate_mode': True, 'weather_state': ['sunny', 'partlycloudy', 'cloudy', 'clear'], 'delta_position': 1.0, 'delta_time': 2.0, 'start_time': '08:00:00', 'start_entity': None, 'manual_override_duration': {'hours': 3, 'minutes': 0, 'seconds': 0}, 'manual_override_reset': False, 'blind_spot_right': None, 'blind_spot_left': None, 'blind_spot_elevation': None, 'blind_spot': False, 'min_elevation': None, 'max_elevation': None, 'transparent_blind': False, 'end_time': '19:30:00', 'return_sunset': True, 'end_entity': None, 'lux_threshold': 1000.0, 'irradiance_threshold': 300.0, 'lux_entity': None, 'irradiance_entity': None})"
    }
  }
}

or

{
  "mode": "basic",
  "set_azimuth": 299.0,
  "window_height": 1.8,
  "distance_shaded_area": 0.2,
  "default_percentage": 100.0,
  "max_position": 100.0,
  "fov_left": 90.0,
  "fov_right": 90.0,
  "group": ["cover.kids_bedroom_2_orig"],
  "inverse_state": false,
  "sunset_position": 0.0,
  "sunset_offset": 0.0,
  "sunrise_offset": 0.0,
  "length_awning": null,
  "angle": null,
  "slat_distance": null,
  "slat_depth": null,
  "tilt_mode": null,
  "temp_entity": "climate.kids_bedroom_ecobee",
  "presence_entity": null,
  "weather_entity": "weather.kids_bedroom_ecobee",
  "temp_low": 40.0,
  "temp_high": 80.0,
  "outside_temp": null,
  "climate_mode": true,
  "weather_state": ["sunny", "partlycloudy", "cloudy", "clear"],
  "delta_position": 1.0,
  "delta_time": 2.0,
  "start_time": "08:00:00",
  "start_entity": null,
  "manual_override_duration": {
    "hours": 3,
    "minutes": 0,
    "seconds": 0
  },
  "manual_override_reset": false,
  "blind_spot_right": null,
  "blind_spot_left": null,
  "blind_spot_elevation": null,
  "blind_spot": false,
  "min_elevation": null,
  "max_elevation": null,
  "transparent_blind": false,
  "end_time": "19:30:00",
  "return_sunset": true,
  "end_entity": null,
  "lux_threshold": 1000.0,
  "irradiance_threshold": 300.0,
  "lux_entity": null,
  "irradiance_entity": null
}
travisp commented 2 months ago

Just to add some additional things that I hope are helpful:

It looks like the code used for trying to adjust the shade at end time is:

async_track_point_in_time(hass, coordinator.async_timed_refresh, end_time)

In that method, there are two different logger outputs depending on the result of the if control statement. I do not see either statement in my recent logs anywhere.

I don't know the home assistant code very well, but I notice that "async_track_point_in_time" fires only once — this may be entirely off, but maybe it only fired the first time and then needs to be setup for the next day?

If that were the case, I would think the callback called by async_track_point_in_time would need to setup the next async_track_point_in_time. Or async_track_time_change might be a better method to use as fires every time the local time matches a pattern (rather than passing in a datetime string, you pass in hour, minute, second)

travisp commented 1 month ago

Sorry to keep adding comments here, but some more playing around suggests to me that the issue is what I thought it was. When I restart and force a fresh load of everything, this configuration does get used. So, I think it's only on subsequent days when it stops working, when there is no longer a track_point_in_time set.

However, I noticed a second bug when it actually worked. This had no effect in my case, but after adaptive-cover correctly moved the shade position to 0 (my sunset position) at 7:30pm (my end time, which is before sunset), once the position was updated in adaptive-cover, it decided that "manual control" had been triggered for the shade. The position was no longer 1, which is the position it would have been if it were not past the end_time.

In the sunset_valid method, it does not consider end time. Therefore, adaptive-cover decided that the position of 0 was set manually, and enabled manual control. If we didn't have manual override, I assume adaptive-cover would have moved the shade back to position 1.

I think both: 1) the code should either keep setting async_track_point_in_time or switch to async_track_time_change and 2) sunset_valid (possibly renamed) should take into account end_time in addition to offset

basbruss commented 1 month ago

@travisp Thanks for your insights, the method that only loaded at setup was indeed the culprit.

This should allow to update the listener and the time dynamically without reloading the full integration #278