# How to add/edit a DDF on Home assistant using text editor?

**URL:** <https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839>\
**Category:** 3rd Party Integrations\
**Created:** [April 12, 2022, 9:09am UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839 "2022-04-12T09:09:32Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [April 12, 2022, 9:09am UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/1 "2022-04-12T09:09:32Z")

</div>

Hello, my question concern more advanced users that want to make try than a final solution.  
I know it’s possible using the editor, but I want to edit the text file itslef.

I have found some explanations on the github, but don’t ask me why (I don’t use docker) but some users can’t succed, so if someone can explain shortly a way to do that why all command line,

Thx.

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [April 28, 2022, 6:35pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/2 "2022-04-28T18:35:42Z")

</div>

I have some return from discord from Filipko anf Mimixx

Ssh to the hassio on Raspberry. You need to use a ADDON or something for this  
Either `SSH & Web Terminal` or some similar plugin, or just `ssh root@{ip_address} -p 22222`

1. `docker container ls`
2. look for container id of the Deconz instance
3. `docker exec -it {id} /bin/bash`
4. Navigate to the folder `/usr/share/deCONZ/` for exemple using `cd /usr/share/deCONZ/devices/`

You will see inside others DDF

**Method updated here** [How to add/edit a DDF on Home assistant using text editor? - #18 by bcutter](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/18)?

---

<div class="post-metadata">

**Author:** ![StephanGR](https://forum.phoscon.de/user_avatar/forum.phoscon.de/stephangr/32/1950_2.png) [@StephanGR](https://forum.phoscon.de/u/StephanGR)\
**Post date:** [June 11, 2022, 2:57pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/3 "2022-06-11T14:57:26Z")

</div>

Hi,

I don’t have any Docker container running Deconz instance.

I have installed Deconz using the official plugin in HomeAssistant store.

I’m trying to acces filesystem of it but it’s quite not easy at all.

I just want to push a file in the FS

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [June 11, 2022, 4:18pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/4 "2022-06-11T16:18:05Z")

</div>

Hello, what is the result of the command (HA is docker based by defaut).  
`docker container ls`

---

<div class="post-metadata">

**Author:** ![StephanGR](https://forum.phoscon.de/user_avatar/forum.phoscon.de/stephangr/32/1950_2.png) [@StephanGR](https://forum.phoscon.de/u/StephanGR)\
**Post date:** [June 11, 2022, 7:57pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/5 "2022-06-11T19:57:40Z")

</div>

![image](https://forum.phoscon.de/uploads/default/original/2X/9/9703315ddb5c01604e98ce7a70817c55fa03a529.jpeg)

Got any results 😕

My HA is raspberry based

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [June 12, 2022, 7:07am UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/6 "2022-06-12T07:07:49Z")

</div>

From that I have read here [Hassos docker command not found - Configuration - Home Assistant Community](https://community.home-assistant.io/t/hassos-docker-command-not-found/81477)

> You need to be logged in as user hassio

> **[Debugging the Home Assistant Operating System | Home Assistant Developer Docs](https://developers.home-assistant.io/docs/operating-system/debugging/)**
>
> This section is not for end users. End users should use the \[SSH add-on\] to SSH into Home Assistant. This is for developers of Home Assistant. Do not ask for support if you are using these options.

Are you sure haven’t skipped this part ?

Either `SSH & Web Terminal` or some similar plugin, or just `ssh root@{ip_address} -p 22222`

---

<div class="post-metadata">

**Author:** ![isamaru](https://forum.phoscon.de/user_avatar/forum.phoscon.de/isamaru/32/1961_2.png) [@isamaru](https://forum.phoscon.de/u/isamaru)\
**Post date:** [June 12, 2022, 5:17pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/7 "2022-06-12T17:17:15Z")

</div>

I followed these steps to successfully enter the deconz container, and managed to find files in  
`/usr/share/deCONZ/devices/`

It took me a while to find a good way to upload changes to the .json files (the host filesystem is readonly). Finally I settled on: I checked them in into my github fork, then used `wget` from the container to download them from my github (using the raw files urls).  
The next problem is how to make the plugin accept the update? Restarting the add-on from home assistant is not the way to go: the container is recreated and any file changes are lost.

I tried restarting the container with `docker restart {id}`. According to logs the app really rebooted, but the “fix” I tried does not work. I do not know if it is because the changes weren’t registered or whether the fix is insufficient.

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [June 12, 2022, 5:38pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/8 "2022-06-12T17:38:47Z")

</div>

If I m right some user just use the cat command to create a file, perhaps this command is native on docker ?

`cat >file.json`

An other user, put the file on an external device and use

```auto
docker cp /mnt/data/supervisor/share/lixee_zlinky_historique_mono.json 26abed96b08c:/data/.local/share/dresden-elektronik/deCONZ/devices

```

To copy the file ( 26abed96b08c is the ID)

Another method to test (don’t forget the ')

```auto
touch file.json
printf 'file_contain'

```

---

<div class="post-metadata">

**Author:** ![bcutter](https://forum.phoscon.de/user_avatar/forum.phoscon.de/bcutter/32/599_2.png) [@bcutter](https://forum.phoscon.de/u/bcutter)\
**Post date:** [July 25, 2022, 5:25pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/9 "2022-07-25T17:25:46Z")

</div>

Any news on this?

**Someone EVER managed to permanently (survives addon updates or even addon restarts) store DDF file changes in the deCONZ addon in Home Assistant?**

Doing the same manual changes using horrible VNC interface after every addon restart is just… so annoying and not that smart ☹

---

<div class="post-metadata">

**Author:** ![Mimiix](https://forum.phoscon.de/user_avatar/forum.phoscon.de/mimiix/32/10_2.png) [@Mimiix](https://forum.phoscon.de/u/Mimiix)\
**Post date:** [July 25, 2022, 5:52pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/10 "2022-07-25T17:52:45Z")

</div>

Best to ask the HA addon developers. This is not maintained by this community or Dresden.

---

<div class="post-metadata">

**Author:** ![bcutter](https://forum.phoscon.de/user_avatar/forum.phoscon.de/bcutter/32/599_2.png) [@bcutter](https://forum.phoscon.de/u/bcutter)\
**Post date:** [July 25, 2022, 7:28pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/11 "2022-07-25T19:28:04Z")

</div>

I asked the community. Not very promising answer. Possible approach: store the DDF outside the deCONZ addon/container so it won’t be overwritten during updates or restarts.

But what you can answer for sure is:

1. How does deCONZ (or the appropriate devices) find its corresponding DDF files?
2. Based on the answer to that my second question would be if it would find a DDF outside the default storage (`/usr/share/deCONZ/devices/`) e. g. on a mount point?

So if I manage to create a mount point e. g.  
`/usr/share/deCONZ/devices/custom_ddf` which redirects to a permanent storage - only thing I need to do after updating (too when restarting?) is to recreate the mount point (and delete the original DDF so only one for the particular device can be found), right?

Is there potentially another way to make DDF file changes permanent? Next to adjusting the default shipped one of course (which naturally would be my favorite solution).

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [July 26, 2022, 2:37pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/12 "2022-07-26T14:37:31Z")

</div>

1 - it use the model id + the manufacture name.  
2- on a normal OS this is sure

> All DDF provided directly with deCONZ typically reside in `/usr/share/deCONZ/devices/` on a Linux system and are loaded first. However, files residing in the home directory of the user running deCONZ (e.g. `/home/<DECONZUSER>/.local/share/dresden-elektronik/deCONZ/devices`) will override the pre-packaged files to allow users to amend and keep their own files if desired.

So one folder is reseted at every new deconz version, the second one is persistent. Just need to use a folder outside the docker for this one.

Here you have a working mode for a normal docker [Update frequency Blitzwolf BW-SHP13 (TZ3000\_g5xawfcq) - #5 by jjansen85](https://forum.phoscon.de/t/update-frequency-blitzwolf-bw-shp13-tz3000-g5xawfcq/2195/5)

> Change the container mount point for your existing deCONZ volume from `/root/.local/share/dresden-elektronik/deCONZ` to `/opt/deCONZ`

If you have the method for HA, I m interested too …

---

<div class="post-metadata">

**Author:** ![bcutter](https://forum.phoscon.de/user_avatar/forum.phoscon.de/bcutter/32/599_2.png) [@bcutter](https://forum.phoscon.de/u/bcutter)\
**Post date:** [July 29, 2022, 10:46pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/13 "2022-07-29T22:46:47Z")

</div>

Changed the DDF using deCONZ (VNC), SSH to HA, login to deCONZ docker container, did a `cp /usr/share/deCONZ/devices/blitzwolf/bw_shp13_smart_plug.json /data/.local/share/dresden-elektronik/deCONZ/devices/bw_shp13_smart_plug_MyCustomConfig.json`.

Could not restart deCONZ yet (because of… productive reasons) to test if that storage is really persistent and the DDF stored in that location really overrides the default storage one.

**One last question for now is related to the DDF content.** I posted it [in this other topic](https://forum.phoscon.de/t/update-frequency-blitzwolf-bw-shp13-tz3000-g5xawfcq/2195/16) even it is a generic one, independently of specific devices. If that `path` line thing is sorted out I’ll try to restart the deCONZ Home Assistant addon asap and turn back with the results.

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [July 30, 2022, 10:34am UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/14 "2022-07-30T10:34:32Z")

</div>

With your command you have copied the `bw_shp13_smart_plug.json` on a new path and rename it `bw_shp13_smart_plug_MyCustomConfig.json`.  
The first folder is the deconz one (updated a every deconz update), the second one is the user one (not impacted by deconz update).  
But have you set a mount or all folders are still “docker folder”, remember dockers are not persistant, all stuff present on docker image are virtual.

---

<div class="post-metadata">

**Author:** ![bcutter](https://forum.phoscon.de/user_avatar/forum.phoscon.de/bcutter/32/599_2.png) [@bcutter](https://forum.phoscon.de/u/bcutter)\
**Post date:** [July 30, 2022, 5:43pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/15 "2022-07-30T17:43:18Z")

</div>

Thanks for describing what I did.

> [@Smanar](#):
>
> But have you set a mount or all folders are still “docker folder”, remember dockers are not persistant, all stuff present on docker image are virtual.

No, for the moment I did not play with mount points. In the `/data` path I found more data (like the VNC config or VNC session logs or bash history) where some of them date back months ago. No evidence, but indicators that storage is persistent, meaning it survives updates and restarts. Proof will follow once I can restart deCONZ addon.

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [July 31, 2022, 7:36am UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/16 "2022-07-31T07:36:18Z")

</div>

For me they will survive to a deconz restart, but not sure for a docker update/restart.  
And you want to edit the file ? because I don’t understand why you just make a copy ?

---

<div class="post-metadata">

**Author:** ![bcutter](https://forum.phoscon.de/user_avatar/forum.phoscon.de/bcutter/32/599_2.png) [@bcutter](https://forum.phoscon.de/u/bcutter)\
**Post date:** [August 1, 2022, 12:41pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/17 "2022-08-01T12:41:42Z")

</div>

Of course I edited the original file before in the DDF editor. This way I can double test addon restarts. Expected outcome:

1. Original file will be overwritten, content set back to default
2. Custom file will still exist and stay untouched (persistent)

Surviving an dddon restart would already be very good. Addon update is a manual process (no HA addon auto updates) and making that change (maybe by a one-liner CLI command) again after every update would only be one additional step on my update check list.

---

<div class="post-metadata">

**Author:** ![bcutter](https://forum.phoscon.de/user_avatar/forum.phoscon.de/bcutter/32/599_2.png) [@bcutter](https://forum.phoscon.de/u/bcutter)\
**Post date:** [August 6, 2022, 4:40pm UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/18 "2022-08-06T16:40:36Z")

</div>

Assumptions confirmed after doing a HA deCONZ addon restart:

1. Original file (`/usr/share/deCONZ/devices/blitzwolf/bw_shp13_smart_plug.json`) is overwritten/reset to default ✅
2. Custom file (`/data/.local/share/dresden-elektronik/deCONZ/devices/bw_shp13_smart_plug_MyCustomConfig.json`) still exists and is untouched (timestamp unchanged) ✅

Additional confirmation:

1. Selecting “Edit DDF” in deCONZ VNC GUI (right click) opens **my custom config DDF file**. ✅
2. Changes applied in custom config are (still/again) active (update interval is roughly 1 minute instead of default 5 to 8 minutes) ✅

Therefore I’m fine for the moment, will test/check if all this behaves the same when updating the deCONZ addon.

Another final information regarding the initial question (how to edit a DDF on Home Assistant):

1. Login via SSH to HA
2. Login deCONZ docker container: `docker exec -it addon_core_deconz bash`
3. Install a text editor e. g. nano for editing files on the CLI: `apt update; apt install nano` (note: this will be undone once the container is restarted or updated)
4. Edit your DDF file with e. g. `nano /usr/share/deCONZ/devices/blitzwolf/bw_shp13_smart_plug.json`
5. Don’t forget to “hot reload” the DDF changes using deCONZ (VNC GUI)

See also [Permanent changes in deCONZ addon/container (survive restart / update) - Home Assistant OS - Home Assistant Community](https://community.home-assistant.io/t/permanent-changes-in-deconz-addon-container-survive-restart-update/443754/) with a lot of additional/detailed information.

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [August 7, 2022, 8:39am UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/19 "2022-08-07T08:39:47Z")

</div>

And you are using the basic configuration (not the external docker config), without mount ?  
So it mean if you update the deconz plugin, you loose all your custom files ?

---

<div class="post-metadata">

**Author:** ![Smanar](https://forum.phoscon.de/user_avatar/forum.phoscon.de/smanar/32/60_2.png) [@Smanar](https://forum.phoscon.de/u/Smanar)\
**Post date:** [September 27, 2022, 10:00am UTC](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839/20 "2022-09-27T10:00:08Z")

</div>

Hello.

Deconz use 2 folders, one reserved to it, updated at every deconz update, and one for the user, untouched.

Someone know where to find the “user” one ?

We are trying with

 ![IMG-20220918-WA0010](https://forum.phoscon.de/uploads/default/original/2X/b/b84719efc977f7a738967cb5958c2e3136831a1f.jpeg)

But this folder is not persistant.

I know how to find it on docker but on the “HA docker” …

Edit:  
Ok so the folder is `/.local/share/dresden-elektronik/deCONZ/devices` in `root@core-deconz` but no persistent.

It seem the only persistent folder created by HA is the “data” folder, but there is inside only options.json and the folder “OTAU”

Edit:

Ok so I have my answer from WhoTheHeck  
The persistent path is `/data/.local/share/dresden-elektronik/deCONZ/devices/`  
The path is not visible but working.

[Next page](https://forum.phoscon.de/t/how-to-add-edit-a-ddf-on-home-assistant-using-text-editor/1839.md?page=2)
