I’d like to develop an integration for my alarm panel. I’ve written all the code in JS(it’s a nodeJS CLI app to be specific) because I didn’t plan to make it an integration in the beginning, but this code interfaces with the alarm panel and i can control it and receive data from in through MQTT in the form of JSON.
I’ve seen that HASS uses Python for integrations, so I’d like to know if I should make an addon that runs the nodeJS app and have an integration that interfaces with it via MQTT, or if there’s a way to use the JS code directly in an integration.
I’d like to avoid rewriting everything in Python as it’s almost 1000 lines of code and it would take months.
You can put your node js application into docker and bundle it as supervisor add on. Rather than writing a custom integration to communicate with your docker, your docker can communicate with mqtt server, there is a specific way of managing entities over mqtt. Docker will be responsible for lifecycle, state and events for entities.
Nicomedia, come posso contattarti? Ho provato a mandarti un messaggio privato su PLC forum… qui non riesco a mandare messaggi privati e non capisco se è una limitazione di questo forum o se è un problema mio.
Yes, there are some specific commands as birth to inform HA about your entity and by incoming message, HA will create entities accordingly. Most MQTT based add-ons are using this. Most popular one; zigbee2mqtt and zwave2mqtt