Skip to content

Conversation

@JoaDick
Copy link

@JoaDick JoaDick commented Feb 3, 2026

@willmmiles Good news: The PoC for a generic handling of sensor readings that we discussed in #5319 turned out to be less complicated than initially expected!
Please try out the examples in UM_SensorInfo and UM_SensorDummy to see if this is going in the right direction.
I've also adjusted DHT, Temperature and Internal_Temperature_v2, but haven't been able to test it in-depth (my boards seem to be a bit shaky).

Concept & Features

  • A usermod can provide one or multiple sensors.
  • A sensor can measure physical (or theoretical/virtual) quantities (e.g. "Temperature", "Voltage", ... = measurand).
  • Every Sensor...
    • Has a specific (unique) name.
    • Provides its data through one or multiple channels; one for each quantity.
  • Every SensorChannel...
    • Has a specific name (unique per sensor).
    • Delivers its measured quantity as a SensorValue, which can represent one specific datatype (float, int, bool, ...).
    • Provides information about its measured quantity and datatype through properties.
  • These SensorChannelPropertiesconsist of:
    • Datatype of the provided readings readings.
    • SensorValue's (typical) minimum range of operation.
    • SensorValue's (typical) maximum range of operation.
    • Name of the measured quantity, e.g. Temperature, Voltage, "NotKnownYet", ...
    • Unit of the measured quantity, e.g. °C, V, "WTF", ...
  • Supported data types of SensorValue for sensor readings:
    • bool
    • float
    • int32_t
    • uint32_t
    • Array of values (prepared; not yet fully implemented - really needed?)
    • Struct of values (prepared; not yet fully implemented - really needed?)
    • Anything very specialized (through void* - although not recommended)
  • Specific sensor channels that another usermod / effect is interested in can be filtered and accessed through cursors.
    • E.g. all channels with ValueType == float, or quantity = "Temperature".
    • Very easy customizable through own cursor implementations.
  • Some helper classes and functions for usermods to provide sensor data with minimal effort.
  • All in plain and type-safe C++ without any dirty hacks.

And don't forget to look at the Info-Page!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Important

Action Needed: IP Allowlist Update

If your organization protects your Git platform with IP whitelisting, please add the new CodeRabbit IP address to your allowlist:

  • 136.113.208.247/32 (new)
  • 34.170.211.100/32
  • 35.222.179.152/32

Reviews will stop working after February 8, 2026 if the new IP is not added to your allowlist.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant