[SOLVED] Http Binding error exception with host name "esphome-socket14"

Hello,

i am using the http binding to control smart sockets flashed with esphome and a realtek RTL8710BN chip in it. (btw. this are Tecking SP22, if someone need the esphome config yaml pleas ask) Because the esphome framework does not now offer mqtt support for the realtek chip i am using http get and http post requests to control the smart plug.
If i use the http binding an typ in the host name “esphome-socket14” for example i get the following error:
[WARN ] [p.internal.http.HttpResponseListener] - Requesting ‘http://esphome-socket14/switch/relay_1’ (method=‘GET’, content=‘null’) failed: java.net.UnknownHostException: esphome-socket14: Name or service not known

If i am using the ip adress instead of “esphome-socket14” it works perfectly. What i am doing wrong??

Here is my configuration of the http binding:

UID: http:url:2cd1a1c6fd
label: Teckin_SP22_socket11
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: http://esphome-socket14/switch/relay_1
delay: 0
stateMethod: GET
refresh: 30
commandMethod: POST
timeout: 3000
bufferSize: 2048
channels:

  • id: sadf
    channelTypeUID: http:string
    label: Stringding_sp22
    description: “”
    configuration:
    mode: READONLY
  • id: asfsdafdasf
    channelTypeUID: http:switch
    label: switch_sp22
    description: “”
    configuration:
    onValue: ON
    offValue: OFF
    stateTransformation: JSONPATH:$.state

It seems that java is not able to properly resolve the host-name to an IP address. Do you use a Linux-based system?

Thank you for your fast reply. I think i found the problem. I had to add .local to the host name and it is working now. Maybe this is because of the mDNS resolution.