Skip to main content

A deterministic geometric simulator for sunlight-plant hit detection

Project description

Sun Shade Integration for Home Assistant

A Home Assistant custom integration that uses 3D ray-casting simulation to determine when direct sunlight reaches indoor plants through windows.

                        * Sun
                       /
                      /  azimuth + elevation
                     /
   =================/=================
   ||    WALL    |     |    WALL    ||
   ||            |     |           ||          OUTSIDE
   ||            |  W  |           ||
   ||            |  I  |           ||
   ||            |  N  | ray       ||
   ||            |  D  |/          ||
   =============|  O  |============/
                |  W  |\
                |     | \            +------------------------------+
                +-----+  \          |  Home Assistant Entities      |
                       \  \         |------------------------------|
                    /---\--\        |  window_1a has sun:  ON       |
       ROOM        | //  \ |       |  window_1a intensity: 78%     |
                   | PLANT |       |  window_1a angle:    25 deg   |
                   | \\  / |       |                               |
                   +-------+       |  Plant sun start:  13:45      |
                                   |  Plant sun end:    15:30      |
                                   |  Plant sun duration: 120 min  |
                                   +-------------------------------+

Entities Created

Per window (real-time, updated every N seconds):

  • binary_sensor.<window>_has_sun — whether the window is receiving direct sunlight
  • sensor.<window>_sun_intensity — intensity factor (0-100%)
  • sensor.<window>_sun_angle — angle between sun and window normal (0-90 deg)

Plant-level (daily forecast, computed once per day):

  • sensor.plant_sun_start — first time sun hits the plant today (like sunrise)
  • sensor.plant_sun_end — last time sun hits the plant today (like sunset)
  • sensor.plant_sun_duration — total sun exposure in minutes (like day length)

Installation

HACS (Recommended)

  1. Open HACS in your Home Assistant instance
  2. Click the three dots in the top right corner and select Custom repositories
  3. Add https://github.com/matiazo/SunHitsIndoorPlant3DSimulator with category Integration
  4. Click Install
  5. Restart Home Assistant
  6. Go to Settings > Integrations > Add Integration and search for "Sun Shade Integration"

Manual

  1. Copy the custom_components/sun_shade_integration folder into your Home Assistant config/custom_components/ directory
  2. Restart Home Assistant
  3. Go to Settings > Integrations > Add Integration and search for "Sun Shade Integration"

Documentation

See the full integration docs at custom_components/sun_shade_integration/README.md for config flow details, entity reference, and troubleshooting.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sun_hit_detector-2.2.1.tar.gz (52.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sun_hit_detector-2.2.1-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

Details for the file sun_hit_detector-2.2.1.tar.gz.

File metadata

  • Download URL: sun_hit_detector-2.2.1.tar.gz
  • Upload date:
  • Size: 52.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sun_hit_detector-2.2.1.tar.gz
Algorithm Hash digest
SHA256 42d9dff648612bcf59650ff44004fa287270b173fc00f065ee68e1509000c99f
MD5 973f13ac39ce0d10069797f83c7dc8fb
BLAKE2b-256 4c47ed5c9709e8304201e63a197f172c93132a1d68e5994d65e6ef1a1b8a1e21

See more details on using hashes here.

Provenance

The following attestation bundles were made for sun_hit_detector-2.2.1.tar.gz:

Publisher: publish.yml on matiazo/SunHitsIndoorPlant3DSimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sun_hit_detector-2.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for sun_hit_detector-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e0a1b80bce4cb27b50f4ec0d2d96659c1f4c8bef54fd1988095fc94a2cea6992
MD5 805c947303ecfb7881b97ea24c3635a9
BLAKE2b-256 0e53bc3224a2ede93e6a3339a2c3d97a921f8e3eb61faaf7386706d212df7b7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for sun_hit_detector-2.2.1-py3-none-any.whl:

Publisher: publish.yml on matiazo/SunHitsIndoorPlant3DSimulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page