Blockly examples

denman091
Posts: 12
Joined: Monday 31 July 2017 15:22
Target OS: Raspberry Pi
Domoticz version: 3.8153
Location: Pijnacker
Contact:

Re: Blockly examples

Post by denman091 » Thursday 07 December 2017 20:39

He,

i have one virtual switch for my smartphone and one for my wifes smartphone. if one of us is at home (connect with the wifi) the virtual switch turns on.
Now i want a variable that goes to "1" if one of the two virtual switches is on. and when both virtual switches are off (so we are not at home) the variable need to change to "0".

I made a user variable with type: Float and name "Thuis".
i made the following event:
Image
But the variable is not change.
I want to to use the variable state for other events.

Why is this not working?

Lolo
Posts: 1
Joined: Sunday 10 December 2017 19:51
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by Lolo » Sunday 10 December 2017 20:51

Termostato virtual con Blockly.

Hola, este es mi termostato virtual con Blockly, la temperatura es tomada con un DHT22 conectado en un ESP8266, el radiador está conectado a un enchufe “Aeon Labs Smart Switch 6”, el termostato es “virtual”, en realidad son dos termostatos virtuales, uno para regular la temperatura mínima, y otro para regular la temperatura máxima.

Es muy sencillo de configurar, con un dedo desde el móvil eliges el rango de temperatura que quieras en cada momento del día, sin complicaciones de scripts en Lua.

Funcionamiento:

Cuando el interruptor Virtual “termostato Desvan” está en “On”, el enchufe "Frigo On/Off" se encenderá y apagara conforme a la temperatura mínima y máxima configuradas en los termostatos virtuales “Termostato Desvan –“ (minimo) y “Termostato Desvan +” (máximo).

Cuando el interruptor Virtual “termostato Desvan” está en “Off”, el enchufe "Frigo On/Off" NO será regulado por los termostatos virtuales “Termostato Desvan –“ (minimo) y “Termostato Desvan +” (máximo).

Translation:

Virtual thermostat with Blockly.

Hello, this is my virtual thermostat with Blockly, the temperature is taken with a DHT22 connected to an ESP8266, the radiator is connected to a socket "Aeon Labs Smart Switch 6", the thermostat is "virtual", they are actually two virtual thermostats , one to regulate the minimum temperature, and another to regulate the maximum temperature.

It is very simple to configure, with a finger from the mobile you choose the temperature range you want at each moment of the day, without complications of Lua scripts.

Functioning:

When the Virtual switch “termostato Desvan” is "On", the "Frigo On/Off" plug will turn on and off according to the minimum and maximum temperature set in the virtual thermostats " Termostato Desvan –" (minimum) and " Termostato Desvan +" (maximum).

When the Virtual Switch " termostato Desvan " is set to "Off", the "Frigo On/Off" plug will NOT be regulated by the virtual thermostats " Termostato Desvan –" (minimum) and " Termostato Desvan +" (maximum).


Image

Image

Spitfire
Posts: 23
Joined: Thursday 29 December 2016 10:16
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by Spitfire » Saturday 16 December 2017 19:28

denman091 wrote:
Thursday 07 December 2017 20:39
He,

i have one virtual switch for my smartphone and one for my wifes smartphone. if one of us is at home (connect with the wifi) the virtual switch turns on.
Now i want a variable that goes to "1" if one of the two virtual switches is on. and when both virtual switches are off (so we are not at home) the variable need to change to "0".

I made a user variable with type: Float and name "Thuis".
i made the following event:
Image
But the variable is not change.
I want to to use the variable state for other events.

Why is this not working?
I think its safe to say that ”Else if” in Blocky does not work as any other implementations of it in ANY language. It’s just a stack of if:s...so...DO NOT USE IT! I would not be suprised if it’s the most asked about issue on this board. So much trouble would have been saved if this was fixed.

BullFrog
Posts: 6
Joined: Sunday 03 December 2017 19:41
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post by BullFrog » Wednesday 20 December 2017 2:31

What is the method to Turn ON/OFF with the same command? For example I want to turn off the lights with Cube shake, and also wanna turn on the lights when they are off with the same command, cube shake. If Do and Else IF does nothing.

blauwebuis
Posts: 258
Joined: Wednesday 21 December 2016 10:11
Target OS: Raspberry Pi
Domoticz version: current
Contact:

Re: Blockly examples

Post by blauwebuis » Thursday 18 January 2018 18:13

The new Aurora theme has a blockly import and export feature. That might be useful for the people in this thread :-)

viewtopic.php?f=8&t=20960

Xztraz
Posts: 31
Joined: Tuesday 31 January 2017 22:54
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by Xztraz » Saturday 10 February 2018 17:02

Made a Blockly section in the Wiki.
www.domoticz.com/wiki/Blockly

Good place to collect experiences with blockly and it's rather own behavior.

blauwebuis
Posts: 258
Joined: Wednesday 21 December 2016 10:11
Target OS: Raspberry Pi
Domoticz version: current
Contact:

Re: Blockly examples

Post by blauwebuis » Sunday 18 February 2018 17:22

nice work! Could you explain a bit more how the trigger function works? I still don't quite understand what that does :-D

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest