Websockets for triggers

Has anyone made this possible? Wouldn’t it be nice to have an automation triggered in the course of an event happens? When you get an event, You can call a API to retrieve the updated entities and see what has changed, and then act to the changes.