plan44 / vdcd

vdcd - home automation device controller for Digital Strom and (via p44mbrd) matter
https://plan44.ch/automation
Other
22 stars 7 forks source link

Device Name truncated #14

Closed splattner closed 2 years ago

splattner commented 2 years ago

Is there a limit for the device name lenght?

Acording to the vdcd log I have set the name of a device to Schalter 2-fach / button4 but in dss it only shows Schalter 2-fach / bu

Screenshot from 2021-12-22 07-26-12 Screenshot from 2021-12-22 07-26-00

Altough I have devices with longer name but I can't figure out why the names are truncated

splattner commented 2 years ago

The vdcd seems to have everything correct, nontheless my dss interface only has the truncated name :thinking:

sqlite> SELECT * from  DeviceSettings;
03C0562DF1BA53FBC0B3CCEA15F17D1B00|0|shelly1-2BE223|65534
9B2E2F36C45E521680C2123B6514F82900|0|shelly1-2C7947|65534
0565B8D85BA35BB7C04CA93CDB51E1AA00|0|LedStripe1|8
2C4B474FB45E5031C0F2CFF0D91A88C200|0|Dachzimmer|65534
37A06FF7842D54FEC0E6663F29365EB300|0|Schlafzimmer|65534
7BDED126456C577CC0AC2B404A23F12E00|0|Garage|65534
11F4C18C7D4C5F1EC0C1E957D1A3E77500|0|shelly1pm-A4CF12F3F93A|65534
8B8BB6171B6C5D91C0EBA7191DE7C82F00|0|shelly1pm-A4CF12F3F878|65534
83822875CED05124C08520617D9F6A5000|0|shellyswitch25-E0980694F6FC|65534
1312D885E8DE52D4C09D8C0E9045548600|0|shellyem3-C45BBE5F3631|65534
66940638C2045F4C80D493D27C33427200|0|Schalter 1-fach / Button 2|65534
DD12B1A4DA0B5F03C007FC85175D8E1200|0|Schalter 1-fach / Button 1|65534

and also this looks ok (vdcd with loglevel7):

[2021-12-22 09:18:02.997 I] P44LoggingObj @0x7f70233bad00: device <- externalVdc (JSON) message sent: { "message": "status", "status": "ok" }

[2021-12-22 09:18:02.998 I] P44LoggingObj @0x7f70233bad00: device -> externalVdc (JSON) message received: { "message": "init", "protocol": "json", "tag": "04:cf:8c:df:3c:77:d4:88-01-0012-%!s(int=1)", "uniqueid": "04:cf:8c:df:3c:77:d4:88-01-0012-%!s(int=1)", "colorclass": 1, "group": 1, "modelname": "lumi.remote.b286opcn01", "modelversion": "20190730", "vendorname": "LUMI", "configurl": "http:\/\/192.168.10.235:40850", "name": "Schalter 1-fach \/ Button 2", "buttons": [ { "id": "button", "buttonid": 1, "buttontype": 1, "group": 1 } ] }

[2021-12-22 09:18:02.998 N] --- added device: 66940638C2045F4C80D493D27C33427200 (Schalter 1-fach / Button 2) (not yet initialized)

[2021-12-22 09:18:02.998 N] --- initialized device: vdSD 66940638C2045F4C80D493D27C33427200 (Schalter 1-fach / Button 2) - NOT YET announced

                            - Buttons: 1

[2021-12-22 09:18:02.998 I] P44LoggingObj @0x7f70233bad00: device <- externalVdc (JSON) message sent: { "message": "status", "status": "ok" }

[2021-12-22 09:18:03.000 I] vdSM -> vDC (pbuf) method call received: requestid='2213', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ zoneID:{ :null } } }

[2021-12-22 09:18:03.001 I] vdSM <- vDC (pbuf), id=2213: result={ zoneID:0 }

[2021-12-22 09:18:03.002 I] vdSM -> vDC (pbuf) method call received: requestid='2214', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ primaryGroup:{ :null } } }

[2021-12-22 09:18:03.003 I] vdSM <- vDC (pbuf), id=2214: result={ primaryGroup:1 }

[2021-12-22 09:18:03.003 I] vdSM -> vDC (pbuf) method call received: requestid='2215', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ buttonInputDescriptions:{ :null } } }

[2021-12-22 09:18:03.003 I] vdSM <- vDC (pbuf), id=2215: result={ buttonInputDescriptions:{ button:{ buttonElementID:0, buttonID:0, buttonType:1, combinables:0, dsIndex:0, name:'button_id0_el0', supportsLocalKeyMode:false, type:'buttonInput', x-p44-behaviourType:'buttonInput' } } }

[2021-12-22 09:18:03.004 I] vdSM -> vDC (pbuf) method call received: requestid='2216', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ outputDescription:{ :null } } }

[2021-12-22 09:18:03.004 I] vdSM <- vDC (pbuf), id=2216: result={  }

[2021-12-22 09:18:03.005 I] vdSM -> vDC (pbuf) method call received: requestid='2217', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ binaryInputDescriptions:{ :null } } }

[2021-12-22 09:18:03.005 I] vdSM <- vDC (pbuf), id=2217: result={ binaryInputDescriptions:{  } }

[2021-12-22 09:18:03.005 I] vdSM -> vDC (pbuf) method call received: requestid='2218', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ sensorDescriptions:{ :null } } }

[2021-12-22 09:18:03.005 I] vdSM <- vDC (pbuf), id=2218: result={ sensorDescriptions:{  } }

[2021-12-22 09:18:03.031 I] vdSM -> vDC (pbuf) method call received: requestid='2219', method='setProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', properties:{ zoneID:65534 } }

[2021-12-22 09:18:03.031 I] vdSM <- vDC (pbuf), id=2219: generic OK

[2021-12-22 09:18:03.032 I] vdSM -> vDC (pbuf) method call received: requestid='2220', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ buttonInputDescriptions:{ :null } } }

[2021-12-22 09:18:03.032 I] vdSM <- vDC (pbuf), id=2220: result={ buttonInputDescriptions:{ button:{ buttonElementID:0, buttonID:0, buttonType:1, combinables:0, dsIndex:0, name:'button_id0_el0', supportsLocalKeyMode:false, type:'buttonInput', x-p44-behaviourType:'buttonInput' } } }

[2021-12-22 09:18:03.065 I] vdSM -> vDC (pbuf) method call received: requestid='2221', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ buttonInputSettings:{ :null } } }

[2021-12-22 09:18:03.065 I] vdSM <- vDC (pbuf), id=2221: result={ buttonInputSettings:{ button:{ callsPresent:false, channel:0, function:5, group:1, mode:0, setsLocalPriority:false, x-p44-buttonActionId:0, x-p44-buttonActionMode:255, x-p44-longFunctionDelay:0, x-p44-stateMachineMode:0 } } }

[2021-12-22 09:18:03.069 I] vdSM -> vDC (pbuf) method call received: requestid='2222', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ buttonInputSettings:{ :null }, outputDescription:{ :null }, outputSettings:{ :null } } }

[2021-12-22 09:18:03.069 I] vdSM <- vDC (pbuf), id=2222: result={ buttonInputSettings:{ button:{ callsPresent:false, channel:0, function:5, group:1, mode:0, setsLocalPriority:false, x-p44-buttonActionId:0, x-p44-buttonActionMode:255, x-p44-longFunctionDelay:0, x-p44-stateMachineMode:0 } } }

[2021-12-22 09:18:03.074 I] vdSM -> vDC (pbuf) method call received: requestid='2223', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ outputSettings:{ :null } } }

[2021-12-22 09:18:03.074 I] vdSM <- vDC (pbuf), id=2223: result={  }

[2021-12-22 09:18:03.116 I] vdSM -> vDC (pbuf) method call received: requestid='2224', method='getProperty', params={ dSUID:'dd12b1a4da0b5f03c007fc85175d8e1200', query:{ configURL:null, deviceClass:null, deviceClassVersion:null, displayId:null, hardwareGuid:null, hardwareModelGuid:null, hardwareVersion:null, model:null, modelFeatures:null, modelUID:null, modelVersion:null, name:null, oemGuid:null, oemModelGuid:null, vendorGuid:null, vendorId:null, vendorName:null } }

[2021-12-22 09:18:03.117 I] vdSM <- vDC (pbuf), id=2224: result={ configURL:'http://192.168.10.235:40850', displayId:'', model:'lumi.remote.b286opcn01', modelFeatures:{ pushbadvanced:true, pushbarea:true, pushbutton:true }, modelUID:'7FF11A41E025587380BB6D0EAA22077800', modelVersion:'20190730', name:'Schalter 1-fach / Button 1', vendorId:'vendorname:LUMI', vendorName:'LUMI' }

[2021-12-22 09:18:03.118 I] vdSM -> vDC (pbuf) method call received: requestid='2225', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ channelDescriptions:{ :null } } }

[2021-12-22 09:18:03.118 I] vdSM <- vDC (pbuf), id=2225: result={ channelDescriptions:{  } }

[2021-12-22 09:18:03.123 I] vdSM -> vDC (pbuf) method call received: requestid='2226', method='getProperty', params={ dSUID:'DD12B1A4DA0B5F03C007FC85175D8E1200', query:{ name:{ :null } } }

[2021-12-22 09:18:03.123 I] vdSM <- vDC (pbuf), id=2226: result={ name:'Schalter 1-fach / Button 1' }

[2021-12-22 09:18:03.124 I] vdSM -> vDC (pbuf) method call received: requestid='2227', method='getProperty', params={ dSUID:'dd12b1a4da0b5f03c007fc85175d8e1200', query:{ binaryInputDescriptions:null, sensorDescriptions:null } }

[2021-12-22 09:18:03.124 I] vdSM <- vDC (pbuf), id=2227: result={ binaryInputDescriptions:{  }, sensorDescriptions:{  } }

[2021-12-22 09:18:03.127 I] vdSM -> vDC (pbuf) result received: id='50', result=null

[2021-12-22 09:18:03.127 N] Announcement for vdSD DD12B1A4DA0B5F03C007FC85175D8E1200 (Schalter 1-fach / Button 1) acknowledged by vdSM
plan44 commented 2 years ago

There's no limit for device name lengths in the vdcd or the vDC API, nor ist there one in the dSS (or at least, a much higher one).

However, there is a bottleneck in between which is the ancient dS485 protocol that still sits between vdSM and the dSS, limiting the number of characters to 20. I know dS developers planned to fix this years ago, but it never got enough priority to actually do.

To avoid killing longer vdc-side names, there's a bit of extra code in DsAddressable::setName(), which avoids that a truncated name sent from vdsm overwrites the full length version in the vdc (see dsaddressable.cpp:75).