Hey Guys,
Still learning all things ESPHome, so still a bit of a noob when it comes to trying to integrate custom sensors…
I was just wondering if someone would be able to assist with some sample code to get the following sensor working from DFRobot. I am planning on using it to measure water level in some tanks
A01NYUB - A01NYUB Waterproof Ultrasonic Sensor Wiki - DFRobot
Any help would be greatly appreciated!
I have created a pull request to esphome that adds support for the A01NYUB.
esphome:dev
← MrSuicideParrot:dev
opened 05:02PM - 19 May 23 UTC
# What does this implement/fix?
This pull request adds support for the [a01… nyub waterproof ultrasonic distance sensor](https://wiki.dfrobot.com/A01NYUB%20Waterproof%20Ultrasonic%20Sensor%20SKU:%20SEN0313) by DFRobot .
## Types of changes
- [ ] Bugfix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Other
**Related issue or feature (if applicable):** fixes <link to issue>
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):** esphome/esphome-docs#2934
## Test Environment
- [x] ESP32
- [ ] ESP32 IDF
- [ ] ESP8266
- [ ] RP2040
## Example entry for `config.yaml`:
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR. Furthermore, for new integrations, it gives an impression of how
the configuration would look like.
Note: Remove this section if this PR does not have an example entry.
-->
```yaml
# Example config.yaml
uart:
rx_pin: 19
baud_rate: 9600
sensor:
- platform: a01nyub
name: "Distance"
```
## Checklist:
- [x] The code change is tested and works locally.
- [ ] Tests have been added to verify that the new code works (under `tests/` folder).
If user exposed functionality or configuration variables are added/changed:
- [x] Documentation added/updated in [esphome-docs](https://github.com/esphome/esphome-docs).
Feel free to check it out and give feedback.
Is your implementation already added in a new esphome version or do we need to do it manually?
The pull request hasn’t been accepted, so you need to add it manually by doing:
- source: github://pr#4863
components: [ a01nyub ]
If you use it, please give your feedback on the github issue. I have been using without problems, but probably the maintainers would like to have more feedback to accept the pull request…
1 Like