What you say might be true but it is not that simple. Domoticz has a rich heritage that means that things are not always as straightforward as they seem.
Even though the Python framework doesn't really use the deviceID field I create a valid one in the most common format used by similar C++ plugins. A simple 'find in files' for the shorter form used for the device ID as used by Python yields the following:
Code: Select all
D:\Domoticz\domoticz\hardware\BleBox.cpp(596): sprintf(szIdx, "%X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\Daikin.cpp(167): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\DenkoviSmartdenLan.cpp(132): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\Dummy.cpp(167): sprintf(ID, "%X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\ETH8020.cpp(136): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\FritzboxTCP.cpp(226): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\Kodi.cpp(156): sprintf(m_szDevID, "%X%02X%02X%02X", 0, 0, (m_DevID & 0xFF00) >> 8, m_DevID & 0xFF);
D:\Domoticz\domoticz\hardware\Kodi.cpp(1085): sprintf(szID, "%X%02X%02X%02X", 0, 0, (ID & 0xFF00) >> 8, ID & 0xFF);
D:\Domoticz\domoticz\hardware\Kodi.cpp(1108): sprintf(szID, "%X%02X%02X%02X", 0, 0, (ID & 0xFF00) >> 8, ID & 0xFF);
D:\Domoticz\domoticz\hardware\Kodi.cpp(1122): sprintf(szID, "%X%02X%02X%02X", 0, 0, (ID & 0xFF00) >> 8, ID & 0xFF);
D:\Domoticz\domoticz\hardware\LogitechMediaServer.cpp(488): sprintf(szID, "%X%02X%02X%02X", 0, 0, (ID & 0xFF00) >> 8, ID & 0xFF);
D:\Domoticz\domoticz\hardware\LogitechMediaServer.cpp(581): sprintf(pnode.szDevID, "%X%02X%02X%02X", 0, 0, (pnode.DevID & 0xFF00) >> 8, pnode.DevID & 0xFF);
D:\Domoticz\domoticz\hardware\MySensorsBase.cpp(1089): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\MySensorsBase.cpp(1148): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\MySensorsBase.cpp(1221): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\Nest.cpp(144): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\Nest.cpp(285): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, Idx, 0);
D:\Domoticz\domoticz\hardware\OTGWBase.cpp(73): sprintf(szIdx,"%X%02X%02X%02X",0,0,0,Idx);
D:\Domoticz\domoticz\hardware\PanasonicTV.cpp(165): sprintf(m_szDevID, "%X%02X%02X%02X", 0, 0, (m_DevID & 0xFF00) >> 8, m_DevID & 0xFF);
D:\Domoticz\domoticz\hardware\PanasonicTV.cpp(852): sprintf(szID, "%X%02X%02X%02X", 0, 0, (ID & 0xFF00) >> 8, ID & 0xFF);
D:\Domoticz\domoticz\hardware\PanasonicTV.cpp(875): sprintf(szID, "%X%02X%02X%02X", 0, 0, (ID & 0xFF00) >> 8, ID & 0xFF);
D:\Domoticz\domoticz\hardware\PanasonicTV.cpp(889): sprintf(szID, "%X%02X%02X%02X", 0, 0, (ID & 0xFF00) >> 8, ID & 0xFF);
D:\Domoticz\domoticz\hardware\PhilipsHue\PhilipsHue.cpp(451): sprintf(szID, "%X%02X%02X%02X", 0, 0, 0, NodeID);
D:\Domoticz\domoticz\hardware\Pinger.cpp(227): sprintf(szID,"%X%02X%02X%02X", 0, 0, (ID&0xFF00)>>8, ID&0xFF);
D:\Domoticz\domoticz\hardware\Pinger.cpp(249): sprintf(szID,"%X%02X%02X%02X", 0, 0, (ID&0xFF00)>>8, ID&0xFF);
D:\Domoticz\domoticz\hardware\Pinger.cpp(268): sprintf(szID,"%X%02X%02X%02X", 0, 0, (ID&0xFF00)>>8, ID&0xFF);
D:\Domoticz\domoticz\hardware\plugins\PythonObjects.cpp(630): sprintf(szID, "%X%02X%02X%02X", 0, 0, (self->HwdID & 0xFF00) >> 8, self->HwdID & 0xFF);
D:\Domoticz\domoticz\hardware\Sterbox.cpp(141): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\ToonThermostat.cpp(251): sprintf(szIdx, "%X%02X%02X%02X", 0, 0, 0, Idx);
D:\Domoticz\domoticz\hardware\WOL.cpp(181): sprintf(szID,"%X%02X%02X%02X", 0, 0, (ID&0xFF00)>>8, ID&0xFF);
D:\Domoticz\domoticz\hardware\WOL.cpp(204): sprintf(szID,"%X%02X%02X%02X", 0, 0, (ID&0xFF00)>>8, ID&0xFF);
D:\Domoticz\domoticz\hardware\WOL.cpp(221): sprintf(szID,"%X%02X%02X%02X", 0, 0, (ID&0xFF00)>>8, ID&0xFF);
D:\Domoticz\domoticz\hardware\ZWaveBase.cpp(339): sprintf(szID,"%X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\DomoticzHardware.cpp(540): sprintf(szIdx, "%X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\DomoticzHardware.cpp(562): sprintf(szIdx, "%X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\main\mainworker.cpp(1702): sprintf(szTmp,"%X%02X%02X%02X", pResponse->LIGHTING2.id1, pResponse->LIGHTING2.id2, pResponse->LIGHTING2.id3, pResponse->LIGHTING2.id4);
D:\Domoticz\domoticz\main\mainworker.cpp(1729): sprintf(szTmp, "%X%02X%02X%02X", pResponse->RADIATOR1.id1, pResponse->RADIATOR1.id2, pResponse->RADIATOR1.id3, pResponse->RADIATOR1.id4);
D:\Domoticz\domoticz\main\mainworker.cpp(1778): sprintf(szTmp, "%X%02X%02X%02X", pMeter->id1, pMeter->id2, pMeter->id3, pMeter->id4);
D:\Domoticz\domoticz\main\mainworker.cpp(4420): sprintf(szTmp,"%X%02X%02X%02X", pResponse->LIGHTING2.id1, pResponse->LIGHTING2.id2, pResponse->LIGHTING2.id3, pResponse->LIGHTING2.id4);
D:\Domoticz\domoticz\main\mainworker.cpp(8164): sprintf(szTmp, "%X%02X%02X%02X", pResponse->RADIATOR1.id1, pResponse->RADIATOR1.id2, pResponse->RADIATOR1.id3, pResponse->RADIATOR1.id4);
D:\Domoticz\domoticz\main\mainworker.cpp(9397): sprintf(szTmp,"%X%02X%02X%02X", pMeter->id1, pMeter->id2, pMeter->id3, pMeter->id4);
D:\Domoticz\domoticz\main\mainworker.cpp(9439): sprintf(szTmp,"%X%02X%02X%02X", pMeter->id1, pMeter->id2, pMeter->id3, pMeter->id4);
D:\Domoticz\domoticz\main\mainworker.cpp(9481): sprintf(szTmp,"%X%02X%02X%02X", pMeter->id1, pMeter->id2, pMeter->id3, pMeter->id4);
Matching lines: 43 Matching files: 21 Total files searched: 600
Code: Select all
D:\Domoticz\domoticz\hardware\BleBox.cpp(256): sprintf(szIdx, "%02X%02X%02X%02X", atoi(strarray[0].data()), atoi(strarray[1].data()), atoi(strarray[2].data()), atoi(strarray[3].data()));
D:\Domoticz\domoticz\hardware\BleBox.cpp(260): sprintf(szIdx, "%02x%02x%02x%02x", atoi(strarray[0].data()), atoi(strarray[1].data()), atoi(strarray[2].data()), atoi(strarray[3].data()));
D:\Domoticz\domoticz\hardware\BleBox.cpp(526): sprintf(level, "%02x%02x%02x%02x", red, green, blue, 255);
D:\Domoticz\domoticz\hardware\Dummy.cpp(350): sprintf(ID, "%02X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\OpenWebNetTCP.cpp(444): sprintf(szIdx, "%02X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\OpenWebNetTCP.cpp(488): sprintf(szIdx, "%02X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\OpenWebNetTCP.cpp(1131): sprintf(szIdx, "%02X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\OpenWebNetTCP.cpp(1136): sprintf(szIdx, "%02X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\OpenWebNetTCP.cpp(1148): sprintf(szIdx, "%02X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\OpenWebNetTCP.cpp(1153): sprintf(szIdx, "%02X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\hardware\OpenWebNetUSB.cpp(250): sprintf(szIdx, "%02X%02X%02X%02X", ID1, ID2, ID3, ID4);
D:\Domoticz\domoticz\main\mainworker.cpp(1723): sprintf(szTmp, "%02X%02X%02X%02X", pResponse->HOMECONFORT.id1, pResponse->HOMECONFORT.id2, pResponse->HOMECONFORT.id3, pResponse->HOMECONFORT.housecode);
D:\Domoticz\domoticz\main\mainworker.cpp(5403): sprintf(szTmp, "%02X%02X%02X%02X", pResponse->HOMECONFORT.id1, pResponse->HOMECONFORT.id2, pResponse->HOMECONFORT.id3, pResponse->HOMECONFORT.housecode);
D:\Domoticz\domoticz\main\mainworker.cpp(5843): sprintf(szTmp, "%02X%02X%02X%02X", pResponse->BLINDS1.id1, pResponse->BLINDS1.id2, pResponse->BLINDS1.id3, pResponse->BLINDS1.id4);
Matching lines: 14 Matching files: 5 Total files searched: 600
some files have a mixture of the two.
On that basis I would suggest that the fix is not obvious. There is also an argument to be made that devices that are controlled by C++ or Pyhton plugins should not have their values updated by the web interface.
For me a better question would be: Why does the JSON interface care about the device ID format when you supply a device index which is all it needs to do the update? Could be more of that heritage stuff I suspect.
I will have a look at the notifications stuff when I get a chance, its on the list.