Expose all state trought mqtt

Is it possible to implement a component wich publish all states on MQTT like openhab ? And ca subscribe to MQTT too ?

Sure but what would be the benefit? You simply can subscribe to the relevant MQTT topics to get the states direct from the devices.

Depends on what you want to achieveā€¦MQTT trigger or this could help.

Please check github.com/balloob/home-assistant/pull/1518

Eventstream is quite complicated to use like in domoticz. OpenHAB approach is simplier with SomeTopic/in|out/command|state
Very simple to use with nodered.
With Eventstream approach, you have to decode all event, and writing events is quite complex.

I suggest that you open an issue where you outline what the parameters are.