@dutchman
Danke für die schnelle Antwort. In welcher Variable wird den der z.B. Temperaturwert abgespeichert. Kann man auf den zugreifen? Ich habe ein Beispiel unten angefügt, dort scheint es zu gehen. Leider verstehe ich es nicht vollkommen. Den Ausschnitt und den vollen Code habe ich angehängt. Daher weiss ich auch wie man über Http-get direkt in die Homematic CCU schreibt.
Dieser Bereich scheint den Wert formatiert zu übergeben.
State(" + esphome::to_string(static_cast<uint16_t>(x)) + ")
Danke und Gruß Thomas
sensor:
  - platform: scd4x
    id: scd41
    i2c_id: bus_a
    altitude_compensation: 418m
    co2:
      name: co2
      id: co2
      on_value:
        then:
          - lambda: |-
              if (x > 400 ) id(led_g1).turn_on() ; else id(led_g1).turn_off();
              if (x > 650 ) id(led_g2).turn_on() ; else id(led_g2).turn_off();
              if (x > 800 ) id(led_y1).turn_on() ; else id(led_y1).turn_off();
              if (x > 1050 ) id(led_y2).turn_on() ; else id(led_y2).turn_off();
              if (x > 1300 ) id(led_r1).turn_on() ; else id(led_r1).turn_off();
              if (x > 1550 ) id(led_r2).turn_on() ; else id(led_r2).turn_off();
          - http_request.get:
              url: !lambda |-
                return ((std::string) "http://${hm_host}:8181/any.exe?x=dom.GetObject('${hm_sysvar_co2}').State(" + esphome::to_string(static_cast<uint16_t>(x)) + ")" );
substitutions:
  updates: 30s
  devicename: co2-sensor
  hm_host: 192.168.1.58
  hm_sysvar_co2: scd41-co2
esphome:
  name: ${devicename}
esp32:
  board: esp32dev
  framework:
    type: arduino
wifi:
  ssid: !secret wifi_sid
  password: !secret wifi_password
time:
  - platform: sntp
    id: sntp_time
    timezone: "CET-1CEST,M3.5.0,M10.5.0/3"
    servers: "de.pool.ntp.org"
# Enable logging
logger:
  level: DEBUG
## Optional 
api:
  password: !secret api_password
  reboot_timeout: 0s
ota:
  password: !secret ota_password
## Optional
mqtt:
  broker: 192.168.1.114
i2c:
  - id: bus_a
    sda: 21
    scl: 22
    scan: True
http_request:
  useragent: esphome/device
  id: httpget
  timeout: 10s
sensor:
  - platform: scd4x
    id: scd41
    i2c_id: bus_a
    altitude_compensation: 418m
    co2:
      name: co2
      id: co2
      on_value:
        then:
          - lambda: |-
              if (x > 400 ) id(led_g1).turn_on() ; else id(led_g1).turn_off();
              if (x > 650 ) id(led_g2).turn_on() ; else id(led_g2).turn_off();
              if (x > 800 ) id(led_y1).turn_on() ; else id(led_y1).turn_off();
              if (x > 1050 ) id(led_y2).turn_on() ; else id(led_y2).turn_off();
              if (x > 1300 ) id(led_r1).turn_on() ; else id(led_r1).turn_off();
              if (x > 1550 ) id(led_r2).turn_on() ; else id(led_r2).turn_off();
          - http_request.get:
              url: !lambda |-
                return ((std::string) "http://${hm_host}:8181/any.exe?x=dom.GetObject('${hm_sysvar_co2}').State(" + esphome::to_string(static_cast<uint16_t>(x)) + ")" );
    humidity:
      name: "Luftfeuchtigkeit"
      id: humidity
    temperature:
      name: "Raumtemperatur"
      id: temperature
    ambient_pressure_compensation_source: bme280_pressure
    update_interval: ${updates}
  - platform: bme280
    setup_priority: -15
    temperature:
      name: "BME280-Temperature"
      id: bme280_temperature
      oversampling: 1x
    pressure:
      name: "BME280-Pressure"
      id: bme280_pressure
      oversampling: 1x
    humidity:
      name: "BME280-Humidity"
      id: bme280_humidity
      oversampling: 1x
    address: 0x76
    update_interval: ${updates}
  - platform: wifi_signal
    name: "WiFi Signal"
    id: wifisignal
    update_interval: ${updates}
output:
  - platform: gpio
    pin: 23
    id: led_g1
  - platform: gpio
    pin: 19
    id: led_g2
  - platform: gpio
    pin: 18
    id: led_y1
  - platform: gpio
    pin: 32
    id: led_y2
  - platform: gpio
    pin: 25
    id: led_r1
  - platform: gpio
    pin: 26
    id: led_r2
# Example configuration entry
switch:
  - platform: restart
    name: "CO² Sensor Restart"
web_server:
  port:80