What to put in the Onewire names array

I have difficulty to understand how the Onewire configuration is done.
My setup is basically working: I see the correct temperatures in the dashboard.
As I have several sensors, I would like to get them with a meaningful name…
So what exactly should be put in the configuration:

# Example configuration.yaml entry
sensor:
  - platform: onewire
    names:
      some_id: your name

What is “some_id”?
What characters can I use for “your name”?
Is “your name” the same as the friendly_name from the customize section?

Regards, Jacques-D.

I’m guessing here but… some_id is the entity_id as seen in the states tab for each of your onewire sensors and ‘your name’ is the name that you want the sensor to have.

EDIT: from the component onewire sensor…

# Example configuration.yaml entry
sensor:
  - platform: onewire
    names:
      some_id: your name

Configuration variables:
names array (Optional): ID and friendly name of your sensors.

I was guessing too, but none of these is getting a “friendly” name:

  - platform: onewire
    mount_dir: "/mnt/1wire"
    names:
      287167f4040000_temperature: Speicher unten
      287167F4040000: Speicher mitte
      28-8B76F4040000: Speicher oben

So what?

When you have restarted HA what’s in the states table?

sensor.282636f8010000_temperature	15.0	unit_of_measurement: °C
friendly_name: 28.2636F8010000 Temperature
sensor.287167f4040000_temperature	46.4	unit_of_measurement: °C
friendly_name: 28.7167F4040000 Temperature
sensor.288b76f4040000_temperature	58.8	unit_of_measurement: °C
friendly_name: 28.8B76F4040000 Temperature
sensor.28ca68f4040000_temperature	38.4	unit_of_measurement: °C
friendly_name: 28.CA68F4040000 Temperature
sensor.28eb0c21020000_temperature	16.1	unit_of_measurement: °C
friendly_name: 28.EB0C21020000 Temperature
sensor.28ff3c5d621403_temperature	40.5	unit_of_measurement: °C
friendly_name: 28.FF3C5D621403 Temperature
sensor.28ff667e641401_temperature	18.9	unit_of_measurement: °C
friendly_name: 28.FF667E641401 Temperature

Sorry for the delay, my wife was calling for the dinner…

- platform: onewire
    mount_dir: "/mnt/1wire"
    names:
      287167f4040000_temperature: Speicher unten
      287167F4040000: Speicher mitte
      28-8B76F4040000: Speicher oben

Shouldn’t the above be…

names:
  sensor.287167f4040000_temperature: Speicher unten

Edited and restarted: same again…

  - platform: onewire
    mount_dir: "/mnt/1wire"
    names:
      sensor.287167f4040000_temperature: Speicher unten
      287167F4040000: Speicher mitte
      28-8B76F4040000: Speicher oben

OK, the only other thing is to do it in customize section.

But in this case, what is this “names” array used for?

The only other thing I can think of is put ’ single quotes round the friendly names, after that I’m stumped :stuck_out_tongue:

Quotes were not helping…
But trouble shooting will continue!
Will keep you informed.

1 Like

The problem is solved:

  • The left side of the expression must match exactly the sensor name, as it is in the owfs file system
  • The right side will be used as “id” for the sensor (as seen in the states)
  • The friendly name must be set in the customize zone

In my case I had no need to change the id, so I have used only the customization to set the friendly name

The owfs file system:

jdp@gandalf:~$ ls -1 /mnt/1wire/
28.2636F8010000
28.7167F4040000
28.8B76F4040000
28.CA68F4040000
28.EB0C21020000
28.FF3C5D621403
28.FF667E641401
alarm
bus.0
settings
simultaneous
statistics
structure
system
uncached
jdp@gandalf:~$ 

The configuration:

- platform: onewire
  mount_dir: "/mnt/1wire"
sensor.28eb0c21020000_temperature:
  friendly_name: "Coll. chaud"

The result:

sensor.28eb0c21020000_temperature
  16.1
  unit_of_measurement: °C
  friendly_name: Coll. chaud
1 Like

I got the names magic sorted out. This really defines internal names, so I have following working:

a) configuration.yaml, define internal names (I guess your mistake was to use spaces here) and use it in a graph (as example)

sensor:
    - platform: onewire
        names:
             28-0000098b0696: outdoors
             28-00000a17b6a2: indoors
history_graph:
  gr1:
    name: Temp
    entities:
      - sensor.indoors_temperature
      - sensor.outdoors_temperature
    hours_to_show: 24
    refresh: 60

b) Optional customize.yaml, as defined with configurator to get friendly UI names. If this is not defined, you have also “quite friendly” names from the defined ID-s above.

sensor.outdoors_temperature:
  friendly_name: Väljas
sensor.indoors_temperature:
  friendly_name: Toas

I have the 1-wire sensors connected to i2c adapter board and the only way to get the names section working was to use exactly the same names that appear in the file system, e.g.:

ls -1 /mnt/1wire/
10.2F1080000800
10.9E1280000800
10.BBFA7F000800
10.DFF27F000800
10.ECFB7F000800
10.F30580000800
alarm
bus.0
settings
simultaneous
statistics
structure
system
uncached

Note the “.” and uppercase in id-s:

- platform: onewire
  mount_dir: '/mnt/1wire/'
    names:
    10.2F1080000800: livingroom
    10.DFF27F000800: bathroom
    10.9E1280000800: bedroom
    ...

The trick is to try all of those: “-” “.” “_” in sensor id name
In my case I need to use “-”