Dilbert66 / esphome-dsckeybus

Esphome custom configuration for interfacing to a DSC POWERSERIES alarm system
195 stars 37 forks source link

How to use zones other than 1-11 #40

Closed heytcass closed 2 years ago

heytcass commented 3 years ago

I used to run my system on the taligentx MQTT repo, but wanted to move to ESPHome to remove one possible failure point, namely the MQTT broker.

During my time using the taligentx firmware, I discovered that my system uses zones 9-14, 17, and 18. After editing the DscAlarm.yaml file to replace z1-z11 and za1-za11 references in the file with my system's corresponding zones, nothing seems to be registering in my Home Assistant front end when doors open, etc. Are there other places I should be editing to change which zones are monitored?

Dilbert66 commented 3 years ago

did you change the case statements as well ? ie: Using Case 9: instead of Case 1: and so on?

heytcass commented 3 years ago

Yes, sorry, that is what I meant by what I edited. But I also should have included the relevant part of my YAML file:

    DSCkeybus->onZoneStatusChange([&](uint8_t zone, bool open) {
      switch (zone) {
        case 1: id(z9).publish_state(open); break;
        case 2: id(z10).publish_state(open); break;
        case 3: id(z11).publish_state(open); break;
        case 4: id(z12).publish_state(open); break;
        case 5: id(z13).publish_state(open); break;
        case 6: id(z14).publish_state(open); break;
        case 7: id(z17).publish_state(open); break;
        case 8: id(z18).publish_state(open); break;
      }
    });
    DSCkeybus->onZoneAlarmChange([&](uint8_t zone, bool open) {
      switch (zone) {
        case 1: id(za9).publish_state(open); break;
        case 2: id(za10).publish_state(open); break;
        case 3: id(za11).publish_state(open); break;
        case 4: id(za12).publish_state(open); break;
        case 5: id(za13).publish_state(open); break;
        case 6: id(za14).publish_state(open); break;
        case 7: id(za17).publish_state(open); break;
        case 8: id(za18).publish_state(open); break;
      }
    });
    return {DSCkeybus};

binary_sensor:
  - platform: template
    id: z9
    name: "$systemName Front Door"
    device_class: Door
  - platform: template
    id: z10
    name: "$systemName Sunroom Door"
    device_class: Door
  - platform: template
    id: z11
    name: "$systemName Family Room Door"
    device_class: Door
  - platform: template
    id: z12
    name: "$systemName Side Door"
    device_class: Door
  - platform: template
    id: z13
    name: "$systemName Family Room Motion"
    device_class: Motion
  - platform: template
    id: z14
    name: "$systemName Living Room Motion"
    device_class: Motion
  - platform: template
    id: z17
    name: "$systemName Kitchen Door"
    device_class: Door
  - platform: template
    id: z18
    name: "$systemName Dining Room Door"
    device_class: Door

    #zone Alarm status
  - platform: template
    id: za9
    name: "$systemName Front Door Alarm"
    #device_class: safety
  - platform: template
    id: za10
    name: "$systemName Sunroom Door Alarm"
    #device_class: safety
  - platform: template
    id: za11
    name: "$systemName Family Room Door Alarm"
    #device_class: safety
  - platform: template
    id: za12
    name: "$systemName Side Door Alarm"
    #device_class: safety
  - platform: template
    id: za13
    name: "$systemName Family Room Motion Alarm"
    #device_class: safety
  - platform: template
    id: za14
    name: "$systemName Living Room Motion Alarm"
    #device_class: safety
  - platform: template
    id: za17
    name: "$systemName Kitchen Door Alarm"
    #device_class: safety
  - platform: template
    id: za18
    name: "$systemName Dining Room Door Alarm"
    #device_class: safety
Dilbert66 commented 3 years ago

You still need to change the case statements. You didnt need to change the id's. (ie z1, za1), it's the case statement that is the important one.

example, from this:

case 1: id(z9).publish_state(open); break;

to this :

case 9: id(z9).publish_state(open); break;