MQTT request domoticz
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 11
- Joined: 21 Jan 2016, 22:28
MQTT request domoticz
For now it is not possible to do something with received commands from domoticz with MQTT connection. I have a suggestion how we can make this work.
Every IDX in domoticz is auto generated and can't be generate manualy. Therefore maybe it is a solution to add this IDX/Variable to the devices list and select one of the ports (which we use this normally as sensor output port) and deselect the send data (in ESPEASY).
When a incoming MQTT message is detected the IDX is sought in de database and select the corresponding port.After that the port can accept the command.
Every IDX in domoticz is auto generated and can't be generate manualy. Therefore maybe it is a solution to add this IDX/Variable to the devices list and select one of the ports (which we use this normally as sensor output port) and deselect the send data (in ESPEASY).
When a incoming MQTT message is detected the IDX is sought in de database and select the corresponding port.After that the port can accept the command.
Re: MQTT request domoticz
I thought every Domoticz user uses the HTTP protocol so you may be the first one asking. Since no one has cried real tears because of this, I've just been to lazy to work on that protocol.jongerenchaos wrote:For now it is not possible to do something with received commands from domoticz with MQTT connection. I have a suggestion how we can make this work.
Every IDX in domoticz is auto generated and can't be generate manualy. Therefore maybe it is a solution to add this IDX/Variable to the devices list and select one of the ports (which we use this normally as sensor output port) and deselect the send data (in ESPEASY).
When a incoming MQTT message is detected the IDX is sought in de database and select the corresponding port.After that the port can accept the command.
You're right that we need at least some output device to have the option to set an IDX and corresponding GPIO.
I will see if the next development build can have at least the option to switch a build-in GPIO.
Re: MQTT request domoticz
+1 ! via MQTTMartinus wrote: You're right that we need at least some output device to have the option to set an IDX and corresponding GPIO.
I will see if the next development build can have at least the option to switch a build-in GPIO.
Re: MQTT request domoticz
+1 can be away to send IR command
-
- Normal user
- Posts: 11
- Joined: 21 Jan 2016, 22:28
Re: MQTT request domoticz
Thanks!
The http protocol is much much slower than the MQTT protocol incombo with domoticz.
Currently i use a switch (input) and relais (output). When i push the switch button first a MQTT message goes to domoticz after that domoticz send a http command back. It takes sometimes 0.5sec / 1 sec to put the relais on/off. After some tests the last HTTP command is the slowest one in this proces.
The http protocol is much much slower than the MQTT protocol incombo with domoticz.
Currently i use a switch (input) and relais (output). When i push the switch button first a MQTT message goes to domoticz after that domoticz send a http command back. It takes sometimes 0.5sec / 1 sec to put the relais on/off. After some tests the last HTTP command is the slowest one in this proces.
Re: MQTT request domoticz
+1 ! via MQTT
-
- Normal user
- Posts: 11
- Joined: 21 Jan 2016, 22:28
Re: MQTT request domoticz
Thanks for implementing this feature!
There is only one issue; when you create a output in domoticz (for example IDX 222) and add this as a outgoing device to esp8266 with the 222 idx. The esp accept this command and put the light on/off when you send a command from the domoticz system.
But when i try to add also a switch device (outgoing) on the devices tab from the esp to domoticz with the same IDX (as switch device). The esp accept it and try to do the same with this outgoing output and you get a loop.
The solution is to add: if (Settings.TaskDeviceSendData == 0) and accept only the devices who send nothing back to the domoticz system.
Can you add this?
There is only one issue; when you create a output in domoticz (for example IDX 222) and add this as a outgoing device to esp8266 with the 222 idx. The esp accept this command and put the light on/off when you send a command from the domoticz system.
But when i try to add also a switch device (outgoing) on the devices tab from the esp to domoticz with the same IDX (as switch device). The esp accept it and try to do the same with this outgoing output and you get a loop.
The solution is to add: if (Settings.TaskDeviceSendData == 0) and accept only the devices who send nothing back to the domoticz system.
Can you add this?
Re: MQTT request domoticz
I need to be able to reproduce the bug first otherwise I can't test the fix. I have done this setup with a push button switch. I can control the LED on GPIO-16 with the pushbutton on the Node-MCU. Can also control the LED from Domoticz and the state keeps in sync between Domoticz and ESP. No loop detected here.jongerenchaos wrote:Thanks for implementing this feature!
There is only one issue; when you create a output in domoticz (for example IDX 222) and add this as a outgoing device to esp8266 with the 222 idx. The esp accept this command and put the light on/off when you send a command from the domoticz system.
But when i try to add also a switch device (outgoing) on the devices tab from the esp to domoticz with the same IDX (as switch device). The esp accept it and try to do the same with this outgoing output and you get a loop.
The solution is to add: if (Settings.TaskDeviceSendData == 0) and accept only the devices who send nothing back to the domoticz system.
Can you add this?
Re: MQTT request domoticz
i cannot find the right place in the forum anymore,
but there had been some difficuties with connection the easpeasy to different broker.
if found some slight difference between ver 3.1 and 3.1.1 brokers today here:
https://github.com/mqtt/mqtt.github.io/ ... -and-3.1.1
http://www.hivemq.com/blog/6-facts-why- ... mqtt-3-1-1
but that is a total difference for some pubsub-clients
AND
as the MQTT cmd-features are improving, maybe one should stress this difference directly on the wiki(!?)
to save some espeasy newbies from searching the forum for 'false-positive' bugs. maybe?
but there had been some difficuties with connection the easpeasy to different broker.
if found some slight difference between ver 3.1 and 3.1.1 brokers today here:
https://github.com/mqtt/mqtt.github.io/ ... -and-3.1.1
http://www.hivemq.com/blog/6-facts-why- ... mqtt-3-1-1
but that is a total difference for some pubsub-clients
AND
as the MQTT cmd-features are improving, maybe one should stress this difference directly on the wiki(!?)
to save some espeasy newbies from searching the forum for 'false-positive' bugs. maybe?
-
- Normal user
- Posts: 11
- Joined: 21 Jan 2016, 22:28
Re: MQTT request domoticz
@Martinus
You're right! It works without any problems. I only check the sourcecode before i try it my fault... Excuse me!
I change action = F("gpio,"); to action = F("pcfgpio,"); and it works well!
You're right! It works without any problems. I only check the sourcecode before i try it my fault... Excuse me!
I change action = F("gpio,"); to action = F("pcfgpio,"); and it works well!
Re: MQTT request domoticz
i guess, we are SOLVED (somehow)
Who is online
Users browsing this forum: Google [Bot] and 15 guests