Custom component development question for LED sign

Hi there,

I have created my own device based on an RPI and runs in node.js on the local network. It is a scrolling led display sign:

Example of one of my signs

Currently I am using an mqtt npm library on the device to communicate with HA via nodeRed. I have flows setup such as when the lux sensor in the room detects high intensity light, increase the brightness of the sign, and send a string to the sign to scroll the message etc.

However I feel like this would be a case to write a custom component/intergration/device? Since I now have 2 of these devices and want to publish the project.

At what point does it make sense to create an actual device in HA with entities like brightness etc vs just continuing to do the communication via mqtt?
My understanding of writing an intergration is to abstract away the actual communication to the device from the user and just have ‘HA’ standard entities on the device such as brightness.
So then you can have 1 intergration (RPI LED sign) with many devices of same type (bedroom sign, kitchen sign, office sign) etc.
The program/software will be the same on each sign then the user changes config prams per device inside HA UI.

I’m new to HA but keen to get a device written for these LED signs.

Does it matter what language / communication method is used ‘under the hood’ of the intergration? I would like to write in node.js and still use mqtt vs python and rest API… which I gather form docs is the ‘standard’??

If someone can correct my terminology and maybe link to a basic example of an intergration that connects to local IOT devices via mqtt that would be great :slight_smile:

Although using mqtt makes most sense for the type of communication, maybe it would require the user’s HA to be setup with a broker before being able to use my intergration, increased complexity? What is the best protocol to use between an intergration in HA and a RPI running node.js on the local lan?

1 Like

Integrations in HA are written in python3, but the code that runs on your device can be written in any language as long as there is an API interface that python3 can talk to - most commonly, there is a rest API served by the device for controlling the functions of the device and some other protocol so that HA can listen for changes, eg websockets or telnet.

But, it sounds like your device already speaks MQTT which works well with Home Assistant. MQTT devices can create entities in Home Assistant using MQTT Discovery: This does require the user to set up an MQTT broker but this is quite common and many users may already using MQTT for other lights and switches.

1 Like