I am currently writing a ESP32 application with 2.4 inch display that can be used as control and monitor the home assistant entities. currently there are three ways to pull data from HA assistant.
Use Official Home assistant REST API. (Usable but very slow (around 1.5 sec per enitity) to pull entity state from HA https server)
Use Official Home assistant websockets API. (Currently there is no way to subscribe to changes in state of couple of entities and data for all the entities is difficult to handle in ESP32 SOC).
Create custom automation to send state changes over MQTT. (Very fast and reliable but requires configuration to setup).
I am currently exploring option 2 as It is quite fast to retrieve state changes from home assistant but Ignoring irrelevant changes takes time.
It would be very helpful the Websocket API can support subscribing to entity’s (or group of entities) state changes as well.
Indeed. I would really love this. I have 8 smart plugs, all of them sending state updates for 10 different entities every 10 seconds, so at 80 state changes every 10 seconds. In 1 minute it received 615 state changes and 706 kB of data. In a day that’s 885.600 state changes and 1016 MB
Right now only interested in changes of like 2-4 entities, which are only updated every once in a while.
Currently doing REST API requests every 15 seconds, which is also not efficient. There is currently no efficient way.