Script on DOMOTICZ for WINDOWS

Moderator: leecollings

Post Reply
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Script on DOMOTICZ for WINDOWS

Post by forumfab »

Sorry to re-open this discussion

Is there someone that can explain how, what are the limitation, and so on to use script .bat on DOMOTICZ under windows

It's seems that the syntax is "script//DOMOTICZ/scripts/yourscript.bat "

But in fact that does'nt works , i means that it seems that the famous "yourscript.bat", couldn't be place outside the limitation of the DOMOTICZ application itselve

The DOMOTICZ application is place in

c:\Programmes\Domoticz folder which seems to be the "root" for the domoticz application, that why the script are in c:\Programmes\Domoticz\scripts\ folder, and taht the syntax is script//DOMOTICZ/scripts/yourscript.bat "

So if "yourscript.bat, is for exemple

c:\copy file1.txt to file2.txt

This .bat willn't works

Is that correct, is that wrong,

Where must be the .bat, and want can and can't contain the .bat

The problem of the right and path don't appear to be very clear in fact

Thanks in advance
User avatar
Domosapiens
Posts: 232
Joined: Wednesday 20 August 2014 12:08
Target OS: Windows
Domoticz version: V3.5981
Location: NL
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by Domosapiens »

Take a look at the Wiki:

Batch Scripts (MSWindows)
http://www.domoticz.com/wiki/Scripts#Ba ... Windows.29

script://Domoticz\scripts\soundplay.bat

and look out for
\
and not
/
Any place on the same disk as Domoticz will work.

Hope this helps
Domosapiens
Win Vista&7; 1#Aeon Z-Stick S2; 1#Aeotec Z-Sick Gen5, 6#Fib.FGBS001; 24#DS18B20; 8#Everspr.AN158-2; 3#Philio PAN04; 1#Philio PAN06, 1#YouLess El; 1#Fib.FGWPE; 1#ZME_RC2; 2#FAK_ZWS230, 2#Quib.ZMNHCDx, 1#Quib.ZMNHDD1, 7#EM6555
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by forumfab »

Thanks Domosapiens for your answer and your help

That don't works

Here is my scripts for the on function


script://Domoticz\scripts\voix1.bat

The script voix1.bat works when i launch it inside the DOS console from the c:\Program Files\Domoticz\scripts\ folder

The script is simple

c:\rundevant.exe

The program "rundevant.exe" of course fully works

There must be something faulty with the script inside DOMOTICZ for windows

The script can't be more simple, the program more simple
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by forumfab »

Does anyone know if domoticz on windows need spécial right to execute a script
Does domoticz for windows need some kind of right like if it was a special user for windows
User avatar
Domosapiens
Posts: 232
Joined: Wednesday 20 August 2014 12:08
Target OS: Windows
Domoticz version: V3.5981
Location: NL
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by Domosapiens »

Strange ...
script://Domoticz\scripts\soundplay.bat
works on my Vista PC

????sapiens
Win Vista&7; 1#Aeon Z-Stick S2; 1#Aeotec Z-Sick Gen5, 6#Fib.FGBS001; 24#DS18B20; 8#Everspr.AN158-2; 3#Philio PAN04; 1#Philio PAN06, 1#YouLess El; 1#Fib.FGWPE; 1#ZME_RC2; 2#FAK_ZWS230, 2#Quib.ZMNHCDx, 1#Quib.ZMNHDD1, 7#EM6555
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by forumfab »

Hi,

Same problem with all the windows os

I did try on 3 différents computer and OS, Windows XP, VISTA, WINDOWS 8

Impossible to run script .bat on DOMOTICZ

This problem seems to have never been solve

Regards
mrf68

Re: Script on DOMOTICZ for WINDOWS

Post by mrf68 »

In my LUA scripts I run .cmd files:

if .....
then os.execute ("C:\\PS\\somescript.cmd")

I have to use double backslashes. It's on Windows 7 Enterprise. In the cmd file I run a powershell script that sends messages via Pushover. And this works for me.
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by forumfab »

Hi mrf68,

Idem with .cmd
Idem with or without double backslashes

Idem on 3 différents os, on 3 différents computers , XP, VISTA, WINDOW 8

the script .cmd is working is the dos console, but not inside the script


regards
sijones
Posts: 70
Joined: Wednesday 15 October 2014 14:16
Target OS: Linux
Domoticz version: Git
Location: UK
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by sijones »

I take it your running domoticz as a service on windows?

Does your program you're trying to run have gui interface? If it does then you will need to go to the properties of the domoticz service and tick allow interaction with desktop otherwise the program can not display as it's running under the system user and won't have display permissions.
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by forumfab »

Hi sijones,

I did re-install Domoticz for windows on one pc under windows 8, with this option.

For the moment that don't change anything, but i'll will try more ahead tomorow with this option

Thanks for your help

Regards
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by forumfab »

Hi sijones,

This doesn't works !

There must be a problem of initial pointing

It's seems that Domoticz for windows doesn't know wher is the basic position od the "scripts" folder

When we use "Domoticz\scripts\myscript.cmd

It's assume that this will correspond to

"c:\program files\Domoticz\scripts\myscript.cmd"

And it's seems to be wrong

It's crazy to use some kind of speudo LINUX referencies on Windows

Why not to let use the normal Windows referencies like

script://c:\program files\Domoticz\scripts\myscript.cmd

it's not normal that there is so much demand for this problem od scripting on domoticz for windows, without a clear information from the Domoitcz conceptors ....!
proncola
Posts: 2
Joined: Monday 16 November 2015 0:50
Target OS: Windows
Domoticz version:
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by proncola »

For windows scripts, I discovered that the scripts have to be under the following directory (given my install under c: drive):
"ProgramData\Domoticz"
and not
"Program Files\Domoticz"
Then, 'Action On' should contain something like:
script://yourPythonScript.py

I haven't tested Windows batch files.

Pascal
forumfab
Posts: 68
Joined: Monday 25 August 2014 21:40
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Script on DOMOTICZ for WINDOWS

Post by forumfab »

proncola wrote:For windows scripts, I discovered that the scripts have to be under the following directory (given my install under c: drive):
"ProgramData\Domoticz"
and not
"Program Files\Domoticz"
Then, 'Action On' should contain something like:
script://yourPythonScript.py

I haven't tested Windows batch files.

Pascal
Hi proncola,

Thank for this answer !

This doesn't works for me i am on an XP windows

Bests regards
SweetPants

Re: Script on DOMOTICZ for WINDOWS

Post by SweetPants »

Try script:///<your script>
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests