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.0.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.0-py3-none-any.whl (44.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sun_hit_detector-2.2.0.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.0.tar.gz
Algorithm Hash digest
SHA256 201c0f85ffec03bc4b6ffe11e3649c1928c79ef4db60a6fdcda84e3bc60744b0
MD5 cf04dff3f33e9570d7d30aa518059a68
BLAKE2b-256 96427e78662a27a3cdc53b77284ee04d131facaf0a8ed7a06aa604f74f2a4c0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for sun_hit_detector-2.2.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sun_hit_detector-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e921229b7efc5b87f06dcd083191d4013bb24d4cd6e804c3b6f299189b330a63
MD5 265c3c1239614f9ed9c5e52d891447de
BLAKE2b-256 c95c9a5b494c87c6849d14004bcc08f129f9e8dd86fcbdf2e293e3877ca4a524

See more details on using hashes here.

Provenance

The following attestation bundles were made for sun_hit_detector-2.2.0-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