Blockly examples

Must be cleaned all topics go to the right subforum
tjabas
Posts: 147
Joined: Sunday 11 December 2016 14:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Postby tjabas » Saturday 24 December 2016 1:20

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: 151
Joined: Tuesday 24 December 2013 0:36
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Postby rhendriks » Wednesday 28 December 2016 21:33

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: 147
Joined: Sunday 11 December 2016 14:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Postby tjabas » Friday 30 December 2016 23:31

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: 12
Joined: Tuesday 27 December 2016 17:19
Target OS: Raspberry Pi
Domoticz version: 3.6328
Location: Ireland
Contact:

Re: Blockly examples

Postby tnegun » Sunday 01 January 2017 0:49

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: 513
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly examples

Postby StanHD » Sunday 01 January 2017 5:12

Try re-building without nesting. It should be ok then.
Domotica - Intel nuc Celeron, Domoticz - Windows, RFXTRX433E. 1-Wire USB. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub, Broadlink RM2, HA-Bridge with Amazon Echo / Alexa.

TacticalLeader
Posts: 9
Joined: Tuesday 19 January 2016 14:19
Target OS: Raspberry Pi
Domoticz version: latest
Location: Szeged, Hungary
Contact:

Re: Blockly examples

Postby TacticalLeader » Sunday 01 January 2017 12:22

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: 12
Joined: Tuesday 27 December 2016 17:19
Target OS: Raspberry Pi
Domoticz version: 3.6328
Location: Ireland
Contact:

Re: Blockly examples

Postby tnegun » Sunday 01 January 2017 13:38

StanHD wrote:Try re-building without nesting. It should be ok then.


Something like this then? It seems to be working :)

Image

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

Re: Blockly examples

Postby StanHD » Sunday 01 January 2017 18:39

That's it
Domotica - Intel nuc Celeron, Domoticz - Windows, RFXTRX433E. 1-Wire USB. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub, Broadlink RM2, HA-Bridge with Amazon Echo / Alexa.

NOTORIOUSVR
Posts: 9
Joined: Thursday 07 April 2016 16:40
Target OS: Linux
Domoticz version:
Contact:

Re: Blockly examples

Postby NOTORIOUSVR » Saturday 07 January 2017 1:12

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: 56
Joined: Wednesday 24 February 2016 10:16
Target OS: Raspberry Pi
Domoticz version:
Location: NRW, Germany
Contact:

Re: Blockly examples

Postby four2six » Saturday 07 January 2017 13:44

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: 513
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly examples

Postby StanHD » Saturday 07 January 2017 13:50

In your middle blockly. Should be:-

[Kitchen Motion Sensor = Off] and [Living Room Motion Sensor = Off]
Domotica - Intel nuc Celeron, Domoticz - Windows, RFXTRX433E. 1-Wire USB. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub, Broadlink RM2, HA-Bridge with Amazon Echo / Alexa.

NOTORIOUSVR
Posts: 9
Joined: Thursday 07 April 2016 16:40
Target OS: Linux
Domoticz version:
Contact:

Re: Blockly examples

Postby NOTORIOUSVR » Saturday 07 January 2017 20:27

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: 147
Joined: Sunday 11 December 2016 14:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Postby tjabas » Sunday 08 January 2017 12:43

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]
Attachments
kamin.PNG
kamin.PNG (6.81 KiB) Viewed 698 times

DutchHans
Posts: 201
Joined: Friday 03 April 2015 20:44
Target OS: Raspberry Pi
Domoticz version:
Location: Germany (near dutch border)
Contact:

Re: Blockly examples

Postby DutchHans » Sunday 08 January 2017 12:54

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

tjabas
Posts: 147
Joined: Sunday 11 December 2016 14:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Postby tjabas » Sunday 08 January 2017 13:03

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: 147
Joined: Sunday 11 December 2016 14:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Postby tjabas » Monday 09 January 2017 12:25

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: 102
Joined: Friday 02 January 2015 10:22
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blockly examples

Postby tozzke » Monday 09 January 2017 20:36

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: 147
Joined: Sunday 11 December 2016 14:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Postby tjabas » Monday 09 January 2017 21:30

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: 147
Joined: Sunday 11 December 2016 14:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Postby tjabas » Monday 09 January 2017 23:56

]i did it like this: [img]
Skärmklipp.PNG
[/img]
Attachments
Skärmklipp.PNG
Skärmklipp.PNG (9.86 KiB) Viewed 617 times

sion
Posts: 80
Joined: Friday 08 January 2016 13:32
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Postby sion » Tuesday 10 January 2017 2:13

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.


Return to “Scripts [cleaning in progress]”

Who is online

Users browsing this forum: No registered users and 1 guest