Turn Light On Topic is solved
Moderator: leecollings
-
- Posts: 21
- Joined: Friday 26 May 2017 20:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Turn Light On
Hi,
I have a number of 'Light' devices. I can turn the light on and off manually by clicking the 'bulb' icon on the device. However if I am creating a Blockly script and use the 'Logic' 'Set' statement to set the device to 'On' it won't turn the light on. If I create a scene or group with the light device I can turn it on using the scene/group set statement.
Am I supposed to be able to turn a light on using the Logic 'Set' statement? If yes any idea why its not working?
I have a number of 'Light' devices. I can turn the light on and off manually by clicking the 'bulb' icon on the device. However if I am creating a Blockly script and use the 'Logic' 'Set' statement to set the device to 'On' it won't turn the light on. If I create a scene or group with the light device I can turn it on using the scene/group set statement.
Am I supposed to be able to turn a light on using the Logic 'Set' statement? If yes any idea why its not working?
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Turn Light On
Should work, here is an example that works:-

Can you show your Blockly?
Can you show your Blockly?
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: 21
- Joined: Friday 26 May 2017 20:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Turn Light On
Hi,
Here is the test Blockly - very simple Here are the current states The lamp stays off.
My Domoticz info is;
Version: 3.5877
Build Hash: 15b013c
Compile Date: 2016-11-10 15:44:33
Here is the test Blockly - very simple Here are the current states The lamp stays off.
My Domoticz info is;
Version: 3.5877
Build Hash: 15b013c
Compile Date: 2016-11-10 15:44:33
- tommit01
- Posts: 39
- Joined: Friday 12 July 2013 14:08
- Target OS: Raspberry Pi / ODroid
- Domoticz version: multiple
- Location: Germany / SL
- Contact:
Re: Turn Light On
Hi, please
try to use 'On' tile from blockly category 'Logic' instead of string tile and test it again....
P.S.:
I still don't know why this is still called Blocky ... in so many posts ..it is 'Blockly'
BR
Tommit
try to use 'On' tile from blockly category 'Logic' instead of string tile and test it again....
P.S.:
I still don't know why this is still called Blocky ... in so many posts ..it is 'Blockly'
BR
Tommit
1 x RPi3
4 x RPI
3 x RPi2
1 x RPI2 + Win 10 IoT (experimental device)
2 x RPI2 Raspbian "Jessie" + Domoticz (for tenants)
2 x RPI OSMC @ 1GHz
1 RPi Zero W + Cam NOIR
1 RPi Zero W + Cam
RFXtrx 433 FW 1015
RFXtrx 433 E FW 1020
4 x RPI
3 x RPi2
1 x RPI2 + Win 10 IoT (experimental device)
2 x RPI2 Raspbian "Jessie" + Domoticz (for tenants)
2 x RPI OSMC @ 1GHz
1 RPi Zero W + Cam NOIR
1 RPi Zero W + Cam
RFXtrx 433 FW 1015
RFXtrx 433 E FW 1020
- heggink
- Posts: 978
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: Turn Light On
Indeed. Unlike lua, switch devices need a state, not a string indicating the state.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
-
- Posts: 21
- Joined: Friday 26 May 2017 20:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Turn Light On
Yep - thanks guys that sorted it.
Re: Turn Light On
Hahaha, even this forum is called Blocky. I've always thought it was Blocky, never noticed the additional Ltommit01 wrote:Hi, please
P.S.:
I still don't know why this is still called Blocky ... in so many posts ..it is 'Blockly'
-
- Posts: 21
- Joined: Friday 26 May 2017 20:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Turn Light On
Hi Guys,
A couple of follow up questions.
Although the Blockly below works - should I be using the switch states rather than a string? Also in StanHD's post in this thread his 'and' condition allows for two lines thus making the test format neater. I can only see an inline 'and' condition. How can I format my Blockly's like StanHD?
A couple of follow up questions.
Although the Blockly below works - should I be using the switch states rather than a string? Also in StanHD's post in this thread his 'and' condition allows for two lines thus making the test format neater. I can only see an inline 'and' condition. How can I format my Blockly's like StanHD?
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Turn Light On
Right Click on the "And" block, then select "External Inputs"Also in StanHD's post in this thread his 'and' condition allows for two lines thus making the test format neater. I can only see an inline 'and' condition. How can I format my Blockly's like StanHD?

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: 21
- Joined: Friday 26 May 2017 20:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Turn Light On
Many thanks - I didn't even know you could right click on the Blockly elements.
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Turn Light On
See working Blockly below. No strings


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: 21
- Joined: Friday 26 May 2017 20:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Turn Light On
See if I've got this right 
It the LR PIR is on AND (LR Lights Auto=on AND LR Updown Light=off)
AND
Living Room < 100
SET Updown Lights Level= 5%
I need to learn Blockly better than I have.
Would this smoke/heat detection work?
Basically if any of the smoke or heat detectors are ON then Set Smoke_Alarm variable to 'On', turn the Alarm Lights On and send a notification.
Else
If all the Heat and smoke sensors are Off set the variable Smoke_Alarm to 'Off' after 6 mins

It the LR PIR is on AND (LR Lights Auto=on AND LR Updown Light=off)
AND
Living Room < 100
SET Updown Lights Level= 5%
I need to learn Blockly better than I have.
Would this smoke/heat detection work?
Basically if any of the smoke or heat detectors are ON then Set Smoke_Alarm variable to 'On', turn the Alarm Lights On and send a notification.
Else
If all the Heat and smoke sensors are Off set the variable Smoke_Alarm to 'Off' after 6 mins
- StanHD
- Posts: 347
- Joined: Friday 12 July 2013 16:09
- Target OS: Windows
- Domoticz version:
- Location: East Sussex, UK
- Contact:
Re: Turn Light On
Yes the interpretation of my Blockly is correct
Regarding your Blockly, it looks OK to me, however I always use numbers in user variables, but that's just me. Perhaps you could mock something up with some dummy switches to test?

Regarding your Blockly, it looks OK to me, however I always use numbers in user variables, but that's just me. Perhaps you could mock something up with some dummy switches to test?
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: 21
- Joined: Friday 26 May 2017 20:25
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Contact:
Re: Turn Light On
Thanks again.
My Blockly did work when the 'AND' and 'OR' conditions were all inline. Just not sure is nesting them changed the interpretation. I know the order of evaluation is important.
I'll press the smoke alarm test when I get home.
My Blockly did work when the 'AND' and 'OR' conditions were all inline. Just not sure is nesting them changed the interpretation. I know the order of evaluation is important.
I'll press the smoke alarm test when I get home.
Who is online
Users browsing this forum: No registered users and 1 guest