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.
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.