MQTT to House Control through Raspberry pi

125 views
Skip to first unread message

Henrik Andersen

unread,
Sep 9, 2017, 7:49:44 PM9/9/17
to MQTT
Hi

I already have a script running on my Raspberry Pi
to control my Home Automation,
I want to in incluse a Module script so i can use MQTT to controll it.

My Home automation have:
128 Inputs - Like Buttons, Temprature sensors, LUX sensor, 0-10V sensor and more.
128 Outputs - Like Relayes, 0-10v, Dimmers and so on
it can alsow handle 64 Wireless Units as Dimmers, Relayes & Switches.

Witch i all can use through my web script on my Raspberry Pi,

My script can handle send and recive commands from my Home automation,
it can send mails, log documenttion, control Sonos, send Pushover Notifications, start cmd commands,
it only need some modification to working with MQTT,
Hope some on can help me make this happen.

the scripts for the Raspberry Pi can be seen heer:
http://line-web.dk/captain/ihccaptain.zip

Bye the way I have no knowledge about MQTT

Ravi Subramanian

unread,
Sep 12, 2017, 5:55:21 AM9/12/17
to MQTT
Henrik

Few basic questions to determine the kind of help you need

I had a brief look at the PHP scripts.  It is not exactly clear how you would like to use MQTT.  DO you want the Inputs and Outputs - buttons, temperature sensors,  lux sensor - to use MQTT for interacting with  the home automation controller? Or do you want R-Pi to send information out using MQTT?

Also, what is your intent of using MQTT?

Another question, R-Pi will have a MQTT support. What about your sensor nodes? Do you if they provide MQTT support (stack)?

Best Regards
Ravi Subramanian

Henrik Andersen

unread,
Sep 15, 2017, 6:23:42 PM9/15/17
to MQTT
Hi

to start with I want to be able to use an app to control all the Outputs via MQTT

Ravi Subramanian

unread,
Sep 16, 2017, 11:08:11 AM9/16/17
to MQTT
Henrik

I guess you want to control all the outputs (128 Outputs - Like Relays, 0-10v, Dimmers and so on as quoted by you) from Raspberry Pi.  I assume you want to control these outputs from a mobile app through MQTT.

I'm assuming the R-Pi directly controls these relays, dimmers etc.  In this case,  the app on mobile can talk to R-Pi using MQTT.  There are freeware apps available from Android playstore you can consider (IoT MQTT Dashboard). The app can send commands through MQTT publish. You need to have your Raspberry Pi code receiving commands from the app through MQTT Subscribe. 

In case the  Raspberry - Pi controls the relays and dimmers through microcontrollers (connected through WI-Fi), then the microcontrollers need to have an MQTT stack. R-Pi will send MQTT Publish commands to the microcontrollers through WI-Fi. Based on the commands received, the MCUs will take corresponding action.

Hope this is helpful. Please let me know if you need further details.

Henrik Andersen

unread,
Sep 16, 2017, 11:16:35 AM9/16/17
to MQTT
I want the MQTT to be a Choise of module like they other modules.

I think i want a Checkbox so if the checkbox is TRUE then i wil be able to send commands to thoes elements.
All of my buttons have an ID so i think that the MQTT must change the state of the individual button.

Ravi Subramanian

unread,
Sep 16, 2017, 1:02:32 PM9/16/17
to MQTT
Henrik

I don't think I can get a complete picture of your requirement. I will make an attempt

- You want a module in Raspberry Pi that will receive MQTT commands from a mobile app. This is possible. Mobile app can do an MQTT publish to MQTT listener module on Raspberry Pi to manage all or the individual modules.
- This module will then send commands to the elements such as buttons.. This can again be done using an MQTT publish. The button module must receive MQTT commands and then take action.

Is  this what you are looking for?

Best Regards
Ravi

Henrik Andersen

unread,
Sep 16, 2017, 5:21:22 PM9/16/17
to MQTT
I want the MQTT to acrivate the buttons in the script:
<div class="btn-group pull-right inputBtn inputBtnGrp dropup flash">
<button type="button" title="Tænd og sluk (kip)" data-btnaction="toggle" value="" class="btn btn-sm btn-default btn-danger">
<span class="glyphicon glyphicon-off"></span>
</button>
<button type="button" class="btn btn-sm btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">Vis/skjul dropdown</span> // Show/Hide dropdown
</button>
<ul class="small-dropdown dropdown-menu dropdown-menu-right" role="menu">
<li><a href="#" data-btnaction="on">Tænd</a></li> // ON
<li><a href="#" data-btnaction="off">Sluk</a></li> // OFF
</ul>
</div>

Be able to do the same as this button do.
Reply all
Reply to author
Forward
0 new messages