Setting up EnvisaLink on HA

I got my EnvisaLink set up on my DSC alarm, and got it set up in HAS as far as to where I can see the status of the sensors across the top of the page, and they react properly to status changes, but that’s not where I want them to be. I want them to show up in a group, similar to how they show up here. I’ve tried to take the snippets from that page to get it to work, and I’ve also tried to use pieces from here, and everything that I’ve tried has either caused an ‘invalid config’ to appear on the web interface, or it’s caused the interface to crash all over itself on restart so it won’t even start. Maybe I’m stuck on stupid, but I can’t seem to get it right.

Here’s a snip of the relevant section of my sensors.yaml.

- platform: template
- binary_sensor:
  sensors:
  binary_sensor.basement_door:
    value_template: >-
      {% if states.binary_sensor.basement_door.state == 'on' %}
        Open
      {% elif states.binary_sensor.basement_door.state == 'off' %}
        Closed
      {% else %}
        n/a
      {% endif %}
  binary_sensor.micro_wireless_1:
    value_template: >-
      {% if states.binary_sensor.micro_wireless_1.state == 'on' %}
        Open
      {% elif states.binary_sensor.micro_wireless_1.state == 'off' %}
        Closed
      {% else %}
        n/a
      {% endif %}

Any suggestions?

Here’s a sample of my templates code which I’m referring to in my confi yaml.

platform: template
sensors:
  front_door:
    value_template: >-
      {% if states.binary_sensor.front_door.state == 'on' %}
        Open
      {% elif states.binary_sensor.front_door.state == 'off' %}
        Closed
      {% else %}
        n/a
      {% endif %}
  patio_door:
    value_template: >-
      {% if states.binary_sensor.patio_door.state == 'on' %}
        Open
      {% elif states.binary_sensor.patio_door.state == 'off' %}
        Closed
      {% else %}
        n/a
      {% endif %}

Once that code is in place, then on my card I need to refer to the newly created template sensor.

  securedoors:
  name: Doors
  entities:
    - binary_sensor.front_door
    - binary_sensor.patio_door

Then they’ll show up on the card using the new template item that was created.

2017-10-07 07_50_37-Home Assistant

Thanks - I think I’m getting somewhere (I didn’t realize that making a group and placing those sensors that appear up top in that group would move them off the top and into the group), but I must still be missing something.

I added the following to my ‘groups.yaml’:

securedoors:
  name: Alarm State
  entities:
    - alarm_control_panel.home_alarm
    - binary_sensor.front_door
    - binary_sensor.basement_door
    - binary_sensor.sliding_door
    - binary_sensor.kitchen_door
    - binary_sensor.rear_garage_door
    - binary_sensor.left_living_room_window
    - binary_sensor.right_living_room_window
    - binary_sensor.basement_motion
    - binary_sensor.hall_motion

After doing a group reload (I did a reload after each batch of two or three that I added), those sensors that were up above the cards now appeared below in the group that I named ‘Alarm State’.

I also added the following to my ‘sensors.yaml’ (And to be clear, the zones are all named and defined in an ‘alarm_system.yaml’ file):

- platform: template
  sensors:
    basement_door:
      value_template: >-
        {% if states.binary_sensor.basement_door == 'on' %}
          Open
        {% elif states.binary_sensor.basement_door == 'off' %}
          Closed
        {% else %}
          n/a
        {% endif %}
    front_door:
      value_template: >-
        {% if states.binary_sensor.front_door == 'on' %}
          Open
        {% elif states.binary_sensor.front_door == 'off' %}
          Closed
        {% else %}
          n/a
        {% endif %} 
    sliding_door:
      value_template: >-
        {% if states.binary_sensor.sliding_door == 'on' %}
          Open
        {% elif states.binary_sensor.sliding_door == 'off' %}
          Closed
        {% else %}
          n/a
        {% endif %} 
    rear_garage_door:
      value_template: >-
        {% if states.binary_sensor.rear_garage_door == 'on' %}
          Open
        {% elif states.binary_sensor.rear_garage_door == 'off' %}
          Closed
        {% else %}
          n/a
        {% endif %}
    kitchen_door:
      value_template: >-
        {% if states.binary_sensor.kitchen_door == 'on' %}
          Open
        {% elif states.binary_sensor.kitchen_door == 'off' %}
          Closed
        {% else %}
          n/a
        {% endif %}
    left_living_room_window:
      value_template: >-
        {% if states.binary_sensor.left_living_room_window == 'on' %}
          Open
        {% elif states.binary_sensor.left_living_room_window == 'off' %}
          Closed
        {% else %}
          n/a
        {% endif %}
    right_living_room_window:
      value_template: >-
        {% if states.binary_sensor.right_living_room_window == 'on' %}
          Open
        {% elif states.binary_sensor.right_living_room_window == 'off' %}
          Closed
        {% else %}
          n/a
        {% endif %}
    basement_motion:
      value_template: >-
        {% if states.binary_sensor.basement_motion == 'on' %}
          Open
        {% elif states.binary_sensor.basement_motion == 'off' %}
          Closed
        {% else %}
          n/a
        {% endif %}
    hall_motion:
      value_template: >-
        {% if states.binary_sensor.hall_motion == 'on' %}
          Open
        {% elif states.binary_sensor.hall_motion == 'off' %}
          Closed
        {% else %}
          n/a
        {% endif %}

This time it didn’t crash all over itself or create a card/group stating that there is an error, but now I have a new sensor for each one defined under the new ‘platform: template’ section, and each one shows ‘n/a’.

ha-sensors1.jpg

Obviously, I missed or screwed something up lol.

Or is the ‘sensors’ section even needed? I removed the entire section from my ‘sensors.yaml’ and the ‘Alarm State’ group still appears to be working properly with animations and such, and I don’t have the boatload of ‘2017-10-10 17:21:44 ERROR (EndpointThread-Subscribe-0) [pubnub] Exception in subscribe loop: HTTP Client Error (400): {“message”:“Invalid Subscribe Key”,“error”:true,“service”:“Access Manager”,“status”:400}’ messages in the HA log file that I had after restarting the service with the lines in ‘sensors.yaml’.

Ok, I found an issue. In your template definitions you need “.state” after the items. See below.

  platform: template
  sensors:
    front_door:
    value_template: >-
      {% if states.binary_sensor.front_door.state == 'on' %}
        Open
      {% elif states.binary_sensor.front_door.state == 'off' %}
        Closed
      {% else %}
        n/a
      {% endif %}
  patio_door:
    value_template: >-
      {% if states.binary_sensor.patio_door.state == 'on' %}
        Open
      {% elif states.binary_sensor.patio_door.state == 'off' %}
        Closed
      {% else %}
        n/a
      {% endif %}

That being said, I actually stopped using the sensor templates because it wouldn’t color the icon when it was opened/closed. Instead I did this.

configuration.yaml

homeassistant:
  name: Home
  customize: !include config/customize.yaml

customize.yaml

binary_sensor.front_door:
  friendly_name: Front Door
  icon: mdi:glassdoor
binary_sensor.patio_door:
  friendly_name: Patio Door
  icon: mdi:glassdoor

So, they show a door icon and it turns color on state, and it shows “open” or “closed” instead of “on” or “off”.

Let me know how it works out for you.

Oh, I think because in my envisalink setup I’m specifying the zone type, it’s correctly adjusting on/off to be open/close, therefore not needing the template anymore?

  zones:
    1:
      name: 'Basement Smoke'
      type: 'smoke'
    2:
      name: 'Low Temp'
      type: 'cold'
    3:
      name: 'High Water'
      type: 'moisture'
    4:
      name: 'Front Door'
      type: 'opening'
    5:
      name: 'House Garage Door'
      type: 'opening'
    6:
      name: 'Patio Door'
      type: 'opening'

Now that you mention it, I’m doing the same thing with mine, so that would make sense as to how everything’s displaying correctly.

alarm_system.yaml:

### Alarm System Configuration ###


zones:
  1:
    name: 'Basement Door'
    type: 'opening'
  2:
    name: 'Front Door'
    type: 'opening'
  3:
    name: 'Kitchen Door'
    type: 'opening'
  4:
    name: 'Basement Motion'
    type: 'opening'
  5:
    name: 'Hall Motion'
    type: 'opening' 
  9:
    name: 'Sliding Door'
    type: 'opening'
  10:
    name: 'Left Living Room Window'
    type: 'opening'
  11:
    name: 'Right Living Room Window'
    type: 'opening'
  12:
    name: 'Rear Garage Door'
    type: 'opening'
partitions:
  1:
    name: 'Home Alarm'

I suspect there’s something different I could/should use for the motions, but ‘opening’ gets the job done.

You can change your motion detector to type ‘motion’. That should fix that.

Thanks so much! I have spent hours trying to get this to work with templates etc. Your solution changed the on/off to open/close! Works perfectly! Such a simple solution!