Skip to content

added new usermod adc_sensor_mqtt_v2 with hass integration #4635

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions usermods/adc_sensor_mqtt/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# ADC sensor with MQTT & HASS support ##
This usermod will obtain readings from adc pin. This is useful for ldr for example for exterior lighting situations where you want the lights to only be on when it is dark out. but this mod is designed for more hass application. it will publish auto discovery message to hass mqtt and attach the sensor to the wled integration automatically

# Installation
Add "adc_sensor_mqtt" to your platformio.ini environment's custom_usermods and build.
Example:
```
[env:adc_sensor_mqtt_esp32dev]
extends = env:esp32dev
custom_usermods = ${env:esp32dev.custom_usermods}
adc_sensor_mqtt # Enable ADC sensor with MQTT
```

# Usermod Settings
Setting | Description | Default
--- | --- | ---
Enabled | Enable/Disable the LDR functionality. | Disabled
Pin | The analog capable pin your LDR is connected to. | A0 is forced in esp8266 and its not optional
AdcUpdateInterval | update interval to read the analog pin ( in ms ) | 3000
Inverted | invert readings based on your own hardware setup ( invert mapping analog to digital value to 0V = 100% or 3.3V = 100% ) | false
ChangeThreshold | the minimum limit to detect change and publish the value ; checks the raw value ( int ; 5 ) . | 1
HASS | Enable home assistant mqtt discovery message with wled integration | true
Raw | publish the ADC value as raw measurement (0-4096 for ESP32 / 0-1024 for ESP8266) | false
DeviceClass | HASS sensor discovery device class | voltage
UnitOfMeas | HASS sensor discovery device unit of measurements | V

## Author
[@rommo911] (https://github.com/rommo911)
Loading