ioBroker / ioBroker.knx

connect KNX via eibd
http://www.iobroker.org
Other
50 stars 32 forks source link

Wrong State Value - DPT 3.007 Dimming Control #200

Open Videonisse opened 2 years ago

Videonisse commented 2 years ago

I get errors in the log when manually dimming a KNX light. The GA uses DPT 3.007 Dimming Control.

Log says: "State value to set for "knx.0.Belysning.Dimmer.Kök_Lampgrupp_Pendel_fönster_Dimra_Upp-Ner_4bit" has to be one of type "string", "number", "boolean" but received type "object"

ioBroker v 3.3.18 KNX Adapter v 1.0.45

Raw Object Data for the Datapoint:

{
  "_id": "knx.0.Belysning.Dimmer.Kök_Lampgrupp_Pendel_fönster_Dimra_Upp-Ner_4bit",
  "type": "state",
  "common": {
    "name": "Kök Lampgrupp Pendel fönster Dimra Upp-Ner 4bit",
    "type": "mixed",
    "role": "value",
    "read": false,
    "write": true
  },
  "native": {
    "dpt": "DPT3.007",
    "address": "4/7/137",
    "addressRefId": "P-095B-0_GA-57",
    "statusGARefId": "",
    "actGARefId": "",
    "objRef": "O-111_R-1756",
    "devName": "M-0048_A-493A-1C-D4B1",
    "devInst": "P-095B-0_DI-16",
    "objectSize": ""
  },

Is this a bug, or do I need to change my config for those data points?

chefkoch009 commented 2 years ago

This is no bug or error. dpt3.xxx is 4 bit. the 1st Bit means the direction and the bits 2,3,4 are the stepwidth. you can send a state as [a,bcd] with a as 1st bit and bcd as bit 2,3,4 a number.

Videonisse commented 2 years ago

Thanks for prompt response. Ok, confirmed what I thought.

But what is then the cause of the errors in the log and how can I get rid of them?

Garfonso commented 2 years ago

you could try to change the "type" from "mixed" to "object".

Videonisse commented 2 years ago

Thanks for the suggestion. Unfortunately, it didn't help. Now I get another error message:

State value to set for "knx.0.Belysning.Dimmer.Kök_Lampgrupp_Pendel_fönster_Dimra_Upp-Ner_4bit" has to be stringified but received type "object"

Videonisse commented 2 years ago

I changed the type to "string" and now it works without the errors in the log.

However, I deleted to datapoint and re-added using project import. Then the type is automatically set as "mixed". I assume this is not correct and it should be "string". Is it then a bug with project import regarding how DPT 3.007 Dimming Control is mapped?

Garfonso commented 2 years ago

State value to set for "knx.0.Belysning.Dimmer.Kök_Lampgrupp_Pendel_fönster_Dimra_Upp-Ner_4bit" has to be stringified but received type "object"

Interesting... hm. Is this with admin 4 or 5? Or a script?

AFAIK the knx adapter sets mixed for many datapoint types. This should probably be changed here, yes.

Videonisse commented 2 years ago

I use Admin v 5.1.25. Value is changed using a KNX push button (dim up/down).

Apollon77 commented 2 years ago

I think the problem is that someone directly tries to insert an array or object into "setState". This dfo not work. Update JavaScript Adaoter, then it should be handled automatically.

Videonisse commented 2 years ago

The DP is currently not used in ioBroker, so there are no scripts involved. Anyway, javascript installed is already the latest I believe (v5.2.13).

chefkoch009 commented 2 years ago

DPT 3.x is normally 4-Bit. Lets say it is "xxxx b nnn" where x is ignored, b is a binary for direction (up/down) and "nnn" is interpreted as number with 3bit that means 0-7. The number is the stepwidth.

Videonisse commented 2 years ago

So will you change in the import so it's not created as Object but as Number?

chefkoch009 commented 2 years ago

Well, this is an argument, I will fix it.

chefkoch009 commented 2 years ago

Seems to be a little bit more tricky, than i thought :-(