Question - Sunscreen blockly

Post Reply
Bishop
Posts: 21
Joined: Sunday 11 June 2017 14:06
Target OS: Raspberry Pi
Domoticz version:
Contact:

Question - Sunscreen blockly

Post by Bishop » Sunday 11 June 2017 14:10

Hello!

Quite new to Domoticz but I am having a blast. So much fun to tinker with the house.
I am creating a blockly to automate the sunscreen (Awning) in the garden.

The goal:
If the sunscreen is not down (Off or Stop) AND it's between 11:00 and 20:00 AND it isn't raining AND it's 18+c outside AND UV is equal or more then 1 --> Go down (On)
If it rains go up, only if On or Stop (So when it's down halfway or completely)
If IsDark (1 hour before sunset) is On go up. (Off)

At the moment it does not seem to respond.
It does respond if I remove the Off or Stop part.

I have tried different variations for Off Stop On commands. The sunscreen seems to respond to on and off signals. Can someone help me out?
I have looked at various LUA scripts on this forum but, to me, they seem quite complicated and I have no clue what to fill in to make those work.

Can someone tell me what I am doing wrong?
Image
Attachments
Blockly - Sunscreen.jpg
Blockly - Sunscreen.jpg (372.91 KiB) Viewed 592 times
Last edited by Bishop on Sunday 11 June 2017 14:17, edited 1 time in total.

tozzke
Posts: 123
Joined: Friday 02 January 2015 10:22
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Question - Sunscreen blockly

Post by tozzke » Sunday 11 June 2017 14:17

you can't use 'if [switch] = [off or stop]', you'll have to use 'if [switch] = [off] or [switch] = [stop]'

Bishop
Posts: 21
Joined: Sunday 11 June 2017 14:06
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Question - Sunscreen blockly

Post by Bishop » Sunday 11 June 2017 14:18

tozzke wrote:you can't use 'if [switch] = [off or stop]', you'll have to use 'if [switch] = [off] or [switch] = [stop]'
Ok! I will try that!
The rest seems fine to you?

Bishop
Posts: 21
Joined: Sunday 11 June 2017 14:06
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Question - Sunscreen blockly

Post by Bishop » Sunday 11 June 2017 21:04

So far it seems to work!

Does anyone know if I can make something that does:
'if [UV] = [0 for 30 minutes] then [set Awning] = [Open]

I don't know how to build a blockly that counts the amount of minutes that UV has been 0.

User avatar
Derik
Posts: 1890
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Question - Sunscreen blockly

Post by Derik » Sunday 11 June 2017 21:14

you have to test your blockleys in a very small setup..
First try a working uv switch
Try a time between setting
try x and y etc.

Read the LOG everytime....
Is there in the log the setting you like?

Then make step by step the master blockley.
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups

tozzke
Posts: 123
Joined: Friday 02 January 2015 10:22
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Question - Sunscreen blockly

Post by tozzke » Monday 12 June 2017 6:43

Bishop wrote:So far it seems to work!

Does anyone know if I can make something that does:
'if [UV] = [0 for 30 minutes] then [set Awning] = [Open]

I don't know how to build a blockly that counts the amount of minutes that UV has been 0.
Blockly can't do that directly in the if-statement, lua can.
You could however use a variable which you put in a blockly (Time) which will look something like this:

Code: Select all

If [UV] = [0] and [Awning] = [Closed] and [DummyVariable] = [1]
Do [Set [DummyVariable] = [0]]
   [Set [Awning] = [Off] After 1800 seconds]
Else if [UV] ≠ [0] and [Awning] = [Closed] and [DummyVariable] ≠ [1]
   Do [Set [DummyVariable] = [1]]
   [Set [Awning] = [On]]
You could add this to an if-statement which you already have (the first from your screenshot) and you'll have to change this variable in another if-statement to 1 (or the other way around, whatever you like) when the screen is down (the 2nd and 3rd from your blockly).
This way the screen will go up after 30 minutes when the UV = 0 and won't retrigger because of the variable.
When the 'Else if' triggers, it sets the screen to open again (which it already is) and aborts the '[Set [Awning] = [Off] After 1800 seconds]'

Bishop
Posts: 21
Joined: Sunday 11 June 2017 14:06
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Question - Sunscreen blockly

Post by Bishop » Monday 12 June 2017 16:33

tozzke wrote:Blockly can't do that directly in the if-statement, lua can.
You could however use a variable which you put in a blockly (Time) ... etc
I read what you said a couple of times and I think I get it. The variable you mention is a line of text I can make up? Like "UVTimer"?

So it would become:

Code: Select all

If [UV] = [0] and [Awning] = [Closed] and [UVTimer] = [1]
 Do [Set [UVTimer] = [0]]
   [Set [Awning] = [Off] After 1800 seconds]
Else if [UV] ≠ [0] and [Awning] = [Closed] and [UVTimer] ≠ [1]
   Do [Set [UVTimer] = [1]]
   [Set [Awning] = [On]]

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest