Blockly examples

Moderator: leecollings

alfred_j_kwak
Posts: 110
Joined: Friday 20 September 2013 18:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2.3530
Location: Finland
Contact:

Re: Blockly examples

Post by alfred_j_kwak »

Arkie wrote:Hello, i made this blockly event, but it's not working between the timetable, it's working every time of the day i'll open the door!
...
greetings
Maybe you should construct your logic little bit different "Schuurdeur" can only be 'Open' or 'Close'. Not 'Open in the middle of the night'

So If [[Schuurdeur = Open] AND [[Time>1:20] AND [Time<6:00]]] then something

I cant use blocky so I'm not sure.

-Jussi-
User avatar
CopyCatz
Developer
Posts: 123
Joined: Thursday 11 July 2013 17:28
Target OS: -
Domoticz version:
Location: Outer Heaven
Contact:

Re: Blockly examples

Post by CopyCatz »

you are structuring like:

if (schuurdeur = (open and ((time > ..) and (time < ..)))

i.e. you are checking to see if schuurdeur is equal to the rest of the statements

you should be structuring like:

if ((schuurdeur = open) and ((time > ..) and (time < ..)))
User avatar
Arkie
Posts: 38
Joined: Tuesday 03 December 2013 15:24
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Blockly examples

Post by Arkie »

Thanxs for your replies: i made a new one like u guys say (i think) but it's still not working.
event 2.jpg
event 2.jpg (50.51 KiB) Viewed 12076 times
greetings
Synology DS412+
Philips Hue
Fibaro
Logitech Hamony elite
Foscam 9804 ip cam
RFXtrx433E USB 433.92MHz
ZXT 120 eu AC controller
Heatmiser NEO stat thermostats and Hub
willie-p
Posts: 34
Joined: Friday 12 July 2013 14:19
Target OS: Windows
Domoticz version:
Location: Netherlands
Contact:

Re: Blockly examples

Post by willie-p »

Dear Arkie,

What kind of door sensor do you have? Some door sensors work within blocky with "on" instead of "open"

Perhaps you could try this.

Cheers,
Will
User avatar
Arkie
Posts: 38
Joined: Tuesday 03 December 2013 15:24
Target OS: NAS (Synology & others)
Domoticz version: beta
Location: The Netherlands
Contact:

Re: Blockly examples

Post by Arkie »

I've also tried to change it to on and off, didn't work either. KAKU sensor
After trying various changes i think i now have the awnser for my problem
The times should be on the same day!!! So it should work with the blockly from my second message standing above!
But because i didn't want to wait till 1:20 to test it, i changed the time to 20.00 (so before midnight), with this time it didn't work, but when i change the 6:00 too 23.59 it works fine
On this last test the actual time was around 23:00.

Maybe a good point for modification!
Thanxs for the replies
Synology DS412+
Philips Hue
Fibaro
Logitech Hamony elite
Foscam 9804 ip cam
RFXtrx433E USB 433.92MHz
ZXT 120 eu AC controller
Heatmiser NEO stat thermostats and Hub
Slorf
Posts: 26
Joined: Friday 20 December 2013 11:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Voorburg
Contact:

Re: Blockly examples

Post by Slorf »

Got a new Itho ECO fan, connected it to a KaKu 3 wway switch.

Then bought a KaKu remote, the remote sends a signal to Domoticz, then Domoticz sets the fan to the correct speed.

Working to expand it with:
pir sensor in toilet
hygro meter in bathroom
co2 meter in livingroom

Alex
A lot of stuff :[-)

Orange PI
Evohome with HGI-80
SmartMeter USB Cable
Solar panels
RFLINK 433 MHz
AeonLabs usb z-wave plus
My Sensors ( Lan Gateway )
Wemos sensors
Arduino sensors
nigels0
Posts: 221
Joined: Thursday 23 January 2014 12:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Contact:

Re: Blockly examples

Post by nigels0 »

Blockly to switch a light on between the hours of dusk to dawn via a contact switch on a door. The dusk to dawn code seems clunky to me, but it works...
Attachments
Screen Shot 2014-02-15 at 18.56.29.png
Screen Shot 2014-02-15 at 18.56.29.png (46.38 KiB) Viewed 11888 times
User avatar
bizziebis
Posts: 182
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8805
Location: The Netherlands
Contact:

Re: Blockly examples

Post by bizziebis »

You could also use

IF ((Front Door Switch = Open) AND ((Time >= Sunset) OR (Time <= Sunrise)))
DO .....
ErikCramer
Posts: 11
Joined: Saturday 01 February 2014 18:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by ErikCramer »

Slorf wrote:Got a new Itho ECO fan, connected it to a KaKu 3 wway switch.

Then bought a KaKu remote, the remote sends a signal to Domoticz, then Domoticz sets the fan to the correct speed.

Working to expand it with:
pir sensor in toilet
hygro meter in bathroom
co2 meter in livingroom

Alex
Alex, what kind of pir, hygro and CO2 sensors do you have?
Heisenberg
Posts: 135
Joined: Monday 27 January 2014 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Blockly examples

Post by Heisenberg »

ErikCramer wrote:
Slorf wrote:Got a new Itho ECO fan, connected it to a KaKu 3 wway switch.

Then bought a KaKu remote, the remote sends a signal to Domoticz, then Domoticz sets the fan to the correct speed.

Working to expand it with:
pir sensor in toilet
hygro meter in bathroom
co2 meter in livingroom

Alex
Alex, what kind of pir, hygro and CO2 sensors do you have?
I also would like to know how you implemented it. If possible could you post some pics of the wiring with the Kaku switch too? Thnx in advanced
Raspberry Pi Type B
Raspberry Pi Type B2
RFXCOMtrx433e
ErikCramer
Posts: 11
Joined: Saturday 01 February 2014 18:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by ErikCramer »

I've created the folowing schema.
Its to turn on the light when its of and its = or after sunset.

When its = or after sunset it and its on. should turn off again.

But if i check my NMA i have about 30 msgs of it turning on :( do i have some thing contradictary in it or a loop ?
If i look my self i dont see any thing wrong.
Attachments
schemerschakelaar.PNG
schemerschakelaar.PNG (52.45 KiB) Viewed 11843 times
User avatar
bizziebis
Posts: 182
Joined: Saturday 19 October 2013 14:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8805
Location: The Netherlands
Contact:

Re: Blockly examples

Post by bizziebis »

You have to make something like

IF time => sunset OR =< sunrise AND switch 1 = off...

The way you made it now will cause it to infinite loop after sunset has passed.
ErikCramer
Posts: 11
Joined: Saturday 01 February 2014 18:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by ErikCramer »

I found out the OR expression doesnt work has to be and also so i created the following (its not night yet but it turns of when its day so i think it works.)

If you'd like to ad to the equasion id like to be able to manualy turn it off every once in a while, is there an option for that ?
Attachments
night switch.JPG
night switch.JPG (73.09 KiB) Viewed 11824 times
Heisenberg
Posts: 135
Joined: Monday 27 January 2014 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Blockly examples

Post by Heisenberg »

bizziebis wrote:I've also added a KAKU switch to my mechanical ventilation. I didn't touch the perilex plug. I opened up the unit and directly attached the wires from the KAKU to the PCB of the ventilation system.

I made some blocky events to controll it all. It can be controlled manualy by virtual switches or automatically by measuring the humidity of the bathroom.
I'va also added an option to override the current settings. In case I get tired of the fan running full speed when my girlfriend is showering after a late shift :D

The events can be optimised and some things can be put together. But then I have to send multiple signals to just make one switch. And that's something I'm not willing to do because the RfxCom is interfering with my digital tv (RTL5 HD and SBS6 HD). So with the current events it's reduced to sending only the needed signals.

The override event is not optimised at all. But I almost never use it so I didn't bother to change it yet :)

Level 1:

Image

Level 2:

Image

Level 3:

Image

Override:

Image

bizziebis, care to share some pictures of your KAKU wiring solution attached to the PCB?
Raspberry Pi Type B
Raspberry Pi Type B2
RFXCOMtrx433e
ErikCramer
Posts: 11
Joined: Saturday 01 February 2014 18:42
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by ErikCramer »

gibbiem wrote:Hi, I have a question about the first and last post on this thread.

On the first, the person posted an example of a blocky where there is an 'if,do' command within and an 'if,do' command. How do you get Domoticz to create this?

On the last post, the example include an 'else,if' command, I also cant find this on my system.

Just updates to .918

Thanks

Hi see my picture.

There is the option if do and the else if if you press the + sign

In domotics its Setup > more options > events.



Guess with my blocky i did some thing wrong as its dark and the light is still off.. :(
perhaps it would be nice if there would be a test option in the scripts..
Attachments
Capture.JPG
Capture.JPG (44.26 KiB) Viewed 11800 times
simonrg
Posts: 329
Joined: Tuesday 16 July 2013 22:54
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8807
Location: North East England
Contact:

Re: Blockly examples

Post by simonrg »

Your light will never turn on as there is no time when time is both greater than Sunset and less then Sunrise in numbers, for example Sunrise 6am, Sunset 6pm - so for example at 7pm - 7pm is greater than 6pm but not less than 6am - so light won't be tested.

You need to change the "and" in the first block to an "or" - so at 7pm - 7pm is greater than 6pm, 7pm is not less than 6am so will test light.

I seem to remember also that "or" blocks at the start of Blockly can cause problems, in which case you would swap the clauses round.
Raspberry Pi 2 B - 2A@5V PSU - Raspbian + Domoticz + RFXtrx(89), LightwaveRF House(dimmers, sockets, wireless/mood switches), Owl CM113, 4 LaCross Temp / Humidity Sensors, 4 Siemens PIR, Smappee, Solaredge, ESP8266
Slorf
Posts: 26
Joined: Friday 20 December 2013 11:55
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Voorburg
Contact:

Re: Blockly examples

Post by Slorf »

Hi Eric, Heisenberg

I am using a cheap cresta themperature/hydro meter, the pir's are from ebay ( 2 euro's each, connected to a piface ), the airquality is measured using a voltcraft co-20 compatible usb stick.

Left all the original wiring inplace, used a platic box with a kaku 3500 switch ( you can switch 3 devices ) in it and a perilex socket.

This box is connected to 220v and the kaku 3500 is connected to the perilex socket, in this way I left all the original wiring in place ( incase I ever move )

Will make some pictures this weekend

Alex
A lot of stuff :[-)

Orange PI
Evohome with HGI-80
SmartMeter USB Cable
Solar panels
RFLINK 433 MHz
AeonLabs usb z-wave plus
My Sensors ( Lan Gateway )
Wemos sensors
Arduino sensors
Andyyyy
Posts: 29
Joined: Saturday 13 July 2013 23:46
Target OS: -
Domoticz version:
Contact:

Re: Blockly examples

Post by Andyyyy »

Hi all,
could anyone help me with a script ?

I have a impulse relay in my floor, so i send with a "Push on button" a on signal for 1 second. Every time i send the "on" command the lamp changes between on and off.
so far so good but,
I like to use a switch in my bedroom for following scenario:
when i press "on" the push button should send the "on" command. (that work´s !! )
but when i press the "off" button the "on" command should send after 30 minutes. How can i make this ???

Andyyyy
KnarfOfSpam
Posts: 1
Joined: Saturday 22 March 2014 21:35
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Blockly examples

Post by KnarfOfSpam »

So i am a bit deaf...using my 433mhz doorbell the lights flash on and off (even a spot in the garden) that there is somebody at the door. Doorlight stays on for 10 minutes. Great!
Capture.JPG
Capture.JPG (93.05 KiB) Viewed 12475 times
User avatar
Keptenkurk
Posts: 103
Joined: Wednesday 21 August 2013 17:24
Target OS: -
Domoticz version:
Location: Waalre, The Netherlands
Contact:

Re: Blockly examples

Post by Keptenkurk »

Funny, i never knew that setting on / setting off within one block would actually be executed.
Trying to prove that this wouldn't work i found out it actually does! :oops:
/paul
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest