esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
413 stars 26 forks source link

Add runtime and peak value support for RadonEye RD200 #2404

Open stleusc opened 12 months ago

stleusc commented 12 months ago

Add support for UpTime and Peak value of RadonEye RD200.

Currently the component does not support those 2 values

@jeffeb3 tagging you as the owner of this component

When writing 0x51 instead of 0x50 the response contains the uptime in minutes and the peak value.

The runtime in minutes is an integer starting at offset 4 (length 4) and the peak value is a float starting at offset 12 (length 4) of the resonse data.

pseudo-code:

        runtime_min = extractInt(data, 4, 4);
        int days = runtime_min/24/60;
        int hours = (runtime_min-24*60*days)/60;
        int min = runtime_min-24*60*days-60*hours;
        runtime_formatted = String.format("%d Days %d Hours %d Minutes", days, hours, min);
        peak = extractFloat(data, 12);

This would allow for 2 or 3 new sensors: runtime_min, runtime_formatted (optional), peak

Adding this would be awsome!

jeffeb3 commented 12 months ago

Looks good! I don't have this sensor anymore. So I can't test or develop it. But I will review a PR if you make one.

stleusc commented 12 months ago

Ugh.... I never developed a component for ESPHome. Are there instructions for a dev environment, etc? I might shoot you a message with questions regarding your code. I guess/hope it should be possible to do a: write 0x50 / read write 0x51 / read as a sequence?

Open for any hints you have to get started.

jeffeb3 commented 12 months ago

You can fork the code and make changes, then add the forked github to the yaml file to make esphome pull from your fork for your esp when gather code for the integration.

It has been a while since I've tried and I am swamped at the moment with other projects. But I can help where I can be effective.

On Wed, Sep 27, 2023, 9:42 AM Stephan Leuschner @.***> wrote:

Ugh.... I never developed a component for ESPHome. Are there instructions for a dev environment, etc? I might shoot you a message with questions regarding your code. I guess/hope it should be possible to do a: write 0x50 / read write 0x51 / read as a sequence?

Open for any hints you have to get started.

— Reply to this email directly, view it on GitHub https://github.com/esphome/feature-requests/issues/2404#issuecomment-1737651525, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAN2TESHHJKUPYLMF22TNL3X4RCOHANCNFSM6AAAAAA5JQYPIU . You are receiving this because you were mentioned.Message ID: @.***>