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!
J-N-K
(Jan N. Klug)
April 9, 2023, 1:01pm
2
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!
J-N-K
(Jan N. Klug)
April 9, 2023, 1:30pm
4
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
Thanks again!
J-N-K
(Jan N. Klug)
April 9, 2023, 2:32pm
6
This is for UI defined thing. I can’t help you with .things
file, textual configuration is messy, complicated and error prone.
JimT
(jimtng)
April 9, 2023, 2:40pm
7