nielsfaber / scheduler-component

Custom component for HA that enables the creation of scheduler entities
GNU General Public License v3.0
631 stars 41 forks source link

add even or odd week #219

Closed m4sis closed 1 year ago

m4sis commented 1 year ago

Hello,

would it be possible to add the possibility of selecting a week even or odd week in day programming?

thank you

nielsfaber commented 1 year ago

Hello, I think this request is too specific. I don’t want to make the card more complex than it already is and I doubt many people will benefit from your proposal. As alternative I propose that you create a binary sensor with a template, such that the sensor is ON when week number is even and OFF when the week number is odd. You can include the state of this binary sensor as condition for a schedule via the card.

m4sis commented 1 year ago

hello, I can't create the sensor in question

nielsfaber commented 1 year ago

Example for a template:

{{ now().isocalendar()[1] % 2 == 0 }}

Set it up using a Template binary sensor: https://www.home-assistant.io/integrations/template/

The sensor will be ON when the weeknumber is EVEN. You can include this sensor in the scheduler card, then it becomes available to configure as condition.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days