Need to read config device name in sensor.py of custom component

Just wrote an alarm custom component; working pretty well at the moment. It has:

  • alarm_control_panel.py
  • binary_sensor.py
  • sensor.py

platforms. When an alarm triggers in one of the zones, state attribute ‘alarm’ of the zone binary sensor goes ‘True’; the sensor state attribute ‘alarm zone’ shows the zone number of the triggered alarm; and the alarm_control_panel shows that there is an alarm trigger. So far so good.

I made an automation for pushover notification when the alarm is triggered; sends a message to my smartphone with the zone number. I want to show the name of the Zone instead of its number; which are defined in the configuration.yaml. Like, when the sensor state attribute ‘alarm zone’ is a zone number; set the sensor state to the name of the Zone.

Sample configuration.yaml:

crowipmodule:
  host: !secret crow_ip
  code: !secret crow_code
  port: 5002
  keepalive_interval: 60
  timeout: 25
  zones:
    1:
      name: 'Giriş PIR'
      type: 'motion'
    3:
      name: 'Zemin MK'
      type: 'window'
    2:
      name: 'Çatı MK'
      type: 'door'
    4:
      name: 'Sinema MK'
      type: 'door'
    5:
      name: 'Mutfak PIR'
      type: 'motion'
  areas:
    1:
      name: 'Area A'
  system:
    1:
      name: 'mains'
    2:
      name: 'battery'

All ha custom_component is on https://github.com/febalci/ha_pycrowipmodule

Trying to get the name of zone with hass.config[DATA_CRW] in sensor.py pointed to some errors and i am stuck.
Thanks a lot for your help.