As asked in viewtopic.php?f=23&t=9489 it would be really nice to be able to run system scripts (bash, python, whatever) from Blocky.
LUA is nice, but putting a sleep in LUA will cause it to run multiple times sequential, which really is a killer for scripts.
A Blocky option 'execute $script after $time' would be a great addition to the Domoticz OS in my opinion.
Cheers.
[667] Ability to execute script:/// from Blocky
Moderators: leecollings, remb0
-
- Posts: 26
- Joined: Wednesday 04 November 2015 10:26
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
[667] Ability to execute script:/// from Blocky
tracker.php?p=2&t=667
-
- Posts: 53
- Joined: Thursday 06 March 2014 18:30
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [667] Ability to execute script:/// from Blocky
+10
Absolute a good idea.
Absolute a good idea.
-
- Posts: 5
- Joined: Tuesday 19 July 2016 8:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [667] Ability to execute script:/// from Blocky
+10
This is indeed a very good suggestion. I have been using Domoticz only for one week and it's exactly what I need.
This is indeed a very good suggestion. I have been using Domoticz only for one week and it's exactly what I need.
-
- Posts: 81
- Joined: Tuesday 03 November 2015 5:07
- Target OS: Linux
- Domoticz version: beta
- Contact:
Re: [667] Ability to execute script:/// from Blocky
You could call a script from a dummy switch and then call that switch from blocky.
Last edited by raym on Thursday 28 July 2016 4:54, edited 1 time in total.
- gizmocuz
- Posts: 2350
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: [667] Ability to execute script:/// from Blocky
Implemented in beta #5437
if you enter an IDX in between {{ and }} , from for example a temperature sensor, it is replaced with the value of this sensor
Hope all is working well....
if you enter an IDX in between {{ and }} , from for example a temperature sensor, it is replaced with the value of this sensor
Hope all is working well....
Quality outlives Quantity!
-
- Posts: 59
- Joined: Sunday 14 June 2015 13:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: stable
- Location: Netherlands
- Contact:
Re: [667] Ability to execute script:/// from Blocky
Sounds good! I will try this tonight. Thanks
- gizmocuz
- Posts: 2350
- Joined: Thursday 11 July 2013 18:59
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: Top of the world
- Contact:
Re: [667] Ability to execute script:/// from Blocky
Forgot to mention... you can find it under the 'messages' section... not sure if it is the logical place, but as open_url was also in here....
Quality outlives Quantity!
-
- Posts: 59
- Joined: Sunday 14 June 2015 13:22
- Target OS: Raspberry Pi / ODroid
- Domoticz version: stable
- Location: Netherlands
- Contact:
Re: [667] Ability to execute script:/// from Blocky
I'm unable to update to the latest beta version. After 2% it says error internet connection.
-
- Posts: 9
- Joined: Tuesday 28 June 2016 17:22
- Target OS: Windows
- Domoticz version:
- Location: Huddersfield, UK
- Contact:
Re: [667] Ability to execute script:/// from Blocky
Works great for me. I'm triggering batch files to run in Windows directly from blockly now rather than having to run them from switches. Really useful functionality, thanks!
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk
-
- Posts: 5
- Joined: Tuesday 19 July 2016 8:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [667] Ability to execute script:/// from Blocky
Great! Now I will move from stable to latest greatest
-
- Posts: 2
- Joined: Wednesday 17 August 2016 12:17
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [667] Ability to execute script:/// from Blocky
I cant seem to run a script within blockly. I get error 32512.
The script works fine when run fron putty or with a switch that calls the script.
Any ideas?
The script works fine when run fron putty or with a switch that calls the script.
Any ideas?
-
- Posts: 9
- Joined: Tuesday 28 June 2016 17:22
- Target OS: Windows
- Domoticz version:
- Location: Huddersfield, UK
- Contact:
Re: [667] Ability to execute script:/// from Blocky
My scripts run batch files (on Windows) which are contained in the 'domoticz' folder and therefore do not need a path specifying. (i.e. just 'tv-on.bat with no / or \ required.) Maybe the problem is when you specify a path in blockly? Try moving a file into your domoticz root folder and executing it as I do. Could be a bug in blockly.
Sent from my iPhone using Tapatalk
Sent from my iPhone using Tapatalk
-
- Posts: 2
- Joined: Wednesday 17 August 2016 12:17
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: [667] Ability to execute script:/// from Blocky
Cant get it to work
- heggink
- Posts: 972
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: [667] Ability to execute script:/// from Blocky
I noticed that in some cases, starting a script without any parameters results in an error as follows:
Error executing script command (/home/pi/domoticz/scripts/say_ad.sh#). returned: 32512
If I add a space after the script's name then the # is still there but taken as the first parameter of the script (where my script doesn't use any so it works as a workaround).
Anyone else seen this? Obviously only applies to linux( /raspbian).
H
Error executing script command (/home/pi/domoticz/scripts/say_ad.sh#). returned: 32512
If I add a space after the script's name then the # is still there but taken as the first parameter of the script (where my script doesn't use any so it works as a workaround).
Anyone else seen this? Obviously only applies to linux( /raspbian).
H
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 39
- Joined: Thursday 08 December 2016 20:50
- Target OS: Linux
- Domoticz version:
- Contact:
Re: [667] Ability to execute script:/// from Blocky
I see the exact same - I'll try the workaround and report back.... Thanks...
(I'm on x86_64 Ubuntu 16.04)
(I'm on x86_64 Ubuntu 16.04)
-
- Posts: 39
- Joined: Thursday 08 December 2016 20:50
- Target OS: Linux
- Domoticz version:
- Contact:
Re: [667] Ability to execute script:/// from Blocky
The space workaround works - but why is there a tailing '#' when the script is called?
-
- Posts: 11
- Joined: Monday 09 January 2017 9:42
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 2020.2
- Location: Swolgen
- Contact:
Re: [667] Ability to execute script:/// from Blocky
Works great with me. Thanks a lot for this improvement. A few notes:
When Domoticz is running on a Raspberry Pi and you place the bash script in a seperate folder (e.g. /home/pi/domoticz/scripts/bash) then, next to making the script executable with CHMOD 755 you also have to add the folder to your $PATH. You can do this by adding this code to your .profile file and reboot. Use the full directory name as mentioned above.
You will find the .profile file in the /home/pi directory as a hidden file. Add the code at the bottom of the file.
I use this to set Milight bulbs to nightlight at sunset. This is the bash code:
and this the Blockly code:
at sunrise they go out again with:
and this:
When Domoticz is running on a Raspberry Pi and you place the bash script in a seperate folder (e.g. /home/pi/domoticz/scripts/bash) then, next to making the script executable with CHMOD 755 you also have to add the folder to your $PATH. You can do this by adding this code to your .profile file and reboot. Use the full directory name as mentioned above.
Code: Select all
export PATH=$PATH:directory name
I use this to set Milight bulbs to nightlight at sunset. This is the bash code:
Code: Select all
#!/bin/bash
echo -n -e "\x33\x00" | nc -u -q 1 192.168.2.25 8899 # set zone 2 OFF
echo -n -e "\x3A\x00" | nc -u -q 1 192.168.2.25 8899 # set zone 3 OFF
echo -n -e "\x36\x00" | nc -u -q 1 192.168.2.25 8899 # set zone 4 OFF
sleep 1
echo -n -e "\xB3\x00" | nc -u -q 1 192.168.2.25 8899 # set zone 2 NightLight
echo -n -e "\xBA\x00" | nc -u -q 1 192.168.2.25 8899 # set zone 3 NightLight
echo -n -e "\xB6\x00" | nc -u -q 1 192.168.2.25 8899 # set zone 4 NightLight
Code: Select all
#!/bin/bash
echo -n -e "\x33\x00" | nc -u -q 1 192.168.2.25 8899 # set zone 2 OFF
echo -n -e "\x3A\x00" | nc -u -q 1 192.168.2.25 8899 # set zone 3 OFF
echo -n -e "\x36\x00" | nc -u -q 1 192.168.2.25 8899 # set zone 4 OFF
Sjoerd van Staveren
Domoticz running on a Raspberry Pi 3; Milight RGBW and Dual White bulbs; RFXcom XL;HOMEeasy switch; Flamingo switches; Sonoff switches
Domoticz running on a Raspberry Pi 3; Milight RGBW and Dual White bulbs; RFXcom XL;HOMEeasy switch; Flamingo switches; Sonoff switches
-
- Posts: 2
- Joined: Thursday 22 February 2018 8:47
- Target OS: Windows
- Domoticz version:
- Contact:
Run local batch file Windows
Hi I have Windows 10
have tried a bunch of different syntax - log says
2018-02-22 18:37:13.940 Executing script: 'C:\_\done.bat '#
But it never fires the batch file
help please
have tried a bunch of different syntax - log says
2018-02-22 18:37:13.940 Executing script: 'C:\_\done.bat '#
But it never fires the batch file
help please
Who is online
Users browsing this forum: No registered users and 1 guest