Hall lights

Moderator: leecollings

Post Reply
Ronnyboy
Posts: 10
Joined: Monday 25 January 2016 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Hall lights

Post by Ronnyboy »

Hello
Can someneone tell me what i'm doing wrong with this blockly.

This is the log
21:59:58.221 Error: EventSystem: Lua script error (Blockly), Name: Hal verlichting na zessen_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: 'then' expected near 'comparevariable
And this is the blockly
Attachments
verlichting.jpg
verlichting.jpg (49.46 KiB) Viewed 4998 times
Last edited by Ronnyboy on Tuesday 26 January 2016 13:12, edited 1 time in total.
User avatar
jvdz
Posts: 2267
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Hall lights

Post by jvdz »

Your time condition looks wrong. You have:
Time >18:00 < 23:59

Think that needs to be :
Time > 18:00 And Time < 23:59

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Ronnyboy
Posts: 10
Joined: Monday 25 January 2016 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Hall lights

Post by Ronnyboy »

Changed it,but didnt work!
User avatar
nayr
Posts: 354
Joined: Tuesday 11 November 2014 18:42
Target OS: Linux
Domoticz version: github
Location: Denver, CO - USA
Contact:

Re: Hall lights

Post by nayr »

If (Voordeurcontact = Open and (Time > (( 18:00 < 23:59) & (hal = Off)))

is what you have in your screenshot, totally invalid logic

You have your ands nested incorrectly, try something that looks like:

If - (vooordeurcontact = open) and (hal = off) and ((time > 18:00) and (time < 23:59))
Debian Jessie: CuBox-i4 (Primary) w/Static Routed IP and x509 / BeagleBone with OpenSprinkler / BeagleBone Planted Aquarium / 3x Raspbery Pi2b GPIO Slaves
Elemental Theme - node-domoticz-mqtt - Home Theatre Controller - AndroidTV Simple OSD Remote - x509 TLS Auth
Ronnyboy
Posts: 10
Joined: Monday 25 January 2016 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Hall lights

Post by Ronnyboy »

hmm.. tried that to,but no response!
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Hall lights

Post by StanHD »

Hi,

The top one is currently my working Blockly. I have edited it to the lower one to emulate your Blockly.
Image

Might help?
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
Ronnyboy
Posts: 10
Joined: Monday 25 January 2016 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Hall lights

Post by Ronnyboy »

strange,
where did you get that first "and" block from
i cant find it
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Hall lights

Post by StanHD »

Right Click the block & select "External Inputs". It works the same but I find it easier to understand when there are nested "And" / "Or" operators.
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
Ronnyboy
Posts: 10
Joined: Monday 25 January 2016 21:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Hall lights

Post by Ronnyboy »

YES that works !! Thank you very much!
behave49
Posts: 10
Joined: Thursday 08 March 2018 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Hall lights

Post by behave49 »

Having the same problem, can't see the solution image anymore.
Can someone help me out here
User avatar
jvdz
Posts: 2267
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

Re: Hall lights

Post by jvdz »

I would help when you post your script/blockly logic so we can see what is happening.

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
behave49
Posts: 10
Joined: Thursday 08 March 2018 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Hall lights

Post by behave49 »

Wow didnt see youre reply till now haha.

Here is my screenshot. What i want is to give me a notification if my dore is open at night.
I get this error..2019-05-08 17:46:59.429 Error: EventSystem: Lua script error (Blockly), Name: Nacht alarm deur open_1 => [string "result = 0; weekday = os.date('*t')['wday']; ..."]:1: 'then' expected near 'comparevariable'

I get this error with al my blocky scripts if i want to enter a time schedule
Attachments
deuropen.jpg
deuropen.jpg (50.01 KiB) Viewed 3178 times
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Hall lights

Post by pvm »

Using a time frame which passes the 0:00 barrier never worked for me.
I created a dummy switch, turn it on and off using timers and use that switch in blockly
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
behave49
Posts: 10
Joined: Thursday 08 March 2018 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Hall lights

Post by behave49 »

I tried the time not passing 0:00 but the same error.
Can you tell me ( show me) how you solved that?
pvm
Posts: 550
Joined: Tuesday 17 June 2014 22:14
Target OS: NAS (Synology & others)
Domoticz version: 4.10538
Location: NL
Contact:

Re: Hall lights

Post by pvm »

behave49 wrote: Thursday 09 May 2019 14:46 I tried the time not passing 0:00 but the same error.
Can you tell me ( show me) how you solved that?
Add dummy hardware
Add dummy switch
Set timer on that
In your blockly check switch == on

Do you have a specific question on this?
Synology NAS, slave PI3, ZWave (Fibaro), Xiaomi zigbee devices, BTLE plant sensor, DzVents, Dashticz on tablet, Logitech Media Server
tozzke
Posts: 135
Joined: Friday 02 January 2015 9:22
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Hall lights

Post by tozzke »

You Blockly is wrong, make it like this:
Image

Your 'On' block is at the wrong location and timewise Domoticz looks at one day only. It can't be past 17:30 and at the same time before 5:30 on the same day, therefor you need to use 'or'
behave49
Posts: 10
Joined: Thursday 08 March 2018 13:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Hall lights

Post by behave49 »

I tried the "or" but did not work, same error
tozzke
Posts: 135
Joined: Friday 02 January 2015 9:22
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: Hall lights

Post by tozzke »

behave49 wrote: Friday 10 May 2019 11:19 I tried the "or" but did not work, same error
Could you show your Blockly? I think something else is still wrong. The 'Open' block in your opening post/first Blockly and the 'On' block in your second screenshot are both positioned incorrectly. As @nayr already said but you didn't follow his advice.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest