Skip to content

Split up the day into predefined states based on time and sun elevation.

License

Notifications You must be signed in to change notification settings

EuleMitKeule/hass_day_state

Repository files navigation

hacs_badge Code Quality

HASS Day State

HASS Day State allows you to create sensor entities in Home Assistant that split up the day into predefined states.
This is useful for creating automations that behave differently based on combinations sun elevation and current time.

Installation

You can install this integration using the custom repository option in HACS.

  1. Add the repository URL to the list of custom repositories in HACS
  2. Select and install the integration in HACS
  3. Restart Home Assistant
  4. Configure your entities

Configuration

To create the entities you need to define them in your configuration.yaml file.
For a full example of all available options see examples.

sensor:
- platform: hass_day_state
  sensors:
  - unique_id: kuche_day_state
    friendly_name: Küche Day State
    default_state: day
    states:
    - type: elevation
      name: evening
      value: 3.5
    - type: time
      name: night
      from: "01:00"
      to: "05:30"

The states will get sorted automatically so that the highest reached state will be selected.
Time states have priority over elevation states.
Elevation values always mean that the current elevation needs to be less than the specified value for the state to be reached.