Nightlights, on movement, between 20:35 and 06:45

Moderator: leecollings

Post Reply
Falken
Posts: 6
Joined: Thursday 22 February 2018 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8934
Contact:

Nightlights, on movement, between 20:35 and 06:45

Post by Falken »

Hi!

I am very new to the Blockly universe, and even more new to the Domoticz automations system.

I am trying to create my first Blockly script, that I want to control a light scheme (Philips Hue) when movement is detected by a simple 433 mhz motion detector. It should only activate between 20:35 and 06:45.

WHAT am I doing wrong? I have redone this script 45 times, so if this result looks like complete bulls*it, my explanation is that I have re done it so many time that it broke.. :lol:
Attachments
Skärmklipp.PNG
Skärmklipp.PNG (14.04 KiB) Viewed 1484 times
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Nightlights, on movement, between 20:35 and 06:45

Post by StanHD »

Try:-

If [(Rorel....... = On) and (Time >= 20:35 Or Time <= 06:45)]

Note that you also have the second time set to greater, rather than less.



Last edited by StanHD on Thursday 22 February 2018 21:57, edited 1 time in total.
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
i000
Posts: 39
Joined: Saturday 11 February 2017 8:04
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Nightlights, on movement, between 20:35 and 06:45

Post by i000 »

Hi, you can change to this diagram:
If (Motion =on) and ( Time >XX or Time < XX)
User avatar
Domosapiens
Posts: 232
Joined: Wednesday 20 August 2014 12:08
Target OS: Windows
Domoticz version: V3.5981
Location: NL
Contact:

Re: Nightlights, on movement, between 20:35 and 06:45

Post by Domosapiens »

Start with the AND block
see
https://www.domoticz.com/wiki/Blockly
Last edited by Domosapiens on Friday 23 February 2018 23:23, edited 1 time in total.
Win Vista&7; 1#Aeon Z-Stick S2; 1#Aeotec Z-Sick Gen5, 6#Fib.FGBS001; 24#DS18B20; 8#Everspr.AN158-2; 3#Philio PAN04; 1#Philio PAN06, 1#YouLess El; 1#Fib.FGWPE; 1#ZME_RC2; 2#FAK_ZWS230, 2#Quib.ZMNHCDx, 1#Quib.ZMNHDD1, 7#EM6555
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Nightlights, on movement, between 20:35 and 06:45

Post by StanHD »

Will this help?

The lower example uses "External Inputs" on the And block, which I find easier to understand. That's just a personal choice though. :)

Image
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
markk
Posts: 267
Joined: Tuesday 14 January 2014 14:50
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Nightlights, on movement, between 20:35 and 06:45

Post by markk »

Running Domoticz on Pi3 with RFXtrx433e. LWRF power sockets and dimmer switches. Integrated my existing wirefree alarm PIRs and door contacts with domoticz. Geofencing with Pilot. Harmony Hub. Tado for Heating. Now playing with mysensors.
Falken
Posts: 6
Joined: Thursday 22 February 2018 21:20
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8934
Contact:

Re: Nightlights, on movement, between 20:35 and 06:45

Post by Falken »

StanHD wrote:Try:-

If [(Rorel....... = On) and (Time >= 20:35 Or Time <= 06:45)]

Note that you also have the second time set to greater, rather than less.
Haha, that's what I meant when I said I scripted it to s*it! I tried so many combinations not knowing what I was doing that it eventually broke.
StanHD wrote:Will this help?

The lower example uses "External Inputs" on the And block, which I find easier to understand. That's just a personal choice though. :)

Image
This does indeed help! It's working now!

Thanks to all of you who have responded. Great to know that this forum is out there with talented souls like your selves!

Skickat från min SM-G955F via Tapatalk

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest