activate/deactivate script  [Solved]

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
Knibor
Posts: 112
Joined: Sunday 20 May 2018 12:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: NL
Contact:

activate/deactivate script

Post by Knibor »

Hi

Because I have a lot of scripts, my Rasp pi is slow, but sometimes I do not need some scripts.
Is there a way to activate/deactive a script with a virtual Switch?

Thanks
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: activate/deactivate script

Post by AllesVanZelf »

If you created these scripts in Domoticz - settings - more options - events, you can switch them on and off.
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: activate/deactivate script

Post by waaren »

Knibor wrote: Wednesday 27 November 2019 10:52 Hi

Because I have a lot of scripts, my Rasp pi is slow, but sometimes I do not need some scripts.
Is there a way to activate/deactive a script with a virtual Switch?

Thanks
I too have a lot of scripts but they only account for a fraction of the CPU usage of my systems. Why do you think the response time degradation is caused by your scripts ?

in dzVents you can use a function in the active = section to control if / when a script is active.

I use this for another reason (Only active in the first 3 minutes after a domoticz start) but I trust you get the idea

Code: Select all

 active = function(domoticz)
                return domoticz.startTime.secondsAgo < 180
            end,
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Knibor
Posts: 112
Joined: Sunday 20 May 2018 12:56
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: NL
Contact:

Re: activate/deactivate script  [Solved]

Post by Knibor »

Hello, thanks for the response.
Domoticz memory is over 90MB. Because of this Domoticz became very slow and sometimes got stuck, so I had to reset DM. The reason was that I accidentally set the trigger format wrong for a Lua script, causing DM memory to run from 70MB to over 90MB. The problem is solved for the time being. Only I have to look again at how to get DM memory further down. Any suggestions?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: activate/deactivate script

Post by waaren »

Knibor wrote: Thursday 28 November 2019 23:20 Hello, thanks for the response.
Domoticz memory is over 90MB. Because of this Domoticz became very slow and sometimes got stuck, so I had to reset DM. The reason was that I accidentally set the trigger format wrong for a Lua script, causing DM memory to run from 70MB to over 90MB. The problem is solved for the time being. Only I have to look again at how to get DM memory further down. Any suggestions?
There seem to be a memory leak of some kind in recent beta's, It is being investigated what is causing it. Until it is fixed I suggest you look at your memory every once in a while and restart domoticz when you see domoticz repsonsetimes are getting very high.

btw. 90 Mb is not extreme; I did see > 200 MB on my PI-3 for domoticz without any performance issue.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest