Monitoring device by HTTP

I have heat pump neore with web interface based on XML pages.
I have tested download data by this script which return data:

curl -c x -d"USER=$USER&PASS=$PASS" $URL/page19.xml -L /login.xml 2>/dev/null >/dev/null
curl -s -b x $URL/data/

When I tried use HTTP binding in OH32, I alwas get timeout. Is possible create cookie like this commands in binding?
I tried something like this:

UID: http:url:041d306bf1
label: Neore
thingTypeUID: http:url
- USER=neore,PASS=xxxxx
ignoreSSLErrors: false
stateMethod: POST
refresh: 30
commandMethod: POST
timeout: 1000
authMode: BASIC
delay: 0
contentType: application/xml
bufferSize: 2048

  • id: neore_TeplotaVody
    channelTypeUID: http:number
    label: TeplotaVody
    description: “”
    mode: READONLY
    stateExtension: data
    stateContent: state

Are you sure that you want to connect via http and not https? This may be causing the timeout!?

Anyway I would not recommend to send your user/password combination as unencrypted plain text.

1 Like

Yes, https isn’t supported, is very simply PLC device.
Problem is in following redirects (curl -L parameter) and saved cookies (curl -c parameter), without this curl don’t works too.

You can always use the exec binding to perform the curl request directly. It’s probably the best option when you need some more advanced parameters. I highly doubt that you will be successful with the http binding alone.