Execute bash from Blocky

Moderator: leecollings

Post Reply
void
Posts: 26
Joined: Wednesday 04 November 2015 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Execute bash from Blocky

Post by void »

Hi,
TL;DR
I've created several LUA scripts which execute bash scripts on their turn.
It works pretty nice, but I can't add a 'wait' or 'sleep' in it without Domoticz complaining about it.
2015-12-20 21:37:06.709 Error: EventSystem: Warning!, lua script /home/pi/domoticz/scripts/lua/script_device_TG_on_Alarm-Door.lua has been running for more than 10 seconds
I need the sleep for timing issues I can't seem to fix.

Blocky allows '<action> after <seconds>' which would solve my issue.
However, I can't seem to find how to start a bash script from Blocky events.

Full
I use bash scripts to make snapshots from my stream-only webcam with ffmpeg, and curl for posting the created snapshot via my Telegram bot to me.
My phone presence script runs as a script_device AND as script_time in the hope it would detect my presence soon enough.
However, it happens quite regular that my presence is detected when I'm 20 to 40 seconds in my house.
This would trigger an 'alarm' (being the snapshot and TG message) since my phone sets the security panel to disarm.
void
Posts: 26
Joined: Wednesday 04 November 2015 10:26
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Execute bash from Blocky

Post by void »

Really? Nobody ever encountered such issues?
jin
Posts: 62
Joined: Thursday 18 September 2014 20:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Execute bash from Blocky

Post by jin »

+1 for me!

I really need that feature implemented :)

With kind regards
jannl
Posts: 625
Joined: Thursday 02 October 2014 6:36
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2
Location: Geleen
Contact:

Re: Execute bash from Blocky

Post by jannl »

When you presence script runs as a shell/perl/python script you do not have that issues. Lua is intended do only run short.
Pisellon1
Posts: 14
Joined: Tuesday 09 February 2016 12:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Execute bash from Blocky

Post by Pisellon1 »

I really need this feature too!! Thank for help!
oopee
Posts: 40
Joined: Monday 12 August 2013 11:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.x
Location: Finland
Contact:

Re: Execute bash from Blocky

Post by oopee »

I personally hate to make virtual switches for every issue like this but, again, it's easy work-around.
jin
Posts: 62
Joined: Thursday 18 September 2014 20:28
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Execute bash from Blocky

Post by jin »

Yes I definitively aggree, it's easy "workaround" :)
But creating many and many virtual switch add un-necessary complexity :)

This feature implemented will add an easy, fast and clean way to execute script based on events.

with kind regards
Pisellon1
Posts: 14
Joined: Tuesday 09 February 2016 12:10
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Execute bash from Blocky

Post by Pisellon1 »

Jin got the point.
Hope this feature should be considered in future by developers!

Thank you!
xinhood
Posts: 4
Joined: Tuesday 26 January 2016 20:19
Target OS: NAS (Synology & others)
Domoticz version:
Location: The Netherlands
Contact:

Re: Execute bash from Blocky

Post by xinhood »

The "After 30 seconds" feature in blocky is for things that, when done from LUA, would be put in the commandarray. In LUA you can put strings like "On AFTER 30" in the commandarray. But in the commandarray you cannot put bash script execution as far as I know. So I think it would not be trivial to implement this feature in blocky the same way as the other "After x" functions.

Maybe it's possible to implement bash scripts as a device in Domoticz. Then you could activate it trough the commandarray and it would automaticly work with the existing blocky featureset I guess.
User avatar
gizmocuz
Posts: 2352
Joined: Thursday 11 July 2013 18:59
Target OS: Raspberry Pi / ODroid
Domoticz version: beta
Location: Top of the world
Contact:

Re: Execute bash from Blocky

Post by gizmocuz »

Quality outlives Quantity!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest