-
Notifications
You must be signed in to change notification settings - Fork 9
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
Can't change names of distance, latency, or sensitivity sensors #7
Comments
This has been fixed in the new version of the code I've uploaded today. In summary there was a change needed in the below two functions, to instead of checking for an exact match to the sensor name, to check for a partial match:
This allows for the sensor attributes to be named using the "pretty device name" prefix. For example: Give the latest version a try and let me know if I can close this issue. |
Wow, thank you for the quick response and the fix! Worked like a charm! The only thing I changed for myself in this version was re-enabling logger (I kept the debug level logging off, but I do like to be able to see logging in general when I am deploying these). Much appreciated! Please go ahead and close this, the issue has been resolved. |
Excellent, |
I was going to ask about adding additional sensors, then I realized you have another device with temp/humidity and another STL for a case... you f'in rock man. Is there any reason I couldn't do the same thing without going to an ESP32 version of the D1? I just bought a pack of D1 Minis with USB-C and 8266. They should be able to support one more sensor, and maybe a push button, right? |
Hey! Yes you can do it with an esp8266 - the wiring is a bit more tight space wise but it works ok. The only reason i went for an esp32 for the combo sensor is because I wanted to try an esp32! The same code from the other repo should work if you replace the pins with the ones your 8266 uses. |
Ps. If you try the other case with an 8266 you’ll need to enlarge the square cut out for the chip a bit as the d1 mini has it moved more to the left compared to the esp32 mini. I’ve included the step files on printables so it should be a very quick mod. |
First of all, thank you for sharing this. Out of the box for one sensor it works amazingly well.
My issue is that I would like to run many of these. When I deploy the first one, my friendly name does not get used for the distance, latency, or sensitivity sensors. For instance, "distance" is just called "number.distance" as opposed to "number.sensor-name-distance". I tried updating the leapmmw_sensor.yml file by changing the names (while leaving the id as-is) but with the 3 mentioned sensors, once I change those names, they will no longer update in HA with values stored in the device. They just look empty, even after waiting a very long time.
I tested this by going back and one-by-one putting the original "names" back, and as I did that, the values started appearing in HA and working as expected.
I believe that the issue is the functions in the header file are referring to the Name, as opposed to the id.
For example from leapmmw_sensor.yml:
and from leapmmw_sensor.h:
Once I change the "name" in the yml file, the function
publishNumber("distance", parse_number<float>(getRange).value());
no longer seems to work.Is there a better way to have all of the entities associated with the device have names prefixed with the device name?
Thanks!
The text was updated successfully, but these errors were encountered: