Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. Reason for all the different sensor-types (but same datatypes)?

Reason for all the different sensor-types (but same datatypes)?

Scheduled Pinned Locked Moved General Discussion
4 Posts 3 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ahhk
    Hardware Contributor
    wrote on last edited by
    #1

    Hi, i am a new but very excited user of the mysensors-library and i am not a native english-speaker. I hope you understand what i am trying to ask and tell.
    There is one thing, i dont understand why it was made this way:

    There are a lot of sensor-types, but all of them only consist of only some different datatypes: bool, float, integer (...) Wouldnt it be easier to create a general "sensor-type" instead of creating a lot of different sensors?

    My idea is to make something like a "constructor" for a sensor i want to use. In this constructor i define the datatype, the name, and additional (standardized) parameters like:

    • arm- / disarmable
    • min / max-value
    • other "read" and writeable values...

    In this way i can "build" my sensor-type as i need it. For example i can create a sensor, which reports batterylevel as integer or as float - or just as boolean (batt-ok-value). I can define a "setable" min-value (or max) and so on... The battlevel-feature included today only allows percent-values. This is a bit a limitation, i think...

    Greetings

    Andreas

    AWIA 1 Reply Last reply
    0
    • A ahhk

      Hi, i am a new but very excited user of the mysensors-library and i am not a native english-speaker. I hope you understand what i am trying to ask and tell.
      There is one thing, i dont understand why it was made this way:

      There are a lot of sensor-types, but all of them only consist of only some different datatypes: bool, float, integer (...) Wouldnt it be easier to create a general "sensor-type" instead of creating a lot of different sensors?

      My idea is to make something like a "constructor" for a sensor i want to use. In this constructor i define the datatype, the name, and additional (standardized) parameters like:

      • arm- / disarmable
      • min / max-value
      • other "read" and writeable values...

      In this way i can "build" my sensor-type as i need it. For example i can create a sensor, which reports batterylevel as integer or as float - or just as boolean (batt-ok-value). I can define a "setable" min-value (or max) and so on... The battlevel-feature included today only allows percent-values. This is a bit a limitation, i think...

      Greetings

      Andreas

      AWIA Offline
      AWIA Offline
      AWI
      Hero Member
      wrote on last edited by
      #2

      @ahhk If you are ready for some reading.... there were a few discussions on the subject already..

      1 Reply Last reply
      0
      • hekH Offline
        hekH Offline
        hek
        Admin
        wrote on last edited by
        #3

        It is main reason for the current datatypes is historic. If we would redo things from scratch it would probably look much different.

        Here is an embryo I did way back on a future OTA protocol.
        https://github.com/henrikekblad/Arduino/blob/old-development/libraries/MySensors/MyMessage.h

        These types of changes will affect/break controller plugins, so we cannot do them just for fun. ;)

        It will be much easier to support different protocols soon (using the same codebase) this opens up for changes more easily.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ahhk
          Hardware Contributor
          wrote on last edited by
          #4

          Hi,

          thats a LOT of text - wow. but very interesting (didnt read everything until now).
          Is there a topic or discussion ongoing on this?

          Maybe it can be redone with "mysensors 2.0" (in parallel to 1.5)..
          I will make a deep-dive into the source code now. Its too interesting and i like this kind of coding ;)

          At last: Sry that i opened another topic for this question. looks like i didnt use the right words in the search :/
          Greetings

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          20

          Online

          11.7k

          Users

          11.2k

          Topics

          113.1k

          Posts


          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • MySensors
          • OpenHardware.io
          • Categories
          • Recent
          • Tags
          • Popular