Requirements:
- ESPHome addon installed
- File editor addon installed
- Downloaded ESPHome-LM75A-Temperature-Sensor-Component github repo
-
using ESPHome Create project:
my_project_name
-
using File Editor addon, go to path
homeassistant/esphome/
-
upload LM75A.cpp file to the same folder as my_project_name.yaml.
-
upload LM75A.h file to the same folder as my_project_name.yaml.
-
Edit my_project.yaml file.
Add includes subsection of esphome.
esphome:
includes:
- LM75A.h
- LM75A.cpp
Add I2C and sensor sections to end of file.
i2c:
- id: bus_a
sda: 4
scl: 5
scan: True
sensor:
- platform: custom
lambda: |-
auto lm75a = new LM75A();
App.register_component(lm75a);
return {lm75a};
sensors:
name: "LM75A Temperature"
unit_of_measurement: °C
accuracy_decimals: 1
-
on the top left corner, click Install
-
enjoy
-
Create project:
esphome my_project.yaml wizard
-
Compile project:
esphome my_project.yaml compile
(this creates a project src folder) -
Copy LM75A.cpp file to the project src folder.
-
Copy LM75A.h file to the same folder as my_project.yaml.
-
Edit my_project.yaml file.
Add includes subsection of esphome.
esphome:
includes:
- LM75A.h
Add I2C and sensor sections to end of file.
i2c:
- id: bus_a
sda: 4
scl: 5
scan: True
sensor:
- platform: custom
lambda: |-
auto lm75a = new LM75A();
App.register_component(lm75a);
return {lm75a};
sensors:
name: "LM75A Temperature"
unit_of_measurement: °C
accuracy_decimals: 1
- Compile and upload project:
esphome my_project.yaml run
This project is under MIT license. This means you can use it as you want (just don't delete the library header).
It is a modified Arduino-LM75A-Temperature-Sensor-Library project by QuentinCG.