Page 1 of 1
Python and Blockly Problems
Posted: Sunday 16 April 2017 14:10
by daconas
Hello i am new her i use domoticz first on my NAS and now on a Raspberry.
a long time works perfect then i integrate motion and door snsors and try to combine somy events.
Now Domoticz dont work fine first i get problems and then can not connect to domoticz pi is running stable restart nothing helps
i try it on a new card and it works again but the events only with problems
example when device A is triggered turn on device B for 1 Minute that works fine
but with sunrise works some time or ca. 5 sec later not on time
i try many hours and i giv up
i take a new card install jessie lite new pyton2.7 and i start new add rfxcom and take some devices now i have a switch with on/off and only on
is sending when i take push off i can turn off
is the problem python or what is wrong now
i can not use domoticz now
please help me
Re: Python and Blockly Problems
Posted: Sunday 16 April 2017 15:23
by SweetPants
daconas wrote:Hello i am new her i use domoticz first on my NAS and now on a Raspberry.
a long time works perfect then i integrate motion and door snsors and try to combine somy events.
Now Domoticz dont work fine first i get problems and then can not connect to domoticz pi is running stable restart nothing helps
i try it on a new card and it works again but the events only with problems
Well you gave the answer yourself. It started after adding events, so disable all your evens and try adding them one-by-one and see where it gets unstable.
Re: Python and Blockly Problems
Posted: Monday 17 April 2017 12:57
by daconas
some events work fine for some weeks there is no problem
now i know the problem is the time
i dont know why
when i try with time or sunset it turn on every minute without error in the protokoll-
how can i turn on a lam with trigger in a specific between a time
i found many examples an i try it but the lamp goes automatic on every minute ( alsow when the trigger is off)
i try many houres i am on the end.
Re: Python and Blockly Problems
Posted: Monday 17 April 2017 13:36
by SweetPants
I'm not familiar with Blocky, but, assuming the script is run as a 'time' script, It does exactly what you programmed in Blocky. Between 17:00 and 23:00 the light is turned "on" for 0.3 minutes if it is 'off'. 'time' based scripts run every minute and because you turn "off" the light after 0.3 minutes, it is turned "on" again the next time the script runs.
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 6:52
by daconas
the Problem is the Motion sensor always give a off state when is triggered
when i use it without time it works perfect but i need it by night ( sunrise or bei time ) but when i set it between a time it turns on every minute but not without time.
what is wrong or what can i do ?
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 8:53
by StanHD
Take a look at the below working Blockly.
Principles:-
The On-Off period for the PIR (FGMS001) is set within the Z-Wave parameters of the node:- 6. Motion Alarm Cancellation Delay: 120.
The "WC Auto" Is adummy switch I have on all my Blockly's to turn them "Off" if required.
The "WC Light = Off" is a vital check to prevent switching regardless of current state.
The "WC actual" is a check for light level so light does not come on if the room is bright.
(The first "Else If" section is only in place as we have different set levels dependent upon time criteria.)
Perhaps you can take something from this that will help you?
https://ibb.co/bTop5k
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 9:19
by daconas
Hello, thank you
looks komplex, i check this
but when i test it with a lamp i turns not on automatic
so i want it with motion sensor
and second pic
i try one with schwitch not motion but nothing happens.
can you explain why pic 3 works but when i use the same with sunset it turn on again and again
when the problem the off state why works without time ?
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 10:46
by freijn
This is how I managed to get it to work :
I think it has to do with 2 times AND where you need an OR

Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 11:07
by daconas
ok, but think "or" means either sunriser or sunset ?
i found some exaples but it works not by me
https://gathering.tweakers.net/forum/li ... 1530723/25
ok i try it but it is the same light goes on and off
the problem is when i use time the light goes automatic on without a Trigger.
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 11:49
by freijn
Now I see your "problem"
Please put the "Spots achtertuin" in a groep.
then in the Groep item hit Timers.
In timers you can configure them to go on and off with sunset and sundown.
Forget the Blocky !!!

Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 13:25
by daconas
ok i try this before but i can onle set groupe in Blockmode not motion an group i trigger and the other is i can only turn on by sunrise or sunset
i have to fix the ...
and why is the option time and sunrise when not possible to use
i try with ohter devices al the same problem
it must be possible to turn on trigger in specific time or not ?
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 13:49
by freijn
Perhaps it is me but can you eaplain ( again ) what you are trying to do ?
the lamp in the garden has to go on if a Pir is triggered and only in the evening ? Correct?
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 14:02
by daconas
Hello, i want use a Motionsensor ( Aktivate State is off ) to turn on a Lamp after sunset and befor sunrise.
the sensor works but when i use Sunrise or time the lamp goes in on and off loop.
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 14:36
by StanHD
The reason for the "Or" between Sunset and Sunrise is because Domoticz starts a new day at midnight (00:00) therefore it can never be between:-
(Sunset until 00:00) AND (00:00 until Sunrise).
It can be:-
(Sunset until 00:00) OR (00:00 until Sunrise)
Hope that helps
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 15:08
by freijn
So build your blocky exactly as my example blocky.
That one works perfectly for your purpose.
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 15:34
by daconas
@ freijn
you have a Link or pic or you mean the group setting ?
@StanHD
i think about this problem but i try alredy this and the loop starts every new minute

- time.png (13.08 KiB) Viewed 3287 times
but i try this one at Night

- time.png (13.08 KiB) Viewed 3287 times
Thank you
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 16:04
by StanHD
So, after 0.3 minutes what happens to the "Bewegunsmelder Eingang"? .... nothing? .... So it is still off?
But the Mi-Light has now turned off, so a change has been made and thus the conditions are again met such that the "Do" event will be triggered again ..... and again until you are outside the time limits, or the "Bewegunsmelder Eingang" is on where the conditions are not met and the "Do" condition is therefore not carried out.

Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 19:14
by daconas
hello StanHD
sorry my Englisch is very bad
im not sure what you mean exactly.
First of all i try this

- no time.JPG (18.35 KiB) Viewed 3273 times
an i try the motionsensor i put in on the frontdoor and its working without loop or somthing.
Then i want try to turn on only by night but the loop comes i think about a error in the time in the moment of 00:00 and i try time
sunset to 11:00 pm an 07:00 pm to 11:00 pm but nothing works
i lookt many example but nothing.
now is the lampe quiet i think it is the or between the sunset and sunrise i hope the light goes on when sun goes down and no loop comes.
Re: Python and Blockly Problems
Posted: Tuesday 18 April 2017 19:53
by StanHD
Do not apologise for your English, I am sure I could not speak any of your language
So can you explain about your PIR. Which make / model is it?

Re: Python and Blockly Problems
Posted: Wednesday 19 April 2017 6:31
by daconas
Hello, now its working with last konfiguration " Sunset or Sunrise"
Thank you to freijn the " or " was right .
Thank you to all for the Help.