Customize and reference mysensor sensors in configuration



  • Hi!

    Just got Home Assistant set up with a Mysensor MQTT gateway and it works like a charm. I get my sensors discovered as soon as they start sending data and they show up fine in Home Assistant.

    Now I'd like to customise my devices (sensors) and also group them together but I cannot figure out how to reference them in the configuration?

    It's a bit frustrating, I'm a professional system developer, working with yaml configs all day long :). I feel like I'm either stupid, or the documentation is leaving out big chunks of information...

    Is the mysensor gateway a "platform"? How do I name each sensor and what type of properties can I set on them? I'd like to give each sensor some friendly name, perhaps an entity picture and then group them together, is that doable?

    The only config examples I can find are related to setting up the gateway, which I already have done. If someone has a configuration.yaml doing some more stuff with the mysensor integration than just enabling the gateway, like referencing the sensors, it would fantastic if you could share it here as a reference.


  • Mod

    I think what you are trying to achieve is more controller related than mysensors. In mysensors each sensor has a child ID and they are grouped under the Node ID, but besides that I don't think you can ask more to mysensors 🙂



  • Ok, but does that mean that I can reference each sensor in the hass configuration.yaml using node-id.child-id? Or do I need to use some mysensor prefix?

    Like this:

    customize:
        170.0:
          entity_picture: https://example.com/images/humidity.jpg
          friendly_name: Living room humidity
        170.1:
          entity_picture: https://example.com/images/temp.jpg
          friendly_name: Living room temperature
    
    

  • Mod

    I'm sorry, I can't answer that as I haven't used Home Assistant



  • @gohan said in Customize and reference mysensor sensors in configuration:

    I'm sorry, I can't answer that as I haven't used Home Assistant

    Ok, you're aware that this is the Home Assistant controller support forum, right?

    Anyway, figured out how to reference the sensors by looking in the code and the log files. The format is: sensor.<sketch-name>_<node-ID>_<child-ID>. Example: sensor.temperatureandhumidity_170_0.

    Sketch name is the name sent during presentation using the sendSketchInfo() method and should be in all lower case,

    Using this naming pattern I was able to set a friendly name on my humidity sensor like so:

    homeassistant:
      ...
      customize:
        sensor.temperatureandhumidity_170_0:
          friendly_name: Guest room humidity
    

  • Mod

    I am glad you figured it out



  • I also just found that you can find all entity names of all registered devices in the developer tools > states view (just click the < > icon under developer tools).

    Grouping the mysensor sensors is done like this, using the entity names as described above:

    group:
      name: Guest Room
      entities:
        - sensor.temperatureandhumidity_170_1
        - sensor.temperatureandhumidity_170_0
    

  • Plugin Developer

    Hi!

    All the answers that you've already found yourself should be available on these two pages, except the structure of entity_ids for mysensors devices. The latter is something we should add to the docs.

    https://home-assistant.io/docs/configuration/devices/

    https://home-assistant.io/docs/configuration/customizing-devices/


Log in to reply
 

Suggested Topics

  • 1
  • 3
  • 1
  • 2
  • 3
  • 5

2
Online

11.4k
Users

11.1k
Topics

112.7k
Posts