Http binding OH3, how to create a switch channel in UI?

Hi, how do i properly create a http switch channel in OH3 in the http binding?

Switch on command is: 
http://192.168.178.35/1

Switch off command is:
http://192.168.178.35/0

The status channel is showing nicely, but i don´t know how to configure the switch. The below does not work for switching.

UID: http:url:BaumGarten
label: HTTP URL Thing
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: http://192.168.178.35
  refresh: 50
  commandMethod: GET
  contentType: text/xml
  timeout: 3000
  bufferSize: 2048
location: Garten
channels:
  - id: state
    channelTypeUID: http:string
    label: state
    description: ""
    configuration:
      stateExtension: /getState
      commandExtension: /
  - id: Baumaussen_Switch
    channelTypeUID: http:switch
    label: ON / OFF
    description: ""
    configuration:
      onValue: "1"
      offValue: "0"
      commandExtension: /

You have to modify the command URL extension:
%2$s

Thank you, that did the trick. Can you explain the rationale so that i understand? :smiley:

Best
Jan

Yeah, I’ve found on the web myself ^^
The variable consumes the on- and off-value.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.