Page 1 of 1

Please help this noob! :D

Posted: Tuesday 14 May 2019 10:35
by OedzesG
Hallo everyone!

Sinds 2 weeks i install Domoticz and love it!
Now everything is connected, its time to make my first automation script.

Becouse i dont like blocky, i would love te use DzVents, but i think i only have some problems with understanding it :lol:

What i would like to do, is change the lights when my PLEX server starts to play.
So i usdes an PLEX script to send the data to my Domoticz en ceated some user-variables. this works perfect:

-1: Plex-server offline
0: Client inactief
1: video afspelen
2: gepauzeerde video
3: gestopt video
11: Audio afspelen
12: Onderbroken audio
13: gestopt audio
21: Foto weergeven
22: Onderbroken diavoorstelling
Uservariable.JPG
Uservariable.JPG (47.74 KiB) Viewed 604 times

Now i created a small script in DzVents:
Dzventz.JPG
Dzventz.JPG (40.54 KiB) Viewed 604 times
There are no errors at all! but script is not working.

Please help me understanding DzVents.

Thxx in advance!!!

Re: Please help this noob! :D

Posted: Tuesday 14 May 2019 10:52
by freijn
perhaps start with some logging to see if the script is being hit?


logging = true

bla
bla
bla

if (logging) then print("script is Triggered " ) end

Re: Please help this noob! :D

Posted: Tuesday 14 May 2019 11:00
by OedzesG
Thx for quick response!

Nothing happend in the log files:
LOG.JPG
LOG.JPG (14.04 KiB) Viewed 593 times
So i thought maybe Dzvents is not working, but with the test script from WIKI:
works.JPG
works.JPG (34.44 KiB) Viewed 593 times

Re: Please help this noob! :D

Posted: Tuesday 14 May 2019 11:12
by waaren
How do you update the variable ?
You defined the variable as integer but you check if IT is equal to a string.
Please tag your code with code tags, makes it much easier to check.


Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk


Re: Please help this noob! :D

Posted: Tuesday 14 May 2019 11:33
by OedzesG
The variable is updated by Python script, bases on evenements happend in plex.
When i check this script with my uservariable is this correct.

But somehow i think that DzVents is not recognize: variables = {'PLEX STATUS [Chrome]'}

Re: Please help this noob! :D

Posted: Tuesday 14 May 2019 11:41
by freijn
From: https://www.domoticz.com/wiki/DzVents:_ ... 7B_..._.7D

Code: Select all

variables = { ... }

A list of one or more user variable-names as defined in Domoticz ( Setup > More options > User variables). If any of the variables listed here changes, the script is executed. 
So ... is your variable defined there ?

Re: Please help this noob! :D

Posted: Tuesday 14 May 2019 11:53
by OedzesG
Correct, thats why i write my script this way.
But somehow its not working, and it seems like this script is not hit.

Re: Please help this noob! :D

Posted: Tuesday 14 May 2019 11:55
by waaren
And what happens if you update the variable manually?

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk


Re: Please help this noob! :D

Posted: Tuesday 14 May 2019 12:31
by OedzesG
Thnx!! that worked...
test.JPG
test.JPG (33.16 KiB) Viewed 568 times
So it must be something in the script: Plex.py.

Ik wil search there!! thnx again!

Re: Please help this noob! :D

Posted: Tuesday 14 May 2019 14:47
by waaren
OedzesG wrote: Tuesday 14 May 2019 12:31 So it must be something in the script: Plex.py.
Specific for this reason the dzVents method to update variables added an extra call to the eventSystem to trigger an event as the domoticz standard update way does not do this.

And please don't use jpg for displaying code or logs here. Use code tags