Page 1 of 1
How to call scripts created in internal Ace Editor
Posted: Wednesday 02 November 2016 12:21
by bertbigb
Hello,
I hope someone can help me. I'm using the internal Domoticz Ace Editor to create my scripts.
As far as I could find out these scripts are stored in the database. So far so good.
At Switches, Groups and Scenes you can couple script actions.
I create my scripts with:

- Ace editor.png (99.2 KiB) Viewed 2270 times
My question is how I can call these scripts because I do not know what to enter at:

- script call.png (17.68 KiB) Viewed 2270 times
I tried to put in the name but that doesn't work.
help would be appreciated
Re: How to call scripts created in internal Ace Editor
Posted: Wednesday 02 November 2016 14:10
by deennoo
First off all :
Change choice under LUA for device and record.
You made a device script.
He will run each time your switch who is call "Hue Test" will turn ON
Re: How to call scripts created in internal Ace Editor
Posted: Wednesday 02 November 2016 20:41
by bertbigb
Hi Deennoo,
Thanks for your answer.
I put you on the wrong leg. The script is just an example to show in which editor I make my scripts in.
I would like to know how i can call such a created script.
Do you know how to do this?
So lets assume I make a script and I call it bert in the editor
Then i would like that that script runs when I activate a scene
I doesn't work when I then call On Action: script://bert
I hope you or someone else know the answer.
Re: How to call scripts created in internal Ace Editor
Posted: Wednesday 02 November 2016 21:10
by Egregius
If you specify it as device script it'll run on every device update.
Re: How to call scripts created in internal Ace Editor
Posted: Thursday 03 November 2016 10:51
by bertbigb
Everyone thanks for the answers. Probably my question is not clear enough.
From a Group or Scene you can call a script for a On or Off action. There you have to fill in the path to the script.
When you use the script editor within domoticz the script is stored into the database.
The question is how you can call a script which is in the database for the On or Off action within a Group or Scene?

- script call.png (17.68 KiB) Viewed 2218 times
I hope I have made myself more clear with the above.
Re: How to call scripts created in internal Ace Editor
Posted: Wednesday 23 November 2016 19:50
by dutchdevil83
script://script_device_HUE-LAMP.lua
Re: How to call scripts created in internal Ace Editor
Posted: Tuesday 21 March 2017 19:20
by simonrg
bertbigb wrote:Everyone thanks for the answers. Probably my question is not clear enough.
From a Group or Scene you can call a script for a On or Off action. There you have to fill in the path to the script.
When you use the script editor within domoticz the script is stored into the database.
The question is how you can call a script which is in the database for the On or Off action within a Group or Scene?
script call.png
I hope I have made myself more clear with the above.
You can't access the scripts within the database using the On / Off parameters for a Group, these expect either a path to a file or a web path.
I think the best way to do what you want is to include a dummy on/off device in your Group (scenes can only be turned on / not off, groups can be turned on and off).
Then create a script which activates when the device is changed by the group being turned on or off, just ignore the On / Off actions in the Group / Scene settings.
So device called "Scene Dummy" then create a device script:
Code: Select all
commandArray = {}
if devicechanged["Scene Dummy"] == 'On' then
-- place your on code here
else
-- place your off code here
end
return commandArray
Re: How to call scripts created in internal Ace Editor
Posted: Tuesday 21 March 2017 22:55
by bertbigb
Thanks for your answers. It helps me further!