Hi there,
I am searching for several hours now, but can’t find the right clue, or example for my problem.
I am super new in openhab, just got it running a few weeks back and connected some devices and created some pages.
But, I am rather expierienced with Arduinos and therefore have some lying around.
For this reason I wanted to build a weather station based on a NodeMCU (ESP8266). So far I created a webserver from with the ESP8266, which shows me the temperature and humidity (will be extended later on with wind speed, pressure, etc.).
Now My Problem is, how do I get this data in my openhab?
So far I added the http binding on my openhab.
I created a Thing with the Basis-URL and it says it is online.
I also created a channel in the thing and the code is as follows:
UID: http:url:------------- (here is the normal UID,I just deleted it for the post)
label: HTTP_GET_Test
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: true
baseURL: http://192.168.178.56/
delay: 0
stateMethod: GET
refresh: 3
commandMethod: GET
timeout: 3000
bufferSize: 2048
location: Büro
channels:
- id: temperature
channelTypeUID: http:number
label: temperature
description: null
configuration:
mode: READONLY
unit: °C
I have now expierence with get commands and don’t really know where to start, or which commands to put where. I asked Bing copilot and it said I should create a http.cfg file in the openhab services folder. I also read something about regex, but I can’t reall put this together. What I am missing, is a simple example on how to get a data point from a website in openhab.
In my sourcecode for the webserver I have these Ids:
/head>
body>
h2>ESP8266 DHT Server
p>
i class=“fas fa-thermometer-half” style=“color:#059e8a;”>
span class=“dht-labels”>Temperature
span id=“temperature”>23.40
sup class=“units”>°C
/p>
p>
i class=“fas fa-tint” style=“color:#00add6;”>
span class=“dht-labels”>Humidity
span id=“humidity”>49.00
sup class=“units”>%
/p>
/body>
Is there someone who can help me out, or show me a link where it is described in detail and within the openhabian UI.
Thank you