Hi @ all,
I have a “it should work” problem.
I am working on implementing a HVAC control for my home.
My setup is KNX and a Raspberry-Pi based OpenHAB.
Using various search engines, I was able to figure out, that instead of using a DPT 20.102 channel a 5.010 DPT works well to map the enums to numbers, which can easily be mapped and seleced.
However … shouldn’t it also work using DPT 20.102 and “strings” for enum values, i.e. sending ‘Frost’ or ‘Comfort’ to that channel?
I created the following test-setup (simplified for brevity):
Thing:
channels:
- id: HVACModeDPTInput
channelTypeUID: knx:string
label: "[82] HVACModeDPTInput(Input)"
description: null
configuration:
ga: 20.102:3/3/13
- id: HVACModeDPTReturnvalue
channelTypeUID: knx:string
label: "[90] KNX Status Returnvalue(Output)"
description: null
configuration:
ga: 20.102:<3/3/28
- id: CombinedHVACModeAsNumber
channelTypeUID: knx:number
label: "[82,90] HVAC Mode as number (In/Out)"
description: null
configuration:
ga: 5.010:3/3/13+<3/3/28
Using items TestMode (number, maps to CombinedHVACModeAsNumber), and
TestModeAsStringSetter,TestModeAsStringFeedback; both as string and mapped to HVACModeDPTInput and HVACModeDPTReturnvalue, respectively.
The sitemap exceprt is as follows:
Selection item=TestMode label="HVAC by number" mappings=[2.0="Standby",1.0="Comfort",4.0="Frost",3.0="Nacht",0="Auto"]
Selection item=TestModeAsStringSetter label="HVAC by string" mappings=[auto="Auto",Comfort="Comfort",Standby="Standby",Economy="Economy",Building Protection="Building Protection"]
Text label="HVAC Feedback by number [%f]" item=TestMode
Text label="HVAC Feedback by string [%s]" item=TestModeAsStringFeedback
Using “HVAC by number” does correctly set the mode and obtains the correct feedback by number (0…4) and strings (“Auto”,“Comfort”,“Standby”,“Economy”,“Building Protection”).
Using the “HVAC by string” to set the mode updates the “TestModeAsStringSetter” item, but does not have any other effect.
Is the direction string to DPT not implemented, or do I have a mistake on my side?
I know, I have a work-around, but … my coder-brain does not want to accept, that the string to DPT is not possible.
Any hints where I have a mistake or pointers where to look for a solution?
I had a look at the source-code of that plugin and calimer, but to be honest, I was a bit lost, in terms of data-flow and interfaces.
Any help or insights would be really appreciated.
Sincerely, TLA