Skip to content

Instantly share code, notes, and snippets.

Created November 9, 2017 00:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/b87f8ea750b42fbdb2ca6669ed9aa73e to your computer and use it in GitHub Desktop.
Save anonymous/b87f8ea750b42fbdb2ca6669ed9aa73e to your computer and use it in GitHub Desktop.
Home Assistant Exterior Lux approximation
- platform: template
sensors:
above_cloud_lux:
friendly_name: "Above Cloud Lux"
unit_of_measurement: "Lux"
value_template: >-
{{ states.sun.sun.attributes.daylight | round(0) }}
lux:
friendly_name: "Exterior Lux"
unit_of_measurement: "lux"
value_template: '{{ ((100-states.sensor.dark_sky_cloud_coverage.state|float)/100 * states.sun.sun.attributes.daylight) | round(0) }}'
# consider using other methods of calculation here as well
# this could be calculated using the wunderground solar_radiation value, if available
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment