Laziest Possible Door Display (LED + Paper)

Lazy / Simple Door Dashboard (LED + Paper)

I have multiple children and my house has multiple openings. One of my biggest annoyances is kids leaving doors open - especially if the temperature is either hot or cold. I installed this VERY SIMPLE door dashboard in the center of my house so at a quick look I can identify what’s open and what’s closed.

Supplies

  • MyQ garage door
  • August Front Door
  • Zigbee door sensors
  • WLED instance with SK6822 running on ESP8266 (60 led/meter)
  • 1 Sheet o`paper
  • Scotch Tape

What I did

Knowing I had a 60 led / meter light strip - I made an image (with the appropriate spacing .656 inch per line) and labeled each line with an “Area” of my house. I figured I could “wrap” this printout around an LED Strip and then figure out how to enable/disable the lights accordingly.

  • In the case of my front door I use yellow to show closed+locked
  • For everything Red means open

The next step was to play around wiht WLED and try to understand the API. I looked at the json/state api end point and identified I could modify the LEDs directly.

So taking that into account I built out a rest command inside of configuration.yaml - and as you can see below its rather on the complicated and detailed side! :slight_smile:

Rest Command

I configured a rest-command to integrate with a WLED instance

rest_command:
  door_lights_1:
    url: http://192.168.1.144/json/state
    method: post
    content_type: "application/json; charset=utf-8"
    payload: '{"seg": {"i":[[{{ iif(is_state("binary_sensor.front_door_open","off") and is_state("lock.front_door","locked"),"0,0,0","") }}{{ iif(is_state("binary_sensor.front_door_open","off") and is_state("lock.front_door","unlocked"),"100,100,0","") }}{{ iif(is_state("binary_sensor.front_door_open","on"),"100,0,0","")}}], [{{ iif(is_state("cover.garage_door","closed"),0,1) * 100}},0,0], [{{ iif(is_state("binary_sensor.back_door_contact", "off"), 0, 1) * 100 }},0,0],[{{ iif(is_state("binary_sensor.shed_contact","off"), 0, 1) * 100 }},0,0]]}}'

Once this was tested and working the next step was to setup an automation which triggers it (as follows below)

Automation

alias: Door Announcements
description: This will fire off various TTS calls when stuff happens.
trigger:
  - platform: state
    entity_id:
      - binary_sensor.back_door_contact
    id: back_door
  - platform: state
    entity_id:
      - binary_sensor.front_door_open
    id: front_door
  - platform: state
    entity_id:
      - cover.garage_door
    id: garage_door
  - platform: state
    entity_id:
      - binary_sensor.shed_contact
  - platform: state
    entity_id:
      - lock.front_door
condition: []
action:
  - service: rest_command.door_lights_1
    data: {}
mode: single

And now I have a working door notification display at zero cost because mostly I just had stuff kicking around. Its easy at night to take a peek and see if there are any LEDs lit and then go close whatever was left open.

And here is another view of the coord mess ! :slight_smile:

6 Likes

That’s awesome. I love it because it’s K.i.s.s (Keep it stupid simple) friendly. :slight_smile:

1 Like

I’m in the process of upgrading the way this works and adding more segments. It sounds like there may be an easier way to do this in the future as WLED is apparently getting the ability to set individual LEDs …

I’ve added the following “stuff” to my configuration.yaml:

Define a template sensor

      # This template is used to set the door status payload - see the associated rest command
      - name: door_status_payload
        state: >
          {% macro get_mqtt_rgb(var1) -%}
            {{'153,77,255' if is_state(var1,'unavailable') or is_state(var1,'unknown') -}}
            {{'0,0,0' if is_state(var1,'off') -}}
            {{'100,0,0' if is_state(var1,'on') -}}
          {% endmacro -%}
          {% macro get_garage_rgb(var1) -%}
            {{'153,77,255' if is_state(var1,'unavailable') or is_state(var1,'unknown') -}}
            {{'0,0,0' if is_state(var1,'closed') -}}
            {{'100,0,0' if is_state(var1,'open') -}}
          {% endmacro -%}
          {%- macro get_lock_door_value(door,lock) -%}
            {{'0,0,0' if is_state(door,"off") and is_state(lock,"locked") -}}
            {{'100,100,0' if is_state(door,"off") and is_state(lock,"unlocked") -}}
            {{'100,0,0' if is_state(door,"on") -}}
          {%- endmacro -%}
          {"seg": {"i":[[{{ get_lock_door_value('binary_sensor.front_door_open','lock.front_door' ) }}],[{{ get_lock_door_value('binary_sensor.zone_1','lock.front_door' ) }}],[{{ get_mqtt_rgb('binary_sensor.zone_2') }}],[{{get_garage_rgb('cover.garage_door')}}],[{{ get_mqtt_rgb('binary_sensor.back_door_contact') }}],[{{ get_mqtt_rgb('binary_sensor.shed_contact')}}],[{{get_mqtt_rgb('binary_sensor.zone_3')}}],[{{get_mqtt_rgb('binary_sensor.zone_4')}}],[{{get_mqtt_rgb('binary_sensor.stairs_motion_sensor_motion')}}],[{{get_mqtt_rgb('binary_sensor.basement_stairs_motion_sensor_motion')}}] ]}}

Define a REST command

rest_command:
  # -----------------------------------------------------------------------
  # Fire off a WLED call to set the door status using the following style:
  # service: rest_command.door_lights_with_ip
  # data:
  #   ip: 192.168.1.67
  #   payload: "{{ states('sensor.door_status_payload') }}"
  # -----------------------------------------------------------------------
  door_lights_with_ip:
    url: "http://{{ip}}/json/state"
    method: post
    content_type: "application/json; charset=utf-8"
    payload: "{{payload}}"

And then my automation is as follows:

alias: Door Announcements
description: This will fire off various TTS calls when stuff happens.
trigger:
  - platform: state
    entity_id:
      - binary_sensor.back_door_contact
    id: back_door
  - platform: state
    entity_id:
      - binary_sensor.front_door_open
      - lock.front_door
      - binary_sensor.zone_1
    id: front_door
  - platform: state
    entity_id:
      - cover.garage_door
    id: garage_door
  - platform: state
    entity_id:
      - binary_sensor.shed_contact
    id: shed
  - platform: state
    entity_id:
      - binary_sensor.stairs_motion_sensor_motion
    id: stairs
  - platform: state
    entity_id:
      - binary_sensor.basement_stairs_motion_sensor_motion
      - binary_sensor.motion_sensor_basement_hall_occupancy
    id: basement
  - platform: state
    entity_id:
      - binary_sensor.zone_2
      - binary_sensor.zone_3
      - binary_sensor.zone_4
condition: []
action:
  - service: rest_command.door_lights_with_ip
    data:
      ip: 192.168.1.67
      payload: "{{ states('sensor.door_status_payload') }}"
mode: single