home-assistant / home-assistant-js-websocket

:aerial_tramway: JavaScript websocket client for Home Assistant

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SubscribeEvents - timer.finished

shannonhochkins opened this issue · comments

Through homeassistant developer panel, even though on the right hand side it does not mention timer.finished, if you listen for timer.finished it will respond when the timer does indeed finished.

Using:

connection.subscribeEvents(ev => {
        console.log('ev', ev);
      }, 'timer.finished').then(r => {
      });

returns {code: 'unauthorized', message: 'Unauthorized'} - what am i doing wrong here?

Only admins are allowed to listen to all events. Non-admins can only subscribe to these events: https://github.com/home-assistant/core/blob/dev/homeassistant/components/websocket_api/permissions.py#L29