My first blockly script

Moderator: leecollings

Post Reply
ElMyggo
Posts: 10
Joined: Sunday 01 November 2020 20:48
Target OS: Windows
Domoticz version: 2024.4
Location: Sweden
Contact:

My first blockly script

Post by ElMyggo »

Hi, i am complety novise on this script thing and i have start to setup Domoticz on a Raspberry with some switches and have try this scripts and its seems to work but is it correct?

First i found this example and i created a virtual switch if its night or not
natt.JPG
natt.JPG (20.4 KiB) Viewed 585 times
Then i want to start lightgroup at time 05:05 but only if there is night, then i want to switch of at 05:35 so i create this:
belysning.JPG
belysning.JPG (25.45 KiB) Viewed 585 times
Is this correct way to do this?
AllesVanZelf
Posts: 265
Joined: Monday 05 February 2018 8:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 12467
Location: Netherlands, near Haarlem
Contact:

Re: My first blockly script

Post by AllesVanZelf »

What also is possible is switching 'Natt' with a timer in the switch itself. I found out that this is working more reliable.
Domoticz 2020.1 (12230) on Raspberry Pi 3B with Raspian Buster. Besides Domoticz, Rpi is running Pi-Hole.
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

Re: My first blockly script

Post by Treve »

I think this will do the job after making a variabele called 'Natt'

Belysning.jpg
Belysning.jpg (41.8 KiB) Viewed 560 times
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
ElMyggo
Posts: 10
Joined: Sunday 01 November 2020 20:48
Target OS: Windows
Domoticz version: 2024.4
Location: Sweden
Contact:

Re: My first blockly script

Post by ElMyggo »

Ok i do a test whitout the virtual switch and use variable instead, thanks for help so far :-)
User avatar
Treve
Posts: 107
Joined: Thursday 05 November 2015 10:37
Target OS: Raspberry Pi / ODroid
Domoticz version: v4.11474
Location: Rotterdam, NL
Contact:

My first blockly script

Post by Treve »

With use of a variable you can’t accidentally press the button.
There will be only a problem when Sunrise time is between 05:05 and 05:35. But you have a few months to find a solution for that.
For example: if Time is > 05:05 and < 05:35
- RFXtrx433E,
- AEON Labs ZW090 Z-Stick Gen5 EU
- Hue v2.1
- Raspberry Pi 3 Model B, Raspbian Stretch Full on USB-Stick.
- Domoticz 4.11474
Devices: KaKu, Z-Wave, Hue.

for testing:
Raspberry 4, 2GB, SSD
Domoticz 2022.1
Ikea Hub, Fyrtur curtain
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest