climateguard / RadSens

Arduino library for radiation detector module RadSens to simplify integration into compatible platforms.
GNU General Public License v3.0
49 stars 17 forks source link

ESPhome config template #4

Closed cracrama closed 2 years ago

cracrama commented 2 years ago

Hiya Recently i have purchased Radsens dosimeter. I would like to use this device with Home Assistant and ESPhome - is it possible for you to publisch configuration example with all features? Or maybe you know where we can find this kind of config. Best regards.

climateguard commented 2 years ago

what configuration do you need?

cracrama commented 2 years ago

Hiya - many thanks for response. Sorry I'm not that experienced but i will try to esplain:) A few people would like to use this device with Home Assistant and ESPhome integration. And all what we can find is stndard integration for other dosimeteres like in attached link. https://github.com/mikenabhan/iot-geiger-counter/blob/main/esphome.yaml Is it possible to publish configuration specific to your device to expose all it's sensors and functionality?

https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail Virus-free. www.avast.com https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>

On Thu, 30 Dec 2021 at 13:43, Climateguard @.***> wrote:

what configuration do you need?

— Reply to this email directly, view it on GitHub https://github.com/climateguard/RadSens/issues/4#issuecomment-1003034655, or unsubscribe https://github.com/notifications/unsubscribe-auth/AUJDD4GI33YGS55CHBD6ED3UTROWRANCNFSM5IZJYE6Q . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.***>

maaad commented 2 years ago

Try this one: https://github.com/maaad/RadSens1v2

4224 commented 2 years ago

How timely. I have a Radsens as well and want to start logging through ESPHome into grafana. Thank you maaad, will check this out and see if I can get it working.

cracrama commented 2 years ago

Hiya So i have managed to run device on ESPhome and HA and works great. Many thanks for help with config and for adding link. I would strongly suggest to add information on your product website that device is compatible with Esphome and HA because this is quite nice Geiger Counter which works in conviniant I2C and size is also very handy.

But when I'm here as i stated before - I'm not and expert but during compilation on esphome i had following yellow warnings.

src/radSens1v2.cpp: In member function 'bool ClimateGuard_RadSens1v2::updateData()': src/radSens1v2.cpp:28:41: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: Wire.requestFrom(_sensor_address, 21); ^ In file included from src/radSens1v2.h:7:0, from src/radSens1v2.cpp:1: /data/cache/platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:103:13: note: candidate 1: uint8_t TwoWire::requestFrom(int, int) uint8_t requestFrom(int address, int size); ^ /data/cache/platformio/packages/framework-arduinoespressif32/libraries/Wire/src/Wire.h:101:13: note: candidate 2: uint8_t TwoWire::requestFrom(uint8_t, uint8_t) uint8_t requestFrom(uint8_t address, uint8_t size); ^ src/radSens1v2.cpp:31:31: warning: iteration 19u invokes undefined behavior [-Waggressive-loop-optimizations] _data[i] = Wire.read(); ^ src/radSens1v2.cpp:29:23: note: containing loop for (int i = 0; i < 21; i++) ^ src/radSens1v2.cpp: In member function 'uint16_t ClimateGuard_RadSens1v2::getSensitivity()': src/radSens1v2.cpp:142:24: warning: array subscript is above array bounds [-Warray-bounds] return _data[19] * 256 + _data[18]; ^ src/radSens1v2.cpp: In member function 'bool ClimateGuard_RadSens1v2::getLedState()': src/radSens1v2.cpp:227:21: warning: array subscript is above array bounds [-Warray-bounds] if (_data[20] == 1) ^

Is this something we should be concerned about or it's normal? Please advise,

Many thanks for help again and best regards

PS FOR anyone who trying to run device in ESPhome and is completelly "green" - You need to add folder "RadSens1v2" in your esphome directory and insidde you neede to add 3 files as listed under "includes:" - These 3 Files are available in repository just follow the link given by Author.

climateguard commented 2 years ago

Hello, it's normal wornings for wire library use. it's ok.

climateguard commented 2 years ago

Try this one: https://github.com/maaad/RadSens1v2

Thank you Maaad, i add link to your project in our repository.

4224 commented 2 years ago

This has been working well on ESPhome for me. Especially appreciate the instructions about the folder locations for the less experienced. One thing I'm wondering about is the units. It's reporting microroentgens I believe. Is this the most appropriate unit for this SBM20 sensor?

climateguard commented 2 years ago

Hello, microroentgens is a standard like sievert. It doesn't matter that unit you use. U can convert roentgen to any unit you want to use. 1 sv = 100 roentgen. We use roengen as a base because it easily convertible to any other units.