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.
You can install this integration using the custom repository option in HACS.
- Add the repository URL to the list of custom repositories in HACS
- Select and install the integration in HACS
- Restart Home Assistant
- Configure your entities
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.