Blockly examples
Moderator: leecollings
-
- Posts: 53
- Joined: Wednesday 24 February 2016 9:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: NRW, Germany
- Contact:
Re: Blockly examples
this should still work, if i understand your setup correctly
if 'skymningsrelä' = on and 'larmsensor 1' = on
set scene 'Larmsensor 1 av' = active
if 'skymningsrelä'' = off
set scene 'Larmsensor 1 av' = inactive
if 'skymningsrelä' = on and 'larmsensor 1' = on
set scene 'Larmsensor 1 av' = active
if 'skymningsrelä'' = off
set scene 'Larmsensor 1 av' = inactive
-
- Posts: 564
- Joined: Sunday 11 December 2016 13:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Yes its correct, but it doesnt work.
i can still aktivate the trigger that aktivates the scene when skymningningsrelä is set to off.
is it possible to make a switch inactive?
i can still aktivate the trigger that aktivates the scene when skymningningsrelä is set to off.
is it possible to make a switch inactive?
-
- Posts: 53
- Joined: Wednesday 24 February 2016 9:16
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: NRW, Germany
- Contact:
Re: Blockly examples
i'm not sure anymore i really understood what you want to achieve.
i understood:
switch 'larm' ist activated by your burglar alarm.
the scene 'Larmsensor 1 av' is the scene you want to be able to activated manually with the switch 'Larmsensor 1', but only after sunset and before sunrise.
you have a dummy switch "skymningsrelä" with a timer that is turned off at sunset and turned on at sunrise.
is this correct?
what is the connection between 'larm' and the rest?
i understood:
switch 'larm' ist activated by your burglar alarm.
the scene 'Larmsensor 1 av' is the scene you want to be able to activated manually with the switch 'Larmsensor 1', but only after sunset and before sunrise.
you have a dummy switch "skymningsrelä" with a timer that is turned off at sunset and turned on at sunrise.
is this correct?
what is the connection between 'larm' and the rest?
-
- Posts: 564
- Joined: Sunday 11 December 2016 13:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
The switch larm is irrelevant, its a fysical button that i press to turn on the burglar alarm in the house, these things dont have anything to do with Domoticz. The only connection between the burglar alarm and Domoticz is the larmsensor1 switch in Domoticz, the burglar alarm sends an on command to the larmsensor1 switch in Domoticz, but otherwise by your are right in the post above. I hope you undrerstand what i mean.
-
- Posts: 30
- Joined: Tuesday 20 December 2016 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.5877
- Location: Amsterdam Nieuwendam
- Contact:
light won't go off
Hello
I'm new here but after a week a junk for domoticz !
So easy but second part wont work
doorbell is pressed
after 5 seconds light goes on
if light is on
send sms with tekst
keep light on for x minutes (here 30 seconds)
send cam snapshot
all well but light keeps on and wont go off !
whats wrong ?
thnx in advance
I'm new here but after a week a junk for domoticz !
So easy but second part wont work
doorbell is pressed
after 5 seconds light goes on
if light is on
send sms with tekst
keep light on for x minutes (here 30 seconds)
send cam snapshot
all well but light keeps on and wont go off !
whats wrong ?
thnx in advance
- Attachments
-
- doorbell light cam script vertragen.jpg (383.96 KiB) Viewed 2364 times
-
- doorbell light cam script vertragen 2.jpg (376.4 KiB) Viewed 2364 times
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Blockly examples
The nested "If" Blocks are a problem. Can you redo with a single "If" and multiple "Else-If" structure?
The blocks used for seconds and minutes should be integer not time. (6) seconds, not (06:00) seconds.
The blocks used for seconds and minutes should be integer not time. (6) seconds, not (06:00) seconds.
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
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 85
- Joined: Tuesday 06 September 2016 9:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Sorø, DK
- Contact:
Re: Blockly examples
Yes I also have problems with nested if-else/if and have done as StanHD proposed with success, to avoid the nested, take a look at mine as proposal how you can do similar blocklyStanHD wrote:The nested "If" Blocks are a problem. Can you redo with a single "If" and multiple "Else-If" structure?
The blocks used for seconds and minutes should be integer not time. (6) seconds, not (06:00) seconds.
-
- Posts: 30
- Joined: Tuesday 20 December 2016 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.5877
- Location: Amsterdam Nieuwendam
- Contact:
Re: Blockly examples
Thanks for reply Stan !StanHD wrote:The nested "If" Blocks are a problem. Can you redo with a single "If" and multiple "Else-If" structure?
The blocks used for seconds and minutes should be integer not time. (6) seconds, not (06:00) seconds.
Now I have this (see att) :
Script: light goes on immediatly ( not after 10 seconds) and I want a relais of 10 sec
sms has send
camera snapshot has send
light goes off after 1 minute
The starting if (when light = on) is that correct ? if I do when light = off nothing happened; same for all statements so on is logic (?)
but not logic is: when light = on, set light on after 10 seconds (because it's already on). Or what ?
Wait ! I´m struggling with the ´else if´ uhhh
grtz
- Attachments
-
- doorbell light cam script vertragen 2a.jpg (109.2 KiB) Viewed 2326 times
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Blockly examples
Yes you still have nested "If"s, try doing as @bjacobse above. A single "If" with multiple "Else if".
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
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 564
- Joined: Sunday 11 December 2016 13:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
Good morning!
im trying to get some lamps not to turn on during sunrise, yeat active during sunset.
please take a look at this blockly, i cant get it to work.
[img] [/img]
im trying to get some lamps not to turn on during sunrise, yeat active during sunset.
please take a look at this blockly, i cant get it to work.
[img] [/img]
- cyberclwn
- Posts: 103
- Joined: Thursday 20 August 2015 22:53
- Target OS: Raspberry Pi / ODroid
- Domoticz version: beta
- Location: The Netherlands
- Contact:
Re: Blockly examples
Hi,
I think the main issue here is that "Sunset" is a time. let's say it's "16:27".
So only when you have Kodi paused at 16:27, it will trigger.
Probably you mean "time > sunset" (after sunset)
Also the if looks a bit strange to me.
look at the previous post of bjacobse to see the difference in the "if" statement.
I think the main issue here is that "Sunset" is a time. let's say it's "16:27".
So only when you have Kodi paused at 16:27, it will trigger.
Probably you mean "time > sunset" (after sunset)
Also the if looks a bit strange to me.
Code: Select all
If "kodi = ( paused and (time = 16:27 ) ) then ...
3xPi 2B (Domoticz "live", Domoticz "sandbox", PhotoFrame)
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
RFXCom433(E), KaKu, Oregon Scientific, Keyes 2-relay, Logitech Media Server, MiLight, Smartwares heating controller(2x), IR Send/Receive, Keyes PIR, XH-M131 DuskSensor, DHT22/11
-
- Posts: 564
- Joined: Sunday 11 December 2016 13:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
yes i mean after sunset so the > should be pointing towards the sunset block?
otherwise, did the setup seem to be working?
otherwise, did the setup seem to be working?
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Blockly examples
Try:- (Kodi=paused) and (Time = sunset)
not (Kodi=(paused and Time = sunset)
Sometimes setting the options on the "and" block to external inputs makes the logic easier to see / understand.
not (Kodi=(paused and Time = sunset)
Sometimes setting the options on the "and" block to external inputs makes the logic easier to see / understand.
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
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 30
- Joined: Tuesday 20 December 2016 12:09
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.5877
- Location: Amsterdam Nieuwendam
- Contact:
Re: Blockly examples
Thanks StanH and of course bjacobse (ignored your suggestion )StanHD wrote:Yes you still have nested "If"s, try doing as @bjacobse above. A single "If" with multiple "Else if".
This is working !
Easy and what I wanted !
I will read other blockly's (blocklies) to learn later.
Now time for shopping; the wife is waiting
- Attachments
-
- doorbell light cam script vertragen final.jpg (74.04 KiB) Viewed 2265 times
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: RE: Re: Blockly examples
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
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 564
- Joined: Sunday 11 December 2016 13:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
StanHD wrote:Try:- (Kodi=paused) and (Time = sunset)
not (Kodi=(paused and Time = sunset)
Sometimes setting the options on the "and" block to external inputs makes the logic easier to see / understand.
thanks for your answer, it didnt work, i cant really tell why, i also have a dummy switch that turns on after sunset and of when sun rises.
i aslo replaced sunset timer with the dummy switch, but neither that one worked.
Is there anyone what would like to make a example blockly of how this would look like?
thank you.
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Blockly examples
Similar to this is worth a try:-
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
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 564
- Joined: Sunday 11 December 2016 13:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
thanksStanHD wrote:Similar to this is worth a try:-
but i dont really know how i would get that big (and) block right beside the (if do) block.
cant find it anywhere.
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Blockly examples
Right click the "and" block and select external inputs.
Sent from my SM-G925F using Tapatalk
Sent from my SM-G925F using Tapatalk
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
Python:- Broadlink RM2, Sonos
HA-Bridge - Amazon Echo / Alexa
-
- Posts: 564
- Joined: Sunday 11 December 2016 13:51
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Blockly examples
StanHD wrote:Yes you still have nested "If"s, try doing as @bjacobse above. A single "If" with multiple "Else if".
thank you
Who is online
Users browsing this forum: No registered users and 0 guests