Blockly examples

Must be cleaned all topics go to the right subforum
HM31
Posts: 8
Joined: Friday 04 August 2017 16:13
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post by HM31 » Friday 04 August 2017 16:21

Wirehead wrote:
Image
This event uses the script that allows "presence checking" by means of an IP. I have a smart TV; which in turn is connected to the network. If the lights are on in the TV room and it's after sunset; and the TV is on; then dim those lights to 20% - giving you a pleasant background lighting. 8-) (again, you might want to open the image in a new frame - as it's quite wide)
Want to do the same but only if my actual dim level is above 20%. How can I test actual dim level in Blocky ?

tozzke
Posts: 115
Joined: Friday 02 January 2015 10:22
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Blockly examples

Post by tozzke » Monday 14 August 2017 12:25

HM31 wrote:
Friday 04 August 2017 16:21
Wirehead wrote:
Image
This event uses the script that allows "presence checking" by means of an IP. I have a smart TV; which in turn is connected to the network. If the lights are on in the TV room and it's after sunset; and the TV is on; then dim those lights to 20% - giving you a pleasant background lighting. 8-) (again, you might want to open the image in a new frame - as it's quite wide)
Want to do the same but only if my actual dim level is above 20%. How can I test actual dim level in Blocky ?
I got an error when I checked on a certain dim level in the if statement. I think the only way is to add a variable which you give the same value as you do the dimmer in question. You will have to switch the lights with scripts in which you change the value of the variable because it won't be updatet automatically.

matteos1
Posts: 41
Joined: Monday 08 May 2017 17:29
Target OS: -
Domoticz version:
Contact:

Re: Blockly examples

Post by matteos1 » Tuesday 22 August 2017 10:10

this is my scenario
light open between sunset and 23.00 and if sensor lux xiaomi is under 20
only notification in kodi not work :(
lucigiardino.jpg
lucigiardino.jpg (38.19 KiB) Viewed 674 times

videodrome
Posts: 56
Joined: Wednesday 11 May 2016 16:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by videodrome » Friday 25 August 2017 0:22

I've set up the plugin to monitor my UPS with this switch
Image
When the AC is off the status is Backup Power"

I'd like to send a message when the status of UPS goes to "Backup Power" with this script but it doesn't work, why?
Image

snuiter
Posts: 32
Joined: Saturday 17 June 2017 12:30
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: Blockly examples

Post by snuiter » Friday 25 August 2017 8:27

Are you maybe using the latest beta version as there are some setups that have notification issues in the latest release.

videodrome
Posts: 56
Joined: Wednesday 11 May 2016 16:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by videodrome » Friday 25 August 2017 9:23

snuiter wrote:
Friday 25 August 2017 8:27
Are you maybe using the latest beta version as there are some setups that have notification issues in the latest release.
No, i'm using the last stable version; I think the problem is in my script.

snuiter
Posts: 32
Joined: Saturday 17 June 2017 12:30
Target OS: Raspberry Pi
Domoticz version: beta
Contact:

Re: Blockly examples

Post by snuiter » Friday 25 August 2017 11:32

A few suggestions
* does the status of the switch change from online to offline ?
* which notification system are you using and does it work with other scripts
* did you check the settings/notifications tab if your notification system used in this blocky is enabled and configured correctly
* you can try if notification is working using a simple light switch, so on/off status change triggers a notification
Often best is to try a simple script to find out what is working and what not. I wonder if your notification system is working at all and if the switch doesn't change from online to offline status

matteos1
Posts: 41
Joined: Monday 08 May 2017 17:29
Target OS: -
Domoticz version:
Contact:

Re: Blockly examples

Post by matteos1 » Saturday 26 August 2017 9:49

Cattura.PNG
Cattura.PNG (55.5 KiB) Viewed 578 times
this is mine for living room.
only a question is it possible add the set group .... after (3) minute ?

Phuturist
Posts: 9
Joined: Sunday 28 June 2015 19:16
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post by Phuturist » Monday 28 August 2017 15:49

I'm just starting out with Domoticz and Blocky so sorry about the newbish question but is there a way to send the value of a sensor as a parameter in the open URL block?

videodrome
Posts: 56
Joined: Wednesday 11 May 2016 16:11
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by videodrome » Tuesday 29 August 2017 2:07

snuiter wrote:
Friday 25 August 2017 11:32
A few suggestions
* does the status of the switch change from online to offline ?
* which notification system are you using and does it work with other scripts
* did you check the settings/notifications tab if your notification system used in this blocky is enabled and configured correctly
* you can try if notification is working using a simple light switch, so on/off status change triggers a notification
Often best is to try a simple script to find out what is working and what not. I wonder if your notification system is working at all and if the switch doesn't change from online to offline status
Stupid me...
the correct script is: if APC status mode is different from "On Line"
then message AC interruption
else if APC status mode is different from "Backup Power"
then message the AC is restored

Nautilus
Posts: 639
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Blockly examples

Post by Nautilus » Tuesday 29 August 2017 9:46

Edit: Sorry, read the question a bit hastily, thought it was about notifications but it was about the "OpenURL" :) Well, it could still work but doubt it and I'm afraid I don't know if there is any officially supported way. With LUA you can do it of course...

Original message:
============================================================
Phuturist wrote:
Monday 28 August 2017 15:49
I'm just starting out with Domoticz and Blocky so sorry about the newbish question but is there a way to send the value of a sensor as a parameter in the open URL block?
I hope this helps: https://www.domoticz.com/wiki/Events#Th ... _interface
You can use expressions in your notifications/email and SMS messages like:

"My temperature is {{temperaturedevice[1234]}} degrees, and the humidity is {{humiditydevice[1234]}} %"

Possible expressions:

temperaturedevice
dewpointdevice
humiditydevice
barometerdevice
utilitydevice
weatherdevice
raindevice
rainlasthourdevice
uvdevice
winddirdevice
windspeeddevice
windgustdevice
variable

Phuturist
Posts: 9
Joined: Sunday 28 June 2015 19:16
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Blockly examples

Post by Phuturist » Tuesday 29 August 2017 19:03

Nautilus wrote:
Tuesday 29 August 2017 9:46
Edit: Sorry, read the question a bit hastily, thought it was about notifications but it was about the "OpenURL" :) Well, it could still work but doubt it and I'm afraid I don't know if there is any officially supported way. With LUA you can do it of course...

Original message:
============================================================
Phuturist wrote:
Monday 28 August 2017 15:49
I'm just starting out with Domoticz and Blocky so sorry about the newbish question but is there a way to send the value of a sensor as a parameter in the open URL block?
I hope this helps: https://www.domoticz.com/wiki/Events#Th ... _interface
You can use expressions in your notifications/email and SMS messages like:

"My temperature is {{temperaturedevice[1234]}} degrees, and the humidity is {{humiditydevice[1234]}} %"

Possible expressions:

temperaturedevice
dewpointdevice
humiditydevice
barometerdevice
utilitydevice
weatherdevice
raindevice
rainlasthourdevice
uvdevice
winddirdevice
windspeeddevice
windgustdevice
variable
Thanx, I decided to go with dzVents scripts though, not such a steep learn curve ...

Nautilus
Posts: 639
Joined: Friday 02 October 2015 12:12
Target OS: Raspberry Pi
Domoticz version: beta
Location: Finland
Contact:

Re: Blockly examples

Post by Nautilus » Tuesday 29 August 2017 23:50

A good choice I'm sure as well...:)

Benneton
Posts: 8
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by Benneton » Wednesday 13 September 2017 22:58

Hi,

Just build a small blocky script to turn on my lights when it gets dark, use philips Hue motion/dusk sensor.
First line is to switch lights on with the group setting when dusk sensor goes on and time is after 07:15 and before 23:15
second event is when the motion sensor detects motion to let lights in Hal and overloop burn at 50% for 2 minutes, could not use group so did it per light.
Third event is to switch lights of when dusk sensor is of or time is after 23:15 before 07:15.
Script seems to work but issue is that when motion is detected lights go to 50% but only for 30 to 45 seconds it varies when I messured.
Attached my blocky script. I most likely make an error in my reasoning with the script. help appreciated :)
Attachments
Hal.png
Blocky script
Hal.png (53.62 KiB) Viewed 223 times

User avatar
StanHD
Posts: 531
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Blockly examples

Post by StanHD » Thursday 14 September 2017 7:43

Benneton wrote:Hi,

Just build a small blocky script to turn on my lights when it gets dark, use philips Hue motion/dusk sensor.
First line is to switch lights on with the group setting when dusk sensor goes on and time is after 07:15 and before 23:15
second event is when the motion sensor detects motion to let lights in Hal and overloop burn at 50% for 2 minutes, could not use group so did it per light.
Third event is to switch lights of when dusk sensor is of or time is after 23:15 before 07:15.
Script seems to work but issue is that when motion is detected lights go to 50% but only for 30 to 45 seconds it varies when I messured.
Attached my blocky script. I most likely make an error in my reasoning with the script. help appreciated :)
Not sure if this will solve the timing problem, but your time period on the last "Else If" should be:-

"after 23:15 OR before 07:15".

This is because Domoticz changes to the next day at 00:00. So the time can't be:-

"after 23:15 (and before 00:00) AND (after 00:00 and) before 07:15.

Apologies if this does not fix the problem but worth a try?
Domotica - Intel nuc Celeron, Domoticz - Windows, RFXTRX433E. 1-Wire USB. Lan Relay Boards, Aeon Z-Stick Gen 5, Evohome HGI80, Milight WiFi, MySensors Ethernet Gateway, Harmony Hub, Broadlink RM2, HA-Bridge with Amazon Echo / Alexa.

Benneton
Posts: 8
Joined: Thursday 08 December 2016 10:46
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by Benneton » Thursday 14 September 2017 8:51

Not sure if this will solve the timing problem, but your time period on the last "Else If" should be:-

"after 23:15 OR before 07:15".

This is because Domoticz changes to the next day at 00:00. So the time can't be:-

"after 23:15 (and before 00:00) AND (after 00:00 and) before 07:15.

Apologies if this does not fix the problem but worth a try?
Hi StanHD,

Thanks for the support. Did change the last one to "or", but then for some reason when motion is detected nothing happens.
So I did set this back to "and".
Today I also noticed (could not try yesterday) is that when Dusk sensor is of and motion is detected light will go to 50%, but only for approx. 10 to 15 seconds.

My reasoning is that it is a human interface error and that my logic in thinking is incorrect.
Is there someone out here who has the timer function working correctly i.e. if event happens set light to 50% for x amount of time?

Thanks for the support

Bernard

Stanleyk
Posts: 15
Joined: Tuesday 05 September 2017 1:09
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by Stanleyk » Friday 15 September 2017 13:55

Hello ,

Why this is not work, please ?
Image

chatjozef
Posts: 9
Joined: Monday 12 September 2016 14:19
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by chatjozef » Friday 15 September 2017 14:35

Benneton wrote:
Thursday 14 September 2017 8:51
Not sure if this will solve the timing problem, but your time period on the last "Else If" should be:-

"after 23:15 OR before 07:15".

This is because Domoticz changes to the next day at 00:00. So the time can't be:-

"after 23:15 (and before 00:00) AND (after 00:00 and) before 07:15.

Apologies if this does not fix the problem but worth a try?
Hi StanHD,

Thanks for the support. Did change the last one to "or", but then for some reason when motion is detected nothing happens.
So I did set this back to "and".
Today I also noticed (could not try yesterday) is that when Dusk sensor is of and motion is detected light will go to 50%, but only for approx. 10 to 15 seconds.

My reasoning is that it is a human interface error and that my logic in thinking is incorrect.
Is there someone out here who has the timer function working correctly i.e. if event happens set light to 50% for x amount of time?

Thanks for the support

Bernard

i have the same problem with the HUE bulbs.
Set the lights on with "set level 50% and, set lamp off after 120 seconds. resolved the problem for me.

Maybe it wil work for you/

User avatar
sisaenkov
Posts: 66
Joined: Friday 27 May 2016 7:21
Target OS: Raspberry Pi
Domoticz version: 3.8
Location: Moscow, Russia
Contact:

Re: Blockly examples

Post by sisaenkov » Friday 15 September 2017 15:39

Stanleyk wrote:
Friday 15 September 2017 13:55
Hello ,

Why this is not work, please ?
Image
Add another one condition. Total looks like this:

IF teplota1 < 28 AND Relay1 == OFF THEN Relay1 = On

etc.

Stanleyk
Posts: 15
Joined: Tuesday 05 September 2017 1:09
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Blockly examples

Post by Stanleyk » Friday 15 September 2017 15:52

still not work :(

Image

But I dont see nothing in the log about running script or errors.. is it ok ?

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests