snowdd1 / homebridge-knx

KNX platform shim for homebridge
https://github.com/nfarina/homebridge
GNU General Public License v2.0
97 stars 56 forks source link

this.myAPI.setValue in Handler creates NO KNOWN TYPE error #123

Closed Luigi01W closed 4 years ago

Luigi01W commented 6 years ago

Hello again, I face another error when I want to write a value from a Handler to a characteristic that has no group address and has a UINT32 format. Any help appreciated! Thanks!

Handler code:

            this.HKSetDuration = this.myAPI.getLocalConstant("DefaultDuration");
            this.myAPI.setValue("SetDuration",this.HKSetDuration);

Definition of the device in knx_config.json:

{
            "DeviceName": "Rasenbewaesserung",
            "Services": [
                {
                    "ServiceType": "Valve",
                    "ServiceName": "Rasenbewaesserung",
                    "Handler": "Rasenbewaesserung",
                    "Characteristics": [
                        {
                            "Type": "Active"
                        },
                        {
                            "Type": "ValveType"
                        },
                        {
                            "Type": "InUse"
                        },
                        {
                            "Type": "SetDuration"
                        },
                        {
                            "Type": "RemainingDuration"
                        }
                    ],
                    "KNXObjects": [
                        {
                            "Type": "Bewaesserung",
                            "Set": "0/4/0",
                            "Listen": "0/4/3",
                            "DPT": "DPT1"
                        }
                    ],
                    "KNXReadRequests": [
                        "0/4/3"
                    ],
                    "LocalConstants": {
                        "ValveType": 1,
                        "DefaultDuration": 600
                    },
                    "subtype": "SUB_2ffe2e2d-5ac3-4a94-87a8-702f4e85837a"
                }
            ],
            "UUID": "635f1b89-384b-4e4d-a9c4-ffc04f12a976"
        }

Error message in homebridge.log:

[2018-6-19 21:51:09] [homebridge-knx.KNX] Rasenbewaesserung->customServiceAPI.setValue(SetDuration,600)
[2018-6-19 21:51:09] [homebridge-knx.KNX] knxAccess.writeValueHK() - NO KNOWN TYPE
wendelit commented 6 years ago

I got the same error and UINT32 dose not seam to be included in a switch/case statment in the knxaccess.js file (starting on line 254) you could just add it but i guess there has to be some more code in it to work.

snowdd1 commented 5 years ago

it's a bug - those types were known but not yet in use when I coded that in 2016... :-(

snowdd1 commented 4 years ago

Stale, I assume it's fixed.