Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GrowSmart - ESPHome
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Grewe
GrowSmart - ESPHome
Commits
d1b90198
Commit
d1b90198
authored
2 years ago
by
Jan Grewe
Browse files
Options
Downloads
Patches
Plain Diff
add SCD40
add MLX90614
parent
21929857
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
growbox.yaml
+2
-0
2 additions, 0 deletions
growbox.yaml
include/mlx90614.h
+28
-0
28 additions, 0 deletions
include/mlx90614.h
packages/mlx90614.yaml
+34
-0
34 additions, 0 deletions
packages/mlx90614.yaml
packages/scd40.yaml
+22
-0
22 additions, 0 deletions
packages/scd40.yaml
with
86 additions
and
0 deletions
growbox.yaml
+
2
−
0
View file @
d1b90198
...
...
@@ -8,3 +8,5 @@ packages:
time
:
!include
packages/time.yaml
bme280
:
!include
packages/bme280.yaml
yieryi2178
:
!include
packages/yieryi3178.yaml
scd40
:
!include
packages/scd40.yaml
mlx90614
:
!include
packages/mlx90614.yaml
This diff is collapsed.
Click to expand it.
include/mlx90614.h
0 → 100644
+
28
−
0
View file @
d1b90198
#include
"esphome.h"
#include
"Adafruit_MLX90614.h"
class
MLX90614
:
public
PollingComponent
{
public:
Adafruit_MLX90614
mlx90614
=
Adafruit_MLX90614
();
Sensor
*
ambient_temperature
=
new
Sensor
();
Sensor
*
object_temperature
=
new
Sensor
();
MLX90614
(
uint32_t
update_interval
)
:
PollingComponent
(
update_interval
)
{}
void
setup
()
override
{
mlx90614
.
begin
();
}
void
update
()
override
{
float
amb_temperature
=
0.0
;
amb_temperature
=
mlx90614
.
readAmbientTempC
();
// reading twice seemed to eliminate intermittent invalid data reads (shows as 1037.5 C)
amb_temperature
=
mlx90614
.
readAmbientTempC
();
ambient_temperature
->
publish_state
(
amb_temperature
);
float
obj_temperature
=
0.0
;
obj_temperature
=
mlx90614
.
readObjectTempC
();
// only had invalid reads for ambient teperature but taking two readings of object temperature as well fwiw
obj_temperature
=
mlx90614
.
readObjectTempC
();
object_temperature
->
publish_state
(
obj_temperature
);
}
};
This diff is collapsed.
Click to expand it.
packages/mlx90614.yaml
0 → 100644
+
34
−
0
View file @
d1b90198
esphome
:
includes
:
-
include/mlx90614.h
libraries
:
-
Wire
-
SPI
-
https://github.com/adafruit/Adafruit_BusIO @ 1.13.2
-
https://github.com/adafruit/Adafruit-MLX90614-Library @ 2.1.3
sensor
:
-
platform
:
custom
lambda
:
|-
auto mlx90614 = new MLX90614(5000);
App.register_component(mlx90614);
return {mlx90614->ambient_temperature, mlx90614->object_temperature};
sensors
:
-
id
:
mlx90614_temperature_ambient
name
:
"
IR:
Ambient
Temperature"
unit_of_measurement
:
°C
accuracy_decimals
:
2
-
id
:
mlx90614_temperature_object
name
:
"
IR:
Object
Temperature"
unit_of_measurement
:
°C
accuracy_decimals
:
2
prometheus
:
relabel
:
mlx90614_temperature_object
:
id
:
temperature_ir
name
:
"
Object
Temperature
(IR)"
mlx90614_temperature_ambient
:
id
:
temperature_ir_ambient
name
:
"
Ambient
Temperature
(IR)"
This diff is collapsed.
Click to expand it.
packages/scd40.yaml
0 → 100644
+
22
−
0
View file @
d1b90198
sensor
:
-
platform
:
scd4x
update_interval
:
5s
ambient_pressure_compensation_source
:
bme280_pressure
co2
:
id
:
scd40_co2
name
:
"
CO2"
temperature
:
id
:
scd40_temperature
name
:
"
CO2:
Temperature"
humidity
:
id
:
scd40_humidity
name
:
"
CO2:
Humidity"
prometheus
:
relabel
:
scd40_temperature
:
id
:
temperature_co2
name
:
"
Temperature
(CO2)"
scd40_humidity
:
id
:
humidity_co2
name
:
"
Humidity
(CO2)"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment