Controlling lights with boolean list through MQTT

Hi everybody!

Due to couple of reasons, i’m planning on migrating my light control system from thingsboard to home assistant. I already did some research and hass seems to support mqtt, json and postgresql.

I have system installed, so i’m intalling the hass through apt-get way.

However, i have couple of questions:
I have arduino sending pir sensor data and light switch presses through MQTT
i have arduinos subscribed to MQTT topic to receive json boolean list like this:

{“group1”:“false”,“group2”:“true”,“preset”:5}

and in thingsboard, i had a list of presets, which worked like this:

  • arduino sending button press number 3
  • thingsboard receiving number 3 pressed
  • thingsboard fetches preset 3 (the number pressed)
  • thingsboard sends values from inside the preset 3 (the list of booleans and the preset number) as json
  • arduino receives the list and applies the requested settings.

In thingsboard, i had the presets (devices inside thingsboard) act as a place to store that preset’s list of light settings, and i could use REST to change those lists for each preset. can i achieve that in hass too?

I’m new to home assistant, so pardon my possible stupid questions.

Hi,

My advise would be to keep things as simple as possible removing as many points of failure as possible, and to decrease any latency issues, try and decouple any services from cloud based services… so to get to your situation:

  1. What lights are you using?
  2. What PIR are you using?

are there Home assistant components for these (remembering that there are a couple of versions of “Home Assistant” as well as many multitudes of deploying each of these versions…

I would start off with Hassio on Raspberry pi and take it from there… https://www.home-assistant.io/hassio/installation/

I would ot try and do anything too clever to start with in terms of virtual env or dedicated linux boxes as this may introduce some barriers (open ports, networks etc) and limit you learning curve on the platform… :slight_smile: