Send sensor data via HTTP

Hi, I come here from a domoticz(approx. 10 years of usage), so almost zero knowledge on HA features.

How to send temperature data using GET method ?

Domoticz dzvents code used -

--Send Sensor Data to ESP32 Gas Sensor [Kitchen]

return
{
    on =
    {
        timer = {'every 1 minutes'}
    },

    execute = function(domoticz)
        local OutT = domoticz.devices('Снаружи').temperature
        local KitT = domoticz.devices('Kitchen').temperature
            domoticz.openURL({
            url = 'http://192.168.1.121/?OutT='..(OutT)..'&KitT='..(KitT)..'',
            method = 'GET',
            })

    end
}

I assume that is non hard to achieve, but don’t know how.
P.S. Sorry for my English.

Assuming you have already managed to import your outside and kitchen temperature devices into Home Assistant somehow, you could create a RESTful command to send the temperature data to your ESP32 device. In your configuration.yaml, this might look like:

rest_command:
  send_temp_to_gas_sensor:
    url: "http://192.168.1.121/?OutT={{ sensor.outside_temperature }}&KitT={{ sensor.kitchen_temperature }}

Then to replicate the function of sending it every minute, you could create an automation that uses a time pattern trigger to fire every minute, then in the action section, call this service.

There are more holistic ways to integrate ESP devices into Home Assistant though. Consider looking into ESPHome.

1 Like

I followed all steps U provided, but data is not transmitted.
I’m not seeing changes in “gas sensor”, when executing
http://192.168.1.121/?OutT=99’&KitT=55 in a web browser, data received successfully.
Created automation script, also tried manual launch.
Restarted HAOS.

Here what I hawe at moment:
Added to configuration.yaml -

rest_command:
  send_temp_to_gas_sensor:
    url: "http://192.168.1.121/?OutT={{ sensor.outside_temperature }}&KitT={{ sensor.temperature_158d00036b194a }}"

Timer corrected (image attached value was wrong)