DOMOTICZ cannot save scripts

Domoticz cannot save the scripts.
I get the following error in domotic logs when I want to save a script :
2021-02-07 00:05:41.023 Error: EventSystem: problem writing file: /mnt/dietpi_userdata/domoticz/scripts/dzVents/generated_scripts/Script #1.lua

My version is: DietPi v6.34.3 : 00:03 - Sun 02/07/21
I have only installed domoticz in dieptpi

Hi,

probably file system structure is missing. You could try following

mkdir -p /mnt/dietpi_userdata/domoticz/scripts/dzVents/generated_scripts/
chown -R domoticz:domoticz /mnt/dietpi_userdata/domoticz/scripts/

Thanks for your answer
Now the scripts are saved, but more errors appear

looks like your system is searching for some JSON file in all kind of directories. Did you specified it somewhere?

In the installation of domotics in raspibian you do not have to specify anything about Json.

When domoticz is installed in raspibian, when starting to create a script, a template appears.




When I start to create a script in Dietpi Domoticz, it appears blank, that is another problem

ok I had a closer look regarding the missing templates. It seems the templates are expected on userdata_path directory and this is specified as /mnt/dietpi_userdata/domoticz.

This as well explains why you where not able to store the script at the beginning. It’s quite simple to fix

cp -p -r /opt/domoticz/scripts /mnt/dietpi_userdata/domoticz/

Now you should get templates if you create a new event

Now it works, thanks a lot for the help
I will keep testing!

did you faced the JSON issue again? I have seen it once on my test system but I did not find out what the trigger was. It is probably related to Perl. Maybe it is required, but not installed in DietPi by default.

No problem with Json
Everything I’ve tried so far works fine.

cp -p -r /opt/domoticz/scripts /mnt/dietpi_userdata/domoticz/ is the solution.

Thanks!

ok I opened PR to have it added by default https://github.com/MichaIng/DietPi/pull/4096