Blockly examples

Moderator: leecollings

tjabas
Posts: 562
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by tjabas »

StanHD wrote:Similar to this is worth a try:-

Image

i gave it a try, but it didnt work with the timer and sunset block, i had to make a dummy that aktivates by sunset , ant put it where the timer and sunset block was on your description, then it worked.

thanks for your help.

by the way, how can i inaktivate a switch?
is it possible to make a switch unactive during a sertain time, lets say inactivated during sunset, but activated after sunrise, it should be possible to push the inactivated button in domoticz and nothing should happen, until dawn, then when i push it it will work.

thanks again.
rhendriks
Posts: 44
Joined: Monday 23 December 2013 23:36
Target OS: Raspberry Pi / ODroid
Domoticz version: Newest
Location: Netherlands Helmond
Contact:

Re: Blockly examples

Post by rhendriks »

How can I make that a dummy switch named Alert (on the dashboard) react on a input from the Piface.
For example:
The switch is Always on , if the switch is off then must the dummy(alert-triangle) should be red.
If I do this with an switchdummy it works but not if I used an alarmdummy.
who can give me an idea?
tjabas
Posts: 562
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by tjabas »

Hi!

i have a hardware button that activates a switch in domoticz, but i want to push the hardware button 2 times within a range of 5 seconds to activate the switch in domoticz. and if i push the hardware button twice outside the 5 seconds limit, then the switch in domoticz wont activate.

is this doable in blocky?
tnegun
Posts: 11
Joined: Tuesday 27 December 2016 16:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6328
Location: Ireland
Contact:

Re: Blockly examples

Post by tnegun »

Hey guys,

I'm having some trouble with the example below. Each of the nested conditions is matched once the first is matched e.g. If Play Room temp is less than 16, I get email alerts for each condition confirming an match.

Can someone point out the obvious to me :?

Image
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly examples

Post by StanHD »

Try re-building without nesting. It should be ok then.
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
TacticalLeader
Posts: 13
Joined: Tuesday 19 January 2016 13:19
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Szeged, Hungary
Contact:

Re: Blockly examples

Post by TacticalLeader »

Is it able in Blockly to count seconds passed?
For example: if I want to turn off a switch depends on a temperature
- if the temperature was more than 50 degrees for more than 30 minutes and
- after some time the temperature goes less than 35 degrees and in this case, turn the switch on

Or I should learn LUA :)
tnegun
Posts: 11
Joined: Tuesday 27 December 2016 16:19
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.6328
Location: Ireland
Contact:

Re: Blockly examples

Post by tnegun »

StanHD wrote:Try re-building without nesting. It should be ok then.Image
Something like this then? It seems to be working :)

Image
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly examples

Post by StanHD »

That's it
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
NOTORIOUSVR
Posts: 9
Joined: Thursday 07 April 2016 16:40
Target OS: Linux
Domoticz version:
Contact:

Re: Blockly examples

Post by NOTORIOUSVR »

Can someone advise/clarify please.

Why would this work:

Image

But this not?

Image

I've left out the time variable to simplify, but ideally I'd like to have both PIR's and time (after sunset) involved so avoid triggering the scene when I'm home (as it would override what scene/lights are already on).

EDIT: Oddly enough, this works (one PIR):

Image
four2six
Posts: 53
Joined: Wednesday 24 February 2016 9:16
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NRW, Germany
Contact:

Re: Blockly examples

Post by four2six »

Sunset as a variable proved to be very unreliable. Make a virtual switch that turns on at sunset and off at sunrise, so you have the "night time" you desire. Use that switch in your blockly instead.
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly examples

Post by StanHD »

In your middle blockly. Should be:-

[Kitchen Motion Sensor = Off] and [Living Room Motion Sensor = Off]
Domoticz Main - Intel nuc, Windows, RFXTRX433E. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
NOTORIOUSVR
Posts: 9
Joined: Thursday 07 April 2016 16:40
Target OS: Linux
Domoticz version:
Contact:

Re: Blockly examples

Post by NOTORIOUSVR »

four2six wrote:Sunset as a variable proved to be very unreliable. Make a virtual switch that turns on at sunset and off at sunrise, so you have the "night time" you desire. Use that switch in your blockly instead.
Thanks for the tip!
StanHD wrote:In your middle blockly. Should be:-

[Kitchen Motion Sensor = Off] and [Living Room Motion Sensor = Off]
Hmm... I think I've tried that combo at some time, but I'll give it another shot and report back maybe the syntax was not quite right.
tjabas
Posts: 562
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by tjabas »

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
kamin.PNG (6.81 KiB) Viewed 3380 times
[/img]
DutchHans
Posts: 230
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Blockly examples

Post by DutchHans »

Cant you use "off after 10 minutes" and maybe put your switch temperature to 23 or 24?
Cheers, Hans
tjabas
Posts: 562
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by tjabas »

DutchHans wrote:Cant you use "off after 10 minutes" and maybe put your switch temperature to 23 or 24?
Cheers, Hans

i was also thinking about putting a delay in the of command, but i guess that i just put a delay in the off swith, even if the temp goes over 25 dgr , and the of command has been made, i just delay the off command with 10 min.
tjabas
Posts: 562
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by tjabas »

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]

i have noticed that this blocky config is constantly turning the fan of after it has passed 25c degrees and down, domoticz it constantly sending an off command as soon as it passes 25degrees and down.
how can i change this so it only sends just one off command when it passes 25c?
tozzke
Posts: 135
Joined: Friday 02 January 2015 9:22
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Blockly examples

Post by tozzke »

tjabas wrote:
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]

i have noticed that this blocky config is constantly turning the fan of after it has passed 25c degrees and down, domoticz it constantly sending an off command as soon as it passes 25degrees and down.
how can i change this so it only sends just one off command when it passes 25c?
Add/create a variable '25C_passed?' (integer 1/0 or string yes/no) and add it into the blockly so you'll get something like this:

Code: Select all

If [Kamin temp < 25] and [variable 25_passed? = 0]
Do [set Kamin = Off]
   [set variable 25_passed? = 1]
and change it back to 0 when it reaches another temp with an 'else if'
tjabas
Posts: 562
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by tjabas »

ok, i will try this, but im a but unsecure in this blocky thing, how do make a variable '25C_passed?

im not so good at this blocky yet, but im getting there.
tjabas
Posts: 562
Joined: Sunday 11 December 2016 13:51
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by tjabas »

]i did it like this: [img]
Skärmklipp.PNG
Skärmklipp.PNG (9.86 KiB) Viewed 3299 times
[/img]
sion
Posts: 113
Joined: Friday 08 January 2016 12:32
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by sion »

tjabas wrote:Hi!

i have a hardware button that activates a switch in domoticz, but i want to push the hardware button 2 times within a range of 5 seconds to activate the switch in domoticz. and if i push the hardware button twice outside the 5 seconds limit, then the switch in domoticz wont activate.

is this doable in blocky?
I do something like this with one of my outside sensor where if we are not in, and it is triggered twice within a couple of mins, it sets off a light sequence inside resembling someone going through the house.

There is probably an easier way to do this, but this works for me.

You will need 3 dummy switches.
Link one of them to the hardware switch. (SwitchA)
So when button is pressed it turnes on.

Something like:
If:switchA = on. And switchB = off
Do:
turn on switchB.
turn off switchB after 5 seconds.

Else if: switchA =on and switchB = on
Do:
turn on switchC
Turn off switchB.
running domoticz 3.4834 on rpi2, with
Hue bridge / bulbs.
lightwave rf sockets, mood controlers, sensors & contacts.
Home bridge / Siri.
Ha bridge / echo Alexa.
Hard wired alarm system - setting home / away status.

Next: harmony hub.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest