How to change attributes of a discover mqtt entity? forever to static

I don’t know how to do that, never used auto discovery.
Is it possible to disable it?

yeah, i can disable it and create every sensor manually
think i going for that road,

i thought it should be possible to edit an disovered mqtt entity, to remain static

well, if it re-creates it on every restart then no… but we can only find out if we look at the code.

ok, gonna create the sensors and all stuff manually and then disable it :slight_smile:

hmm, now disabled “auto entityes” in the mqtt intregration, when i restart docker, it creates again all the sensors

using this one : https://github.com/home-assistant/hassio-addons/tree/master/mosquitto

how to disable autodiscovery?

did you read this btw? and this?
and anything mqtt-related in your ./storage?

Ok, thnx , need to read some more

just add it to customization and it will stick forever, but you have to use the yaml customization, not the UI.

homeassistant:
  customize:
    alarm_control_panel.risco_alarm_panel_0:
      code_arm_required: true
1 Like

Aha! Thnx

Possible I can change also the name and friendly name there…

Yeah, lots of things including friendly_name. You can override any attribute in the customize section. It does get wonky with some things, but it should always work.

But after some more trying with mqtt, gonna make it manual as sensors…

Cause if i reboot HA, my sensor and panel are not visible anymore, untill I restart that docker…

So gonna make all manual in yaml , then disable autodiscovery

I personally don’t use discovery. I hard code all my devices. It’s more overhead but they always work and never change names.

1 Like

Indeed , going for the manual road also

Thnx anyway!

It says nothing about overriding attributes in the docs :frowning: - how do you know about it?
Just yesterday I saw this and it apparently works - again, never saw that before… perhaps because I’m not a huge customiser anyway :wink:

Marius is using the Custom UI integration. That’s what allows for the use of templates in customize.yaml (and the templates use Javascript).

Do you mean that it’s possible because of Custom UI?

Correct. That’s one of the enhancements provided by the Custom UI integration.

so it has nothing to do with this topic, got it.
thanks :slight_smile:

You can modify the discovery payload created by a physical device or even create your own entity via MQTT Discovery.

For example, run this script from the Services page and it will create a new entity called light.example.

  example_create:
    alias: 'Create Example MQTT Light'
    sequence:
      service: mqtt.publish
      data:
        topic: 'homeassistant/light/example/config'
        retain: true
        payload: >
          {
            "name": "Example",
            "unique_id": "ABC123",
            "stat_t": "home/example",
            "cmd_t": "home/example/set",
            "bri_stat_t": "home/example/brightness",
            "bri_cmd_t": "home/example/brightness/set"
          }

The newly created entity will appear in States, Entities, and MQTT Integrations views.

Let’s say you just ran the script and Home Assistant has created light.example. Now you want to add an option like the color temperature state topic. Simply add it to the script’s payload, (reload scripts), run it again and Home Assistant will not create a new entity but simply update the existing one. For example, I’ve added two topics for handling color temperature:

  example_create:
    alias: 'Create Example MQTT Light'
    sequence:
      service: mqtt.publish
      data:
        topic: 'homeassistant/light/example/config'
        retain: true
        payload: >
          {
            "name": "Example",
            "unique_id": "ABC123",
            "stat_t": "home/example",
            "cmd_t": "home/example/set",
            "bri_stat_t": "home/example/brightness",
            "bri_cmd_t": "home/example/brightness/set",
            "clr_temp_stat_t": "home/example/color",
            "clr_temp_cmd_t": "home/example/color/set"
          }

Running this revised script won’t create a light.example_02 but simply update the existing one.

If you want to delete light.example, run this script. It simply publishes an empty retained message to the entity’s discovery topic.

  example_delete:
    alias: 'Delete Example MQTT Light'
    sequence:
      service: mqtt.publish
      data:
        topic: 'ha/light/example/config'
        retain: true
        payload: ''

NOTE: Deleting the entity this way will make Home Assistant remove the entity from States and Entities views. However, in the MQTT Integrations view it will mark the entity as Unavailable. In other words, the entity continues to exist in the entity registry. You can click the entity to reveal a dialog-box that allows you to Remove Entity (from the registry). Unfortunately, there’s a bug and it won’t reveal that dialog-box until you restart Home Assistant. I’ve posted it as bug in the home-assistant-polymer repo (it may actually be due to a bug in the backend, not the frontend, but I’ll let the developers decide that).

trial by fire. I’ve had to do it for some zwave lights to get functionality.

1 Like