Page 21 of 36
Re: Blockly examples
Posted: Tuesday 10 January 2017 1:24
by sion
tjabas wrote:Hi!
i have made this simple blocky, it is supposed to turn of the fan to my stove when the air temperature goes below 25 degrees celcius, this works very well, but i have problem when i want to start the fan when the air is cold, below 25 degrees the fan turns of emediately, i have to keep a fire in the stove for about 10 minutes before the fan stops from turning off.
is it possible to do it like this , when the air temp reaches 30 degrees then the blocky ive made turns active?
[img]kamin.PNG[/img]
Using variables would be the neatest way to do this, but you could possibly use a dummy switch that is turned on when the stove reaches 30 degrees.
Then just add "and this switch=on" into your first line.
Then remember to switch "this switch" off when the fan goes off.
This way the script will only run if the stove has at least been over 30 degrees.
Re: Blockly examples
Posted: Tuesday 10 January 2017 11:58
by edje1205
I will set lamps group on at moday till friday on at a certain time, (not in the weekends)
and when off
if on yet norhing may happen
My logics in blockly were:
Code: Select all
if on certain time and its Monday till Friday and groups is off then do group on
nothing happended
little help if possible
thnx !
Re: Blockly examples
Posted: Tuesday 10 January 2017 12:28
by elmortero
edje1205 wrote:
My logics in blockly were:
Code: Select all
if on certain time and its Monday till Friday and groups is off then do group on
nothing happended
If for some reason events skip a beat and miss 11:37 it will not trigger, to build in a safety you could put it between timeX and timeY
In your case it will also only trigger if
none of mentioned lights are on (but I guess you know that).
- blcok.JPG (45.2 KiB) Viewed 4244 times
Re: Blockly examples
Posted: Tuesday 10 January 2017 15:09
by StanHD
@edj1205,
Also note you have used an If, else if, block (with the blue symbol in the top left) but without an else if. For this situation you should use the single If block without the blue symbol.
Re: Blockly examples
Posted: Tuesday 10 January 2017 17:08
by edje1205
Thnx both of you.
Oke maybe the first attachement was a little bit blurring and over the top
I tried in another way see att
without the last 'and' (huiskamer staande lamp = off) it runs, so now I split it off in if's and else if's
but the last 'and' frustrate it.
Re: Blockly examples
Posted: Tuesday 10 January 2017 17:22
by four2six
the last 'and' in every line is one level lower as the other 'and's. that could be a problem.
Re: Blockly examples
Posted: Tuesday 10 January 2017 17:49
by edje1205
I do realize something s wrong with the structure but what ever I try it's not like the one from elmotero (see att2)
domoticz is last version 3.5877
wonder how to change structure logic and control see att1
Re: Blockly examples
Posted: Tuesday 10 January 2017 20:21
by tozzke
tjabas wrote:]i did it like this: [img]Skärmklipp.PNG[/img]
and now check your log... this will constantly trigger as long as the temperature is between those values and switch that switch off...
The log will be flooded (or you'll have to choose for a time-blockly (does that even work @ blockly? of only @ lua?))
If the switch you're turning off is a 433MHz device, you might encounter some issues when you want to switch other devices (because 433MHz keeps sending it's signal for a few seconds in which you can't send/receive another command)
edje1205 wrote:I do realize something s wrong with the structure but what ever I try it's not like the one from elmotero (see att2)
domoticz is last version 3.5877
wonder how to change structure logic and control see att1
right click on block and click 'external inputs'
Re: Blockly examples
Posted: Tuesday 10 January 2017 20:48
by tnegun
tozzke wrote:right click on block and click 'external inputs'
Just for my info thats purely visual, it doesn't affect the logic right?
Re: Blockly examples
Posted: Tuesday 10 January 2017 22:06
by tozzke
tnegun wrote:tozzke wrote:right click on block and click 'external inputs'
Just for my info thats purely visual, it doesn't affect the logic right?
correct
sometimes it makes it easier to read and in very long blocklies it makes it more compact
Re: Blockly examples
Posted: Tuesday 10 January 2017 23:25
by tnegun
tozzke wrote:
correct
sometimes it makes it easier to read and in very long blocklies it makes it more compact
Thanks!
Re: Blockly examples
Posted: Wednesday 11 January 2017 9:45
by edje1205
tozzke wrote:tnegun wrote:tozzke wrote:right click on block and click 'external inputs'
<br abp="431">Just for my info thats purely visual, it doesn't affect the logic right?
<br abp="432">correct
<br abp="433">sometimes it makes it easier to read and in very long blocklies it makes it more compact
hmm nothing on that !?
this is what I see right clicking see att
Re: Blockly examples
Posted: Wednesday 11 January 2017 9:59
by tnegun
Right click on the logic block
Re: Blockly examples
Posted: Sunday 15 January 2017 17:28
by mabo21
Hi,
i would like to turn the light on after sunset and before 00:30 ( half past midnight ) and if Lux is under 15. Between 00:30 and 17:00 the light should be off. Anything i am doing wrong... The light is not turning on. Anybody an idea?
Thanks,
Mario
Re: Blockly examples
Posted: Sunday 15 January 2017 17:42
by tozzke
mabo21 wrote:Hi,
i would like to turn the light on after sunset and before 00:30 ( half past midnight ) and if Lux is under 15. Between 00:30 and 17:00 the light should be off. Anything i am doing wrong... The light is not turning on. Anybody an idea?
Thanks,
Mario
Try:
Code: Select all
If [Time > Sunset] or* [Time < 0:30] and [Lux < 15] and [Light = Off]**
Do [Set Light = On]
Else if [Time > 0:30] and [Time < 17:00] and [Light = On]**
Do [Set Light = Off]
Sunset and Sunrise are times in Domoticz, so you'll have to use the 'Time ='-Blockly
* OR because a day (@ Domoticz) is from 0:00 till 24:00 which means it can't be past sunset AND before 0:30 on the same day
** Check whether de light you want to switch on/off is the opposite state you want to switch it to. Else it'll trigger continuously. Now it'll only trigger when the light isn't the state you want it to be
Re: Blockly examples
Posted: Sunday 15 January 2017 19:16
by mabo21
tozzke wrote:mabo21 wrote:Hi,
i would like to turn the light on after sunset and before 00:30 ( half past midnight ) and if Lux is under 15. Between 00:30 and 17:00 the light should be off. Anything i am doing wrong... The light is not turning on. Anybody an idea?
Thanks,
Mario
Try:
Code: Select all
If [Time > Sunset] or* [Time < 0:30] and [Lux < 15] and [Light = Off]**
Do [Set Light = On]
Else if [Time > 0:30] and [Time < 17:00] and [Light = On]**
Do [Set Light = Off]
Sunset and Sunrise are times in Domoticz, so you'll have to use the 'Time ='-Blockly
* OR because a day (@ Domoticz) is from 0:00 till 24:00 which means it can't be past sunset AND before 0:30 on the same day
** Check whether de light you want to switch on/off is the opposite state you want to switch it to. Else it'll trigger continuously. Now it'll only trigger when the light isn't the state you want it to be
Thanks tozzke, that way it work!
Re: Blockly examples
Posted: Monday 16 January 2017 14:38
by plantjes
Hi,
I am strugeling with the varialble options in blocky.
I see an option for variable but i have no devices in it.
Where can i make a var device??
I would like to use it for preventing double actions in setting a value to this variable...
If it needs to go in lua i need help as i do not use lua (up to now.)
Best regards
Benno
Re: Blockly examples
Posted: Monday 16 January 2017 16:16
by Domosapiens
Go to Setup -> More Options -> User variables.
There you can create them.
Re: Blockly examples
Posted: Wednesday 25 January 2017 16:01
by edje1205
Hi
at least i got my Kaku dusk sensor abst-604 recognized in domoticz
Now I want:
A) My lights go on different times in week daily (some later) and weekend (some earlier)
But It could be grey/duskey outside so when its dark enough the dusksensor has to start
BUT
not running as A) is active because my lights go dimming down/up
see my blockly but it does nothing
(when I click on dusk sensor and have a light connected with it with the sensor setup it goes on/off. there are no devices connected with it)
thanx for suggestions !
Re: Blockly examples
Posted: Wednesday 25 January 2017 19:09
by tozzke
edje1205 wrote:Hi
at least i got my Kaku dusk sensor abst-604 recognized in domoticz
Now I want:
A) My lights go on different times in week daily (some later) and weekend (some earlier)
But It could be grey/duskey outside so when its dark enough the dusksensor has to start
BUT
not running as A) is active because my lights go dimming down/up
see my blockly but it does nothing
(when I click on dusk sensor and have a light connected with it with the sensor setup it goes on/off. there are no devices connected with it)
thanx for suggestions !
It does not trigger because it's incorrect
Don't use the time (00:00) blockly for indicating seconds/minutes and mind the place where you put the conditions the [x = On] block has to be in 1 block... not seperated into 2 (I marked the part which is wrong).
Try this:
Code: Select all
If [[[Dusk sensor switch] = [On]] and [[Huiskamer televisie lamp] = [Off]]]
Do [Set [Huiskamer televisie lamp] = [On] After [10] seconds]
Else if [[[Dusk sensor switch] = [On]] and [[Huiskamer staande lamp] = [On]]]
Do [Set group [Huiskamer voor 2 week] = [On]]
mind the brackets!
Groups switch on and off, you don't set them active/inactive (I'm not even sure when to use the (in)active option)