How to command ESPEASY GPIO thru MQTT Mosquitto
Moderators: rtenklooster, Voyager, BertB, Stuntteam
How to command ESPEASY GPIO thru MQTT Mosquitto
I have a mosquitto broker and Domoticz installed on Pi.
I have a ESPEasy R120 installed on ESP8266 WemosD1 Mini.
All installed recently end of 2019.
I am successfull to have one switch working via Domoticz Http .
http://192.168.1.24/control?cmd=GPIO,15,1 is working fine.
What I want to do is the same thing but thru MQTT.
I have tried several flavor of this configuration without success
ESP03 subscribe Template is >> ESP03/#
Then I Publish on MQTT >> mosquitto_pub -t ESP03/cmd -m gpio,15,1
Therefore I see that on MQTT >> ESP03/cmd gpio,15,1
as expected
The issue is that with several flavor of this command and subscribe template i have no effect on mys ESP and switch.
I have two question for any one who may have a similar configuration :
Where can I see some detailed log in ESPEasy ?
Where am i wrong in the way i write my command ?
Thks
I have a ESPEasy R120 installed on ESP8266 WemosD1 Mini.
All installed recently end of 2019.
I am successfull to have one switch working via Domoticz Http .
http://192.168.1.24/control?cmd=GPIO,15,1 is working fine.
What I want to do is the same thing but thru MQTT.
I have tried several flavor of this configuration without success
ESP03 subscribe Template is >> ESP03/#
Then I Publish on MQTT >> mosquitto_pub -t ESP03/cmd -m gpio,15,1
Therefore I see that on MQTT >> ESP03/cmd gpio,15,1
as expected
The issue is that with several flavor of this command and subscribe template i have no effect on mys ESP and switch.
I have two question for any one who may have a similar configuration :
Where can I see some detailed log in ESPEasy ?
Where am i wrong in the way i write my command ?
Thks
Signed XMenne from France
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
You can use the web log or the serial log to see what's going on.
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you

ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you



Re: How to command ESPEASY GPIO thru MQTT Mosquitto
Also the R120 build is quite old, so not all current features may be present.
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
Hello Thanks,
I uploaded latest version ESP EASY mega.
This is a big change and i will need time to discover the field of possible with this version.
May be i will find a way to avoid HTTP command to adress the GPIO with this Mega version
Need time as this is not my first activity
Thanks again
I uploaded latest version ESP EASY mega.
This is a big change and i will need time to discover the field of possible with this version.
May be i will find a way to avoid HTTP command to adress the GPIO with this Mega version
Need time as this is not my first activity

Thanks again
Signed XMenne from France
- dynamicdave
- Normal user
- Posts: 258
- Joined: 30 Jan 2017, 20:25
- Location: Hampshire, UK
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
What I do in Node-RED is to use a MQTT-Out node (running Mosquitto) which is set-up with the IP address of your server
then set-up the topic in the MQTT-Out.
Something like... nodeXX/gpio/14
Where nodeXX is the 'Unit Name' as used in the ESP-Easy Config tab.
14 relates to the GPIO pin, which in this case is D5.
Pin mappings are...
D8 GPIO-15
D7 GPIO-13
D6 GPIO-12
D5 GPIO-14
I have about 40 Wemos D1 Mini devices and each one has a fixed IP address, like 192.168.1.41
So I name the Wemos D1 Mini with 'node41' and stick a label on the botton of the breadboard.
This means it's easy to workout the IP address when I pick-up a breadboard.
The Controller Subscribe setting in ESP-Easy looks like this... %sysname%/#
This means the Wemos named 'node41' will subscribe to... node41/#
To test it out (using Node-RED) you could connect an Inject node to the MQTT-Out node.
Set the Inject node to output a payload of a numeric value - either a 1 or 0 to operate the GPIO pin.
Hope this works for you.
then set-up the topic in the MQTT-Out.
Something like... nodeXX/gpio/14
Where nodeXX is the 'Unit Name' as used in the ESP-Easy Config tab.
14 relates to the GPIO pin, which in this case is D5.
Pin mappings are...
D8 GPIO-15
D7 GPIO-13
D6 GPIO-12
D5 GPIO-14
I have about 40 Wemos D1 Mini devices and each one has a fixed IP address, like 192.168.1.41
So I name the Wemos D1 Mini with 'node41' and stick a label on the botton of the breadboard.
This means it's easy to workout the IP address when I pick-up a breadboard.
The Controller Subscribe setting in ESP-Easy looks like this... %sysname%/#
This means the Wemos named 'node41' will subscribe to... node41/#
To test it out (using Node-RED) you could connect an Inject node to the MQTT-Out node.
Set the Inject node to output a payload of a numeric value - either a 1 or 0 to operate the GPIO pin.
Hope this works for you.
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
Hello
Many thanks, you open my mind to new path to solution and it works now
What I did for the record
I updated ESP with ESPEasy Mega version
I discovered the new function MQTT Import
I create a new Device Generic MQTT import
Name = Task Name >> RelaisChevret
MQTT Topic1 >> domoticz/out/ESP11_Relai1
andValue Name >> Relai1
When you publish on your Broker
mosquitto_pub -h mqtt.xxxx.net -t domoticz/out/ESP11_Relai1 -m 1
Then your Device Value Relai1 is 1
After that I created Rules (also new for me)
On RelaisChevret#Relai1=1 do
GPIO,12,1
end on
and it works and this close this post I suppose.
I now have to work on Domoticz but it is another story.
Many thanks to you all , this forum is very helpful.
Hope i can help some one one day in return .
Many thanks, you open my mind to new path to solution and it works now
What I did for the record
I updated ESP with ESPEasy Mega version
I discovered the new function MQTT Import
I create a new Device Generic MQTT import
Name = Task Name >> RelaisChevret
MQTT Topic1 >> domoticz/out/ESP11_Relai1
andValue Name >> Relai1
When you publish on your Broker
mosquitto_pub -h mqtt.xxxx.net -t domoticz/out/ESP11_Relai1 -m 1
Then your Device Value Relai1 is 1
After that I created Rules (also new for me)
On RelaisChevret#Relai1=1 do
GPIO,12,1
end on
and it works and this close this post I suppose.
I now have to work on Domoticz but it is another story.
Many thanks to you all , this forum is very helpful.
Hope i can help some one one day in return .
Last edited by xmenne on 12 Jan 2021, 18:19, edited 1 time in total.
Signed XMenne from France
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
The purpose of this MONIT configuration is to have Domoticz restart fully after an electrica shut down of my RASP.
Here we have the config for Web Server monit , config for alerting email and config for Restart Domoticz service
To modify the config go here
sudo nano /etc/monit/monitrc
to check Syntax
sudo monit -t
###################################################################"
set mailserver smtp.gmail.com port 587 # primary mailserver
username "xx.mennesson@gmail.com" password "M__7"
using tlsv1
with timeout 30 seconds
set alert xx.mennesson@gmail.com
#
#
# backup.bar.baz port 10025, # backup mailserver on port 10025
# localhost # fallback relay
#
#
## By default Monit will drop alert events if no mail servers are available.
## If you want to keep the alerts for later delivery retry, you can use the
## EVENTQUEUE statement. The base directory where undelivered alerts will be
## stored is specified by the BASEDIR option. You can limit the queue size
## by using the SLOTS option (if omitted, the queue is limited by space
## available in the back end filesystem).
#
set eventqueue
basedir /var/lib/monit/events # set the base directory where events will be stored
slots 100 # optionally limit the queue size
#
#
#
set httpd port 2812
use address 192.168.1.107 # only accept connection from localhost (drop if you use M/Monit)
allow 0.0.0.0/0.0.0.0 # allow localhost to connect to the server and
allow admin:monit # require user 'admin' with password 'monit'
#
#
# #with ssl { # enable SSL/TLS and set path to server certificate
# # pemfile: /etc/ssl/certs/monit.pem
# #}
#
###############################################################################
## Services
###############################################################################
###### Monitoring Domoticz selon PROJETSDIY.FRN
check process domoticz with pidfile /var/run/domoticz.pid
start program = "/etc/init.d/domoticz.sh start"
stop program = "/etc/init.d/domoticz.sh stop"
if failed
url http://127.0.0.1:8080/json.htm?type=com ... getversion
and content = '"status" : "OK"'
for 2 cycles
then restart
if 5 restarts within 5 cycles then exec "/sbin/reboot"
#
## Check that a process is running, in this case Apache, and that it respond
##
Here we have the config for Web Server monit , config for alerting email and config for Restart Domoticz service
To modify the config go here
sudo nano /etc/monit/monitrc
to check Syntax
sudo monit -t
###################################################################"
set mailserver smtp.gmail.com port 587 # primary mailserver
username "xx.mennesson@gmail.com" password "M__7"
using tlsv1
with timeout 30 seconds
set alert xx.mennesson@gmail.com
#
#
# backup.bar.baz port 10025, # backup mailserver on port 10025
# localhost # fallback relay
#
#
## By default Monit will drop alert events if no mail servers are available.
## If you want to keep the alerts for later delivery retry, you can use the
## EVENTQUEUE statement. The base directory where undelivered alerts will be
## stored is specified by the BASEDIR option. You can limit the queue size
## by using the SLOTS option (if omitted, the queue is limited by space
## available in the back end filesystem).
#
set eventqueue
basedir /var/lib/monit/events # set the base directory where events will be stored
slots 100 # optionally limit the queue size
#
#
#
set httpd port 2812
use address 192.168.1.107 # only accept connection from localhost (drop if you use M/Monit)
allow 0.0.0.0/0.0.0.0 # allow localhost to connect to the server and
allow admin:monit # require user 'admin' with password 'monit'
#
#
# #with ssl { # enable SSL/TLS and set path to server certificate
# # pemfile: /etc/ssl/certs/monit.pem
# #}
#
###############################################################################
## Services
###############################################################################
###### Monitoring Domoticz selon PROJETSDIY.FRN
check process domoticz with pidfile /var/run/domoticz.pid
start program = "/etc/init.d/domoticz.sh start"
stop program = "/etc/init.d/domoticz.sh stop"
if failed
url http://127.0.0.1:8080/json.htm?type=com ... getversion
and content = '"status" : "OK"'
for 2 cycles
then restart
if 5 restarts within 5 cycles then exec "/sbin/reboot"
#
## Check that a process is running, in this case Apache, and that it respond
##
Last edited by xmenne on 03 Dec 2020, 17:55, edited 1 time in total.
Signed XMenne from France
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
The purpose of this Script LUA is to activate e relay from Domoticz thru MQTT:
How to rename the file if necessary
mv /home/pi/domoticz/scripts/lua/script_device_chevret_relai1.lua /home/pi/domoticz/scripts/lua/script_device_chevret_relai1_demo.lua
Quand il y a demo dans le nom d'un fichier le script ne l'execute pas
-[[
Intention of this script is to publish defined message using MQTT broker running on a localhost.
The script will trigger only when the status of the defined device is changed.
--]]
--------------------------------
------ Variables to edit ------
--------------------------------
devicename = "RelaisChevret"
deviceIDX = 18
debug = false
--------------------------------
-- End of variables to edit --
--------------------------------
commandArray = {}
if (devicechanged[devicename]) then
print(devicename.." MQTT script running...")
if (devicechanged[devicename] == "On") then
print(devicename.." turned on!")
os.execute('mosquitto_pub -h mqtt.leamicz.net -t domoticz/out/esp11_relai1 -m "1"')
elseif (devicechanged[devicename] == "Off") then
print(devicename.." turned off!")
os.execute('mosquitto_pub -h mqtt.leamicz.net -t domoticz/out/esp11_relai1 -m "0"')
end
end
for i, v in pairs(devicechanged) do print(" " .. i .. ' : ' .. v)
end
return commandArray
How to rename the file if necessary
mv /home/pi/domoticz/scripts/lua/script_device_chevret_relai1.lua /home/pi/domoticz/scripts/lua/script_device_chevret_relai1_demo.lua
Quand il y a demo dans le nom d'un fichier le script ne l'execute pas
-[[
Intention of this script is to publish defined message using MQTT broker running on a localhost.
The script will trigger only when the status of the defined device is changed.
--]]
--------------------------------
------ Variables to edit ------
--------------------------------
devicename = "RelaisChevret"
deviceIDX = 18
debug = false
--------------------------------
-- End of variables to edit --
--------------------------------
commandArray = {}
if (devicechanged[devicename]) then
print(devicename.." MQTT script running...")
if (devicechanged[devicename] == "On") then
print(devicename.." turned on!")
os.execute('mosquitto_pub -h mqtt.leamicz.net -t domoticz/out/esp11_relai1 -m "1"')
elseif (devicechanged[devicename] == "Off") then
print(devicename.." turned off!")
os.execute('mosquitto_pub -h mqtt.leamicz.net -t domoticz/out/esp11_relai1 -m "0"')
end
end
for i, v in pairs(devicechanged) do print(" " .. i .. ' : ' .. v)
end
return commandArray
Signed XMenne from France
Ring the bell project for chevret
Ring the bell project for chevret
Pushbutton is ESP20
Device is Switch Input - switch
Name is chevret_bouton_sonette_etage2_ESP20
Internal Pull up
Switch
Normal switch
IDX25
Values is State
Rules on ESP20
On chevret_bouton_sonette_etage2_ESP20#State=1 do
Publish %sysname%/IP,%ip% //pour besoin de test dans les logs
publish domoticz/out/ring_the_bell,1 // publication dans MQTT pour la sonette
endon
On chevret_bouton_sonette_etage2_ESP20#State=0 do
publish domoticz/out/ring_the_bell,0 // publication dans MQTT pour remettre
//la value ring_the_bell à zéro
endon
// manque le code pour empêcher un enfant de sonner pendant trop longtemps.
//Ou pendant les heures de sommeil
Sonette is ESP19
Device is Generic - MQTT Import
Name is sniff_the_pushbutton
MQTT Topic 1 is domoticz/out/ring_the_bell
Values is ring_the_bell
Rules on ESP19
on sniff#cmdMQTT=1 do
Publish %sysname%/IP,%ip% //pour besoin de test dans les logs
gpio,12,1 //Active la sonette
timerSet,1,1 //timer 1 set for 1 sec
endon
On Rules#Timer=1 do
gpio,12,0 //arret sonette
endon
// manque le code pour empêcher un enfant de sonner pendant trop longtemps.
//Ou pendant les heures de sommeil
We can also activate the bell from Domoticz
Sonette is ESP19
Device: Output - Domoticz MQTT Helper
Name: chevret_sonette_etage2_ESP19_GPIO12_D6
Actuator1st GPIO: GPIO-12 (D6)
IDX: 23
Domoticz Push Button for IDX23
Name is chevret Sonette 2etage
Switch Type is Push On Button
On Delay O sec.
Off Delay 1 sec.
Pushbutton is ESP20
Device is Switch Input - switch
Name is chevret_bouton_sonette_etage2_ESP20
Internal Pull up
Switch
Normal switch
IDX25
Values is State
Rules on ESP20
On chevret_bouton_sonette_etage2_ESP20#State=1 do
Publish %sysname%/IP,%ip% //pour besoin de test dans les logs
publish domoticz/out/ring_the_bell,1 // publication dans MQTT pour la sonette
endon
On chevret_bouton_sonette_etage2_ESP20#State=0 do
publish domoticz/out/ring_the_bell,0 // publication dans MQTT pour remettre
//la value ring_the_bell à zéro
endon
// manque le code pour empêcher un enfant de sonner pendant trop longtemps.
//Ou pendant les heures de sommeil
Sonette is ESP19
Device is Generic - MQTT Import
Name is sniff_the_pushbutton
MQTT Topic 1 is domoticz/out/ring_the_bell
Values is ring_the_bell
Rules on ESP19
on sniff#cmdMQTT=1 do
Publish %sysname%/IP,%ip% //pour besoin de test dans les logs
gpio,12,1 //Active la sonette
timerSet,1,1 //timer 1 set for 1 sec
endon
On Rules#Timer=1 do
gpio,12,0 //arret sonette
endon
// manque le code pour empêcher un enfant de sonner pendant trop longtemps.
//Ou pendant les heures de sommeil
We can also activate the bell from Domoticz
Sonette is ESP19
Device: Output - Domoticz MQTT Helper
Name: chevret_sonette_etage2_ESP19_GPIO12_D6
Actuator1st GPIO: GPIO-12 (D6)
IDX: 23
Domoticz Push Button for IDX23
Name is chevret Sonette 2etage
Switch Type is Push On Button
On Delay O sec.
Off Delay 1 sec.
Signed XMenne from France
Domoticz et Mosquitto chez OVH
Voir Amazon cloud pour la config IP et User et Password
Install Domoticz on Debian10
Step 4-a: Updating Debian
First, we need to install sudo and add our pi user to the sudo group.
Assuming you have SSH access and you are logged on with the pi user, become root with the su command:
Execute this command to update Debian to the latest standards and automatically reboot your virtual machine when it’s completed.
apt update -y && apt upgrade -y && systemctl reboot
Step 5-a: Prepare Debian for Domoticz
So now we have Debian up and running as we like, we need to prepare Debian for Domoticz. Debian is less prepared and expanded by default than Raspbian for the Raspberry Pi. So we will have to ensure that Debian knows and can execute the commands for Domoticz. For this we need to install and prepare a number of things. Execute the following commands:
sudo apt install build-essential -y
sudo apt install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4 libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git -y
Step 5-b: Install
Per advice by Domoticz forum user “dzjr” you should also install the pip3 package manually (thank you for the feedback dzjr!)
You can do so with the following command:
sudo apt install python3-pip -y
Step 6: Install Domoticz
We are finally there! Say yes to the dress! (don’t ask… I’m sitting next to my wife while writing this article and it’s really awful, awful television…).
We can now install Domoticz the regular way:
curl -sSL install.domoticz.com | sudo bash
NOTE: If you get a curl error, run Step 5-a again:
sudo apt install build-essential -y
sudo apt install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4 libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git -y
And there she is, our Domoticz server is up and running.
La commande pour installer Mosquitto sous Linux est
sudo apt install mosquitto
Lien vers le fichier : cliquez ici
L'installation d'un client peut très utile pour faire des tests par la suite.
Ces tests se feront avec la commande mosquitto_sub ou mosquitto_pub
sudo apt-get install mosquitto-clients
Lien vers le fichier : cliquez ici
Vérifier qu'il répond bien avec la commande
systemctl status mosquitto[/list][/list]
Install Domoticz on Debian10
Step 4-a: Updating Debian
First, we need to install sudo and add our pi user to the sudo group.
Assuming you have SSH access and you are logged on with the pi user, become root with the su command:
Execute this command to update Debian to the latest standards and automatically reboot your virtual machine when it’s completed.
apt update -y && apt upgrade -y && systemctl reboot
Step 5-a: Prepare Debian for Domoticz
So now we have Debian up and running as we like, we need to prepare Debian for Domoticz. Debian is less prepared and expanded by default than Raspbian for the Raspberry Pi. So we will have to ensure that Debian knows and can execute the commands for Domoticz. For this we need to install and prepare a number of things. Execute the following commands:
sudo apt install build-essential -y
sudo apt install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4 libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git -y
Step 5-b: Install
Per advice by Domoticz forum user “dzjr” you should also install the pip3 package manually (thank you for the feedback dzjr!)
You can do so with the following command:
sudo apt install python3-pip -y
Step 6: Install Domoticz
We are finally there! Say yes to the dress! (don’t ask… I’m sitting next to my wife while writing this article and it’s really awful, awful television…).
We can now install Domoticz the regular way:
curl -sSL install.domoticz.com | sudo bash
NOTE: If you get a curl error, run Step 5-a again:
sudo apt install build-essential -y
sudo apt install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4 libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git -y
And there she is, our Domoticz server is up and running.
La commande pour installer Mosquitto sous Linux est
sudo apt install mosquitto
Lien vers le fichier : cliquez ici
L'installation d'un client peut très utile pour faire des tests par la suite.
Ces tests se feront avec la commande mosquitto_sub ou mosquitto_pub
sudo apt-get install mosquitto-clients
Lien vers le fichier : cliquez ici
Vérifier qu'il répond bien avec la commande
systemctl status mosquitto[/list][/list]
Signed XMenne from France
Re: List of ESP with Domoticz
At 25nov2022
esp03 > Compteur electrique et temp ecurie chevret
esp11 >
esp15 > Temp Ext et Int Cuisine Chevret
esp16 > compteur eau Chevret
esp17 > Temp ext Chesnay
esp18 > Compteur electrique Chesnay
esp19 > Chevret sonette etage 2 fonctionne avec esp20
esp20 > Bouton sonette etage 2 et RDC
esp21 > Pluviomètre Chevret
esp22 > Humidité courette le Chesnay
esp23> humidité Chambre Benjamin
esp24 > humidité Chambre Camille
esp03 > Compteur electrique et temp ecurie chevret
esp11 >
esp15 > Temp Ext et Int Cuisine Chevret
esp16 > compteur eau Chevret
esp17 > Temp ext Chesnay
esp18 > Compteur electrique Chesnay
esp19 > Chevret sonette etage 2 fonctionne avec esp20
esp20 > Bouton sonette etage 2 et RDC
esp21 > Pluviomètre Chevret
esp22 > Humidité courette le Chesnay
esp23> humidité Chambre Benjamin
esp24 > humidité Chambre Camille
Signed XMenne from France
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
At 16dec2022
esp03 > Compteur electrique et temp ecurie chevret
esp11 >
esp15 > Temp Ext et Int Cuisine Chevret
esp16 > compteur eau Chevret
esp17 > Temp ext Chesnay
esp18 > Compteur electrique Chesnay
esp19 > Chevret sonette etage 2 fonctionne avec esp20
esp20 > Bouton sonette etage 2 et RDC
esp21 > Pluviomètre Chevret
esp22 > Humidité courette le Chesnay
esp23> humidité Chambre Benjamin
esp24 > humidité Chambre Camille
esp25 > Control remote Frisquet
esp03 > Compteur electrique et temp ecurie chevret
esp11 >
esp15 > Temp Ext et Int Cuisine Chevret
esp16 > compteur eau Chevret
esp17 > Temp ext Chesnay
esp18 > Compteur electrique Chesnay
esp19 > Chevret sonette etage 2 fonctionne avec esp20
esp20 > Bouton sonette etage 2 et RDC
esp21 > Pluviomètre Chevret
esp22 > Humidité courette le Chesnay
esp23> humidité Chambre Benjamin
esp24 > humidité Chambre Camille
esp25 > Control remote Frisquet
Signed XMenne from France
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
Hurray for Google Translate!!
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
At 9feb2023
esp03 > Compteur electrique et temp ecurie chevret
esp11 >
esp15 > Temp Ext et Int Cuisine Chevret
esp16 > compteur eau Chevret
esp17 > Temp ext Chesnay
esp18 > Compteur electrique Chesnay
esp19 > Chevret sonette etage 2 fonctionne avec esp20
esp20 > Bouton sonette etage 2 et RDC
esp21 > Pluviomètre Chevret
esp22 > Humidité courette le Chesnay
esp23> humidité Chambre Benjamin
esp24 > humidité Chambre Camille
esp25 > Control remote Frisquet
esp26 > Control Piscine1
esp03 > Compteur electrique et temp ecurie chevret
esp11 >
esp15 > Temp Ext et Int Cuisine Chevret
esp16 > compteur eau Chevret
esp17 > Temp ext Chesnay
esp18 > Compteur electrique Chesnay
esp19 > Chevret sonette etage 2 fonctionne avec esp20
esp20 > Bouton sonette etage 2 et RDC
esp21 > Pluviomètre Chevret
esp22 > Humidité courette le Chesnay
esp23> humidité Chambre Benjamin
esp24 > humidité Chambre Camille
esp25 > Control remote Frisquet
esp26 > Control Piscine1
Signed XMenne from France
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
At 9jul2024
esp03 > Compteur electrique et temp ecurie chevret 10.142
esp11 >
esp15 > Temp Ext et Int Cuisine Chevret
esp16 > compteur eau Chevret 10.182
esp17 > Temp ext Chesnay
esp18 > Compteur electrique Chesnay
esp19 > Chevret sonette etage 2 fonctionne avec esp20
esp20 > Bouton sonette etage 2 et RDC
esp21 > Pluviomètre Chevret
esp22 > Humidité courette le Chesnay
esp23> humidité Chambre Benjamin
esp24 > humidité Chambre Camille
esp25 > Control remote Frisquet
esp26 > Control Piscine1 10.125
esp03 > Compteur electrique et temp ecurie chevret 10.142
esp11 >
esp15 > Temp Ext et Int Cuisine Chevret
esp16 > compteur eau Chevret 10.182
esp17 > Temp ext Chesnay
esp18 > Compteur electrique Chesnay
esp19 > Chevret sonette etage 2 fonctionne avec esp20
esp20 > Bouton sonette etage 2 et RDC
esp21 > Pluviomètre Chevret
esp22 > Humidité courette le Chesnay
esp23> humidité Chambre Benjamin
esp24 > humidité Chambre Camille
esp25 > Control remote Frisquet
esp26 > Control Piscine1 10.125
Signed XMenne from France
Re: How to command ESPEASY GPIO thru MQTT Mosquitto
Reinstall Debian 12 Domoticz 2024.7 and Mosquitto
Reinstall Debian 12 ( thru reinstall OVH Virtual server function on OVH site)
Change Password (see my password safe)
Update Debian "apt-get update" puis "apt-get dist-upgrade"
puis aussi avec un reboot "apt update -y && apt upgrade -y && systemctl reboot
"cat /etc/debian_version" je vois version 12.6
J'install WGET POUR TELECHARGER LE FICHIER DE CONFIG DOMOTICZ PLUS TARD.
"sudo apt-get install wget" (déjà installé il semble)
Reinstall Domoticz 2024.7
Step 5-a: Prepare Debian for Domoticz
So now we have Debian up and running as we like, we need to prepare Debian for Domoticz. Debian is less prepared and expanded by default than Raspbian for the Raspberry Pi. So we will have to ensure that Debian knows and can execute the commands for Domoticz. For this we need to install and prepare a number of things. Execute the following commands:
sudo apt install build-essential -y
sudo apt install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4 libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git -y
Step 5-b: Install
Per advice by Domoticz forum user “dzjr” you should also install the pip3 package manually (thank you for the feedback dzjr!)
You can do so with the following command:
sudo apt install python3-pip -y
Step 6: Install Domoticz
We can now install Domoticz the regular way:
curl -sSL install.domoticz.com | sudo bash
NOTE: If you get a curl error, run Step 5-a again:
sudo apt install build-essential -y
sudo apt install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4 libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git -y
service domoticz status inconnu " sudo service domoticz.sh status "
"system reboot"
Error message libssl 1.1 missing
faire un wget et un dpkg sur ce fichier
libssl1.1_1.1.1n-0+deb11u5_amd64.deb (amd64 for my server at OVH)
"wget http://security.debian.org/debian-secur ... _amd64.deb"
"sudo dpkg -i libssl1.1_1.1.1n-0+deb11u5_amd64.deb"
Install OK no error message
Issue with the firts screen from domoticz cannot click on OK
I tried another way to install
$ "curl -L install.domoticz.com > install.sh"
$ "chmod +x install.sh"
$ "sudo ./install.sh"
and it works
default User/pwd is admin / domoticz
Install Mosquitto for MQTT
sudo apt install mosquitto
sudo apt install mosquitto mosquitto-clients
and check
sudo systemctl is-enabled mosquitto
sudo systemctl status mosquitto
and check
run the following 'mosqitto_sub' command to receive some messages on the topic 'test'.
sudo mosquitto_sub -h localhost -t test
Next, open a new terminal session of your server and run the following 'mosquitto_pub' command to send some messages to the topic 'test'
sudo mosquitto_pub -h localhost -t test -m "Hello from terminal 2"
sudo mosquitto_pub -h localhost -t test -m "Hello from terminal 2 - Publisher"
sudo mosquitto_pub -h localhost -t test -m "Hello"
You'll then see published messages via the 'mosquitto_pub' on the receiver 'mosquitto_sub', which means the Mosquitto server and client installation are successful.
Config listener port without password
sudo nano /etc/mosquitto/conf.d/auth.conf
Add the following configuration to the file. This will run the Mosquitto on port '1883', disable anonymous access, and define the password file to '/etc/mosquitto/.passwd'.
listener 1883
allow_anonymous false
Save the file and exit the editor when you are finished.
Next, restart the Mosquitto service to apply new changes. The Mosquitto server should now be running with authentication enabled.
sudo systemctl restart mosquitto
And all is back with domoticz runnig fine
the end
Reinstall Debian 12 ( thru reinstall OVH Virtual server function on OVH site)
Change Password (see my password safe)
Update Debian "apt-get update" puis "apt-get dist-upgrade"
puis aussi avec un reboot "apt update -y && apt upgrade -y && systemctl reboot
"cat /etc/debian_version" je vois version 12.6
J'install WGET POUR TELECHARGER LE FICHIER DE CONFIG DOMOTICZ PLUS TARD.
"sudo apt-get install wget" (déjà installé il semble)
Reinstall Domoticz 2024.7
Step 5-a: Prepare Debian for Domoticz
So now we have Debian up and running as we like, we need to prepare Debian for Domoticz. Debian is less prepared and expanded by default than Raspbian for the Raspberry Pi. So we will have to ensure that Debian knows and can execute the commands for Domoticz. For this we need to install and prepare a number of things. Execute the following commands:
sudo apt install build-essential -y
sudo apt install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4 libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git -y
Step 5-b: Install
Per advice by Domoticz forum user “dzjr” you should also install the pip3 package manually (thank you for the feedback dzjr!)
You can do so with the following command:
sudo apt install python3-pip -y
Step 6: Install Domoticz
We can now install Domoticz the regular way:
curl -sSL install.domoticz.com | sudo bash
NOTE: If you get a curl error, run Step 5-a again:
sudo apt install build-essential -y
sudo apt install cmake libboost-dev libboost-thread-dev libboost-system-dev libsqlite3-dev subversion curl libcurl4 libcurl4-openssl-dev libusb-dev zlib1g-dev libssl-dev git -y
service domoticz status inconnu " sudo service domoticz.sh status "
"system reboot"
Error message libssl 1.1 missing
faire un wget et un dpkg sur ce fichier
libssl1.1_1.1.1n-0+deb11u5_amd64.deb (amd64 for my server at OVH)
"wget http://security.debian.org/debian-secur ... _amd64.deb"
"sudo dpkg -i libssl1.1_1.1.1n-0+deb11u5_amd64.deb"
Install OK no error message
Issue with the firts screen from domoticz cannot click on OK
I tried another way to install
$ "curl -L install.domoticz.com > install.sh"
$ "chmod +x install.sh"
$ "sudo ./install.sh"
and it works
default User/pwd is admin / domoticz
Install Mosquitto for MQTT
sudo apt install mosquitto
sudo apt install mosquitto mosquitto-clients
and check
sudo systemctl is-enabled mosquitto
sudo systemctl status mosquitto
and check
run the following 'mosqitto_sub' command to receive some messages on the topic 'test'.
sudo mosquitto_sub -h localhost -t test
Next, open a new terminal session of your server and run the following 'mosquitto_pub' command to send some messages to the topic 'test'
sudo mosquitto_pub -h localhost -t test -m "Hello from terminal 2"
sudo mosquitto_pub -h localhost -t test -m "Hello from terminal 2 - Publisher"
sudo mosquitto_pub -h localhost -t test -m "Hello"
You'll then see published messages via the 'mosquitto_pub' on the receiver 'mosquitto_sub', which means the Mosquitto server and client installation are successful.
Config listener port without password
sudo nano /etc/mosquitto/conf.d/auth.conf
Add the following configuration to the file. This will run the Mosquitto on port '1883', disable anonymous access, and define the password file to '/etc/mosquitto/.passwd'.
listener 1883
allow_anonymous false
Save the file and exit the editor when you are finished.
Next, restart the Mosquitto service to apply new changes. The Mosquitto server should now be running with authentication enabled.
sudo systemctl restart mosquitto
And all is back with domoticz runnig fine
the end
Signed XMenne from France
Who is online
Users browsing this forum: No registered users and 12 guests