Created
December 13, 2021 20:36
-
-
Save GuySie/d60984c58aa1e5b1ac2dfe75c070e3f9 to your computer and use it in GitHub Desktop.
Night State template for Home Assistant's configuration.yaml to create a 1/0 night entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sensor: | |
- platform: template | |
sensors: | |
nightstate: | |
friendly_name: Night State | |
value_template: "{% if is_state('sun.sun', 'below_horizon') %}1{% else %}0{% endif %}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment