Creating a custom light switch device

My goal is to hook up a DIY switch that I made to the Hue lights in my house through HASS.

My rough plan is to have it send messages to an appdaemon script via TCP. The script would then convert them to the message format appropriate for the lights. The switch will send a lot of data so I’m trying to avoid MQTT as I had issues with it in a similar application before.

I don’t exactly know the steps required to achieve this. Can you help me with this?

For example right now I have the following questions:

  1. Do I need to create a switch ‘component’ in HASS and then pipe the data from it to the appdaemon script? If so how do I do that?
  2. I know that MQTT is well supported in HASS, but what about straight TCP? How do I make the appdaemon script receive messages via TCP?

Can your DIY system support posting the data using REST API as json messages? This way AppD can pick up the messages using its inbuilt REST API. Then you can do what you want from there.

Regards

2 Likes

i think that the proposed way from @Odianosen25 is the best way.