Action calibrate esphome

I’m starting on esphome platform, and I just want to say : Wahoo ! In 2 minuts, you add a new sensor, in my case a Senseair (CO2 sensor).

But, I think (or I hope :wink: ) it isn’t calibrate, and I can see on the howto, I have to launch an action to start the calibrate. But my I just connect my senseair to an ESP8266, without button or other thing to launch an action.
Do you know if it’s possible to start a calibrate without create an automation in esphome to do that ? With Home assistant ? or with the web interface maybe ?

Thank you !

Add a template switch.

Then you can trigger the calibration on the turn on action.
Document action.

The switch will be availible in HA.

Hello, I don’t know if I did something wrong, but, my action seems work, but the calibration doesn’t work… Have I forgotten something ?

And how can I show the result with the “background_calibration_result” action ?

  name: sensair-s8
  platform: ESP8266
  board: nodemcuv2

# Enable logging

# Enable Home Assistant API

# Enable Web server
  port: 80

  password: "xxxx"

  ssid: "xxxx"
  password: "xxxxxxx"

  rx_pin: D5
  tx_pin: D6
  baud_rate: 9600

  - platform: senseair
      name: "sensair_s8"
    update_interval: 60s
    id: sensair_s8

  - platform: template
    name: "Calibrate Sensair S8"
    id : "calibrate_s8"
        - senseair.background_calibration: sensair_s8
        - logger.log: "Switch Turned On!"
  - platform: template
    name: "Result Calibrate Sensair S8"
    id : "result_calibrate_s8"
        - senseair.background_calibration_result: sensair_s8

Nobody can help me ? I don’t know what is wrong in my code … :neutral_face:

or you could set up a HA service:

    - service: sensair_background_calibrate
        - senseair.background_calibration: sensair_s8
1 Like

I think it should be shown in the logs ? Make sure you leave some time between the calibration and requesting the result - see below

senseair.background_calibration_result Action

This action requests the result of the background calibration procedure from the sensor with the given ID. The value will be printed in ESPHome logs.

Wait at least one sensor lamp cycle after having triggered the background calibration before requesting its result.

Thanks, Sensair S8 was successfully calibrated after joining