pull/502/head
parent
8d2291b66d
commit
488309d610
@ -1,19 +0,0 @@
|
|||||||
#-------------------------------------------
|
|
||||||
# Bruh Light Sensor Related Packages
|
|
||||||
#-------------------------------------------
|
|
||||||
#------LightSensor Node---http://amzn.to/2oUgj5i
|
|
||||||
homeassistant:
|
|
||||||
customize:
|
|
||||||
sensor.sn1_ldr:
|
|
||||||
icon: mdi:sensor
|
|
||||||
friendly_name: Light Sensor
|
|
||||||
#emulated_hue_hidden: False
|
|
||||||
hidden: False
|
|
||||||
#---Sensor for Light-----------------------------
|
|
||||||
sensor:
|
|
||||||
- platform: mqtt
|
|
||||||
state_topic: "home/sensornode1"
|
|
||||||
name: "SN1 LDR"
|
|
||||||
##This sensor is not calibrated to actual LUX. Rather, this a map of the input voltage ranging from 0 - 1023.
|
|
||||||
unit_of_measurement: "LUX"
|
|
||||||
value_template: '{{ value_json.ldr }}'
|
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
#-------------------------------------------
|
||||||
|
# @BrianHanifin's Light sensor speech helper. - https://gist.github.com/brianhanifin/1f9436c7b6c28917c9be02605b6cff74
|
||||||
|
#-------------------------------------------
|
||||||
|
#------LightSensor Node---http://amzn.to/2oUgj5i
|
||||||
|
homeassistant:
|
||||||
|
customize:
|
||||||
|
sensor.lights_on:
|
||||||
|
icon: mdi:sensor
|
||||||
|
friendly_name: Lights on
|
||||||
|
#emulated_hue_hidden: False
|
||||||
|
hidden: true
|
||||||
|
#---Sensor for Light-----------------------------
|
||||||
|
sensor:
|
||||||
|
- platform: template
|
||||||
|
sensors:
|
||||||
|
lights_on:
|
||||||
|
value_template: >
|
||||||
|
{% macro get_lights_on() -%}
|
||||||
|
{%- for group in states.group|groupby('state') -%}
|
||||||
|
{%- for entity in group.list -%}
|
||||||
|
{%- if entity.state == 'on'
|
||||||
|
and entity.name.split(' ')[1]|lower == 'lights'
|
||||||
|
and entity.name.split(' ')[0]|lower != 'interior'
|
||||||
|
and entity.name.split(' ')[0]|lower != 'all'
|
||||||
|
-%}
|
||||||
|
{{ entity.entity_id }}{{ ' ' }}
|
||||||
|
{%- endif -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- endfor -%}
|
||||||
|
{%- endmacro %}
|
||||||
|
{{ get_lights_on()|trim|replace(' ', ',') }}
|
||||||
Loading…
Reference in new issue