ParadoxAlarmInterface / pai

Paradox Magellan, Spectra and EVO, with MQTT, Signal, Pushbullet, Pushover and others
https://gitter.im/paradox-alarm-interface
Eclipse Public License 2.0
351 stars 94 forks source link

HomeAssistant notifications #152

Open yozik04 opened 4 years ago

yozik04 commented 4 years ago

When installed as a hassio plugin it is simple to implement notifications via home assistant. Then users would not need to configure pushover, gsm or pushbullet interfaces.

clau-bucur commented 4 years ago

I have enabled this feature like this:

HOMEASSISTANT_NOTIFICATIONS_ENABLE: true
HOMEASSISTANT_NOTIFICATIONS_NOTIFIER_NAME: notify
HOMEASSISTANT_NOTIFICATIONS_MIN_EVENT_LEVEL: INFO
HOMEASSISTANT_NOTIFICATIONS_EVENT_FILTERS:
  - 'live,alarm,-restore'
  - 'live,trouble,-clock'
  - 'live,tamper'

But I get the following error: ERROR - PAI.paradox.interfaces.text.homeassistant_notifications - Failed to send notification: code=401, text: 401: Unauthorized

Is there any other configuration that needs to be done?

xhoong commented 3 years ago

I think the SUPERVISOR_TOKEN from the environment variables do not have permission to send notification. There should be a config to enter the token from the config. A long term token can be created by the user to use for notifications.

yozik04 commented 3 years ago

When I was trying to implement supervisor token had permission. The main problem here is that our project does not allow hierarchical configuration and it is hard to pass required configuration to form the request without crazy hacks. I am slowly rewriting configuration to yaml, json. No idea when I will finish, but it will definitely be a separate next gen branch of the project.