pitschr / knx-examples

Examples for KNX Core libraries
3 stars 4 forks source link

How to add parameters to better control equipmen #1

Closed psl789 closed 1 year ago

psl789 commented 2 years ago

Hello, the author, I want to ask how to add parameter control to the stair light?

In your case, there are only switches and no parameter control. Could you please tell me?

pitschr commented 2 years ago

Hello. For me it is not clear what you mean with "parameter control". When speaking for KNX, there are some data types which have corresponding value ranges and behavior. The usage of switch or other data types is more&less same, they start with DPT....

Example for Switches

client.writeRequest(groupAddress, DPT1.SWITCH.of(true));  // turn on
client.writeRequest(groupAddress, DPT1.SWITCH.of(false));  // turn off

Example for Dimming Control increase/decrease by 12%:

client.writeRequest(groupAddress, DPT3.DIMMING_CONTROL.of(true, StepInterval.PERCENT_12)); // increase
client.writeRequest(groupAddress, DPT3.DIMMING_CONTROL.of(false, StepInterval.PERCENT_12)); // decrease

Example to set temperature (example: 31.5° C):

client.writeRequest(groupAddress, DPT9.TEMPERATURE.of(31.5));
pitschr commented 1 year ago

Assuming that question has been clarified. Feel free to reopen the issue in case it is not clarified yet and add a snippet for better understanding.