[HTTP] items without things?

Hello

With openhab 1.8.x I had the following 2 items perfectly working:

Switch Infocus_power “Projector Power” (FF_Salon,AppliancePower) { http=“>[ON:POST:http://infocus/dpjset.cgi?PJ_PowerMode=1] >[OFF:POST:http://infocus/dpjset.cgi?PJ_PowerMode=0]” }
Number Infocus_Lamp “Projector Lamp Hours [%d]” (FF_Salon) { http=“<[http://infocus/PJState.xml:10800000:REGEX(.*?<pjLamphr>(.*?).*)]” }

However with OH 3.4.2, if I try them as is, they do not seam to work…nothing happens when I try the switch…and the number is not initialized…

Do I “have to” configure a thing and a channel? Is so how?

Many thanks!

Yes. Or you can create a rules and use an action.

ok
How would you configure the thing and the channel then in my case (based on the items I have)?
An exemple would help a lot!
Thanks!

UID: http:url:89231b959b
label: HTTP URL Thing
thingTypeUID: http:url
configuration:
  authMode: BASIC
  ignoreSSLErrors: false
  baseURL: http://infocus/
  delay: 0
  stateMethod: GET
  refresh: 30
  commandMethod: POST
  timeout: 3000
  bufferSize: 2048
channels:
  - id: lampHr
    channelTypeUID: http:number
    label: Lamp Hours
    description: null
    configuration:
      mode: READONLY
      unit: h
      stateExtension: PJState.xml
      stateTransformation: REGEX:(.*?<pjLamphr>(.*?).*)
  - id: power
    channelTypeUID: http:switch
    label: Power
    description: ""
    configuration:
      onValue: "1"
      offValue: "0"
      mode: WRITEONLY
      commandExtension: dpjset.cgi?PJ_PowerMode=%2$

Something like that.

1 Like

So, When I try to copy paste that exemple to a .things file, the parser is complaining, not shure why…
The first error is a “missing rule id” and then a lot of “expecting :”
I am afraid I can’t correct it myself although I tried :slight_smile:
Thanks again!

This is for UI defined thing. I can’t help you with .things file, textual configuration is messy, complicated and error prone.

@taratata2 have you checked HTTP - Bindings | openHAB ?

@JimT Yes sure!