danobot / entity-controller

Home Assistant Entity and lighting controller for managing devices with timers, scripts, and sun-based time restrictions.
https://danobot.github.io/ec-docs/
GNU General Public License v3.0
294 stars 40 forks source link

Time Constraints input time update #281

Closed dankarization closed 1 year ago

dankarization commented 2 years ago

Description

Now you can only use start_time and end_time as hardcoded variables or with sunset values. I think it will be even more useful to implement any datetime variables there. With this, user can easily change all values for entity controller at the same time through UI just changing 2 datetime variables. Same is useful for night mode times.

Configuration

motion_light_sun:
  sensor: binary_sensor.living_room_motion
  entity: light.table_lamp
  start_time: input_datetime.daylight
  end_time: input_datetime.nightlight

Steps to reproduce

Well, none

Expected behavior

Also none

Actual Behaviour

Still none

Logs

nope

Provide logs at DEBUG level. 

nope

Version

9.5.2
danobot commented 1 year ago

This is basically asking for templating which I attempted in #150 but eventually gave up due to technical challenges.

dankarization commented 1 year ago

At least add dusk and rising please, not only sunset and sunrise :(

danobot commented 1 year ago

What is dusk and rising? You can probably achieve the same effect using sunset offsets.

dankarization commented 1 year ago

Maybe i was using wrong translations. HA has more sun parameters besides sunset and sunrise. image

You can try and use offsets, but technically all it's movement, so as all of these values will change non-linear throughout the year, + they are all different on different locations, which needs you to change offsets for this too.