How can I show a device as a different device

don’t forget you need to restart before you’ll notice the changes :wink:

Getting

expected a dictionary for dictionary value @ data[‘customize’]
when I check it in developer tools

Entered this in configuration.yaml

homeassistant:
  customize:
    binary_sensor.switch.unk_manufacturer_unk_model_switch
      device_class:door
    binary_sensor.switch.unk_manufacturer_unk_model_switch_2
      device_class:door

Can you please check you entities and check the real name?

I think it should look like:


homeassistant:
  customize:
    switch.unk_manufacturer_unk_model_switch
      device_class:door
    switch.unk_manufacturer_unk_model_switch_2
      device_class:door

Still getting the dictionary error

You are missing a blank space between device_class: door.

Thanks

When I put in a space, code studio complains about a bad indentation of a mapping entry

Could you please share again this customize part of your configuration.yaml?
Then one when code studio complains.

Sorry, my bad, that is what you get when typing on a phone :thinking:

Another handycap is that the new studio code server has poor copy/paste functionality on a phone :frowning:

homeassistant:
  customize:
    switch.unk_manufacturer_unk_model_switch
      device_class: door
    switch.unk_manufacturer_unk_model_switch_2
      device_class: door

Here’s the code in Code Studio

You need colons after each entity (as added above)

Thanks Chris that got rid of the errors. After a restart the entity is still a switch, with no change in being able to change it :((

As far as I know, switches doesn’t have support to device_class as a door.
You will have to create a template binary_sensor…

Use this example from the docs and with a few modifications you will be able to set a sensor for door.

http://homeassistant.local:8123/local/nspanel/dev/ns-panel.tft

Something like this:

template:
  - binary_sensor:
      - name: Front door
        device_class: door
        availability: "{{ has_value('switch.unk_manufacturer_unk_model_switch') }}"
        state: "{{ states('switch.unk_manufacturer_unk_model_switch') }}"

      - name: The other door
        device_class: door
        availability: "{{ has_value('switch.unk_manufacturer_unk_model_switch_2') }}"
        state: "{{ states('switch.unk_manufacturer_unk_model_switch_2') }}"

Thanks Edward I will give that a try.

1 Like

That went smooth, Now how do I use that in a dashboard? it doesn’t show up as a device or as an entity. Sorry to be a PIA.

Thanks

Those are entities without a device. You can display in any lovelace dashboard or use in your automations, just look for the entity_id (binary_sensor.front_door, etc.) or the name you gave (Front door, etc), but those are not shown into your device page as they don´t belong to that device.

You can add a unique_id for those to improve a bit what you can do with those entities (like renaming, etc. with the UI), but not more than this (I’ve used the UUID generator embedded into Studio Code Server):

template:
  - binary_sensor:
      - name: Front door
        unique_ui: cddebfc6-db20-4f75-aab3-4d5b4df1ed2f
        device_class: door
        availability: "{{ has_value('switch.unk_manufacturer_unk_model_switch') }}"
        state: "{{ states('switch.unk_manufacturer_unk_model_switch') }}"

      - name: The other door
        unique_ui: 1ba5e6e6-45ae-4aca-8b80-a60b8cf96e26
        device_class: door
        availability: "{{ has_value('switch.unk_manufacturer_unk_model_switch_2') }}"
        state: "{{ states('switch.unk_manufacturer_unk_model_switch_2') }}"

Thanks Edward,

I figured it out.

Have a great weekend

1 Like