How does the "Learn Switch/Light" process work using MQTT
Posted: Friday 11 August 2017 10:04
I want to make some hardware using a arduino and Ethernet shield that collects information from switches connected to it and send it over MQTT to domoticz. I also want to make it's setup easy with the build in domoticz learn system.
How to send some information with MQTT is very straight forward. An using MQTTfx is manage to do so without problem.
But I would like to understand how the learn process works in domoticz, my idea is that if is send someting like this, domoticz would react on it and suggest an new device :
domoticz/in
{
"Battery" : 255,
"RSSI" : 12,
"description" : "Test",
"dtype" : "Lighting 1",
"id" : "67",
"idx" 5 : ,
"name" : "Button 2",
"nvalue" : 1,
"stype" : "X10",
"switchType" : "On/Off",
"unit" : 1
}
But that does not work, except if is send a out from domoticz (from a dummy switch) back then it says it already exists, in any other case it will timeout. I seem to be missing something here I think....
Is there somewhere a good manual, tutorial or example on how the learn process works.
How will a new device get its "idx" appointed for example or can i just let de device choose any and it that id limited in size ?
I have search a lot to find some information about it, but only with minimal success until now...
Thanks.
How to send some information with MQTT is very straight forward. An using MQTTfx is manage to do so without problem.
But I would like to understand how the learn process works in domoticz, my idea is that if is send someting like this, domoticz would react on it and suggest an new device :
domoticz/in
{
"Battery" : 255,
"RSSI" : 12,
"description" : "Test",
"dtype" : "Lighting 1",
"id" : "67",
"idx" 5 : ,
"name" : "Button 2",
"nvalue" : 1,
"stype" : "X10",
"switchType" : "On/Off",
"unit" : 1
}
But that does not work, except if is send a out from domoticz (from a dummy switch) back then it says it already exists, in any other case it will timeout. I seem to be missing something here I think....
Is there somewhere a good manual, tutorial or example on how the learn process works.
How will a new device get its "idx" appointed for example or can i just let de device choose any and it that id limited in size ?
I have search a lot to find some information about it, but only with minimal success until now...
Thanks.