Hello, I have been working on this for some time and I could really use some help.
In hassio I have created a binary sensor that communicates with a light sensor that can go into “isdark” state if the lux goes below 100.
I then tried add an automation that when “isdark” activates it sends and on state to the EspixelStick and have lights come on. I can get my “isdark” state to on and I can manually turn on lights but can’t get lights to trigger from “isdark”.
Below is parts of my config.yaml
#espixelstick subnet 110
- platform: mqtt
name: "PixelStick01"
state_topic: "matrix/esps/light/status"
command_topic: "matrix/esps/light/switch"
brightness_state_topic: "matrix/esps/brightness/status"
brightness_command_topic: "matrix/esps/brightness/set"
rgb_state_topic: "matrix/esps/rgb/status"
rgb_command_topic: "matrix/esps/rgb/set"
brightness: true
flash: true
rgb: true
optimistic: false
qos: 0
sensor:
#Light sensor
- platform: mqtt
state_topic: "bruh/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 }}'
# Binary Sensors
binary_sensor:
- platform: threshold
name: isdark
entity_id: sensor.sn1_ldr
lower: 100
hidden: true
#Groups
group:
sensor_node_1_card:
name: Sensor Node 1
entities:
- sensor.sn1_temperature
- sensor.sn1_humidity
- sensor.sn1_ldr
- light.sn1_led
automation:
- alias: EspixelStick110 On
trigger:
- platform: state
entity_id: binary_sensor.isdark
to: 'on'
condition:
- condition: state
entity_id: binary_sensor.isdark
state: 'on'
action:
- service: mqtt.publish
data_template:
topic: "matrix/esps"
payload: '{"state":"ON"}'
- alias: EspixelStick110 Off
trigger:
- platform: state
entity_id: binary_sensor.isdark
to: 'off'
condition:
- condition: state
entity_id: binary_sensor.isdark
state: 'on'
action:
- service: mqtt.publish
data_template:
topic: "matrix/esps"
payload: '{"state":"OFF"}'
script: !include scripts.yaml