Dimmer level as condition in Blocky

Moderator: leecollings

Post Reply
gryzli133
Posts: 14
Joined: Wednesday 23 August 2017 22:14
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Dimmer level as condition in Blocky

Post by gryzli133 »

Hi there, I have 20 Blinds running using MySensors program, that is counting time running up and down, giving me percentage as result. Now I have blocky script controlling the blinds. I would like to dimmer the blinds every evening to 50%, but if there are already below that value it should not run. I didn't find an option to do it with blocky. If I do like:
DomoticzBlindsCondition.PNG
DomoticzBlindsCondition.PNG (10.21 KiB) Viewed 3659 times
the condition is always true, means it does not metter if I;m already below 50% or not.

How to get the actual level into the Blocky If condition?
User avatar
StanHD
Posts: 347
Joined: Friday 12 July 2013 16:09
Target OS: Windows
Domoticz version:
Location: East Sussex, UK
Contact:

Re: Dimmer level as condition in Blocky

Post by StanHD »

The nested blockly wont work and also you cannot use the "if do" statement with the blue gear icon without an "else if".

Try using the plain "if do" block alone with the 2 conditions in an "and " block:-

If x=on and y > level 50%
Do Set y = level 50%
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
ggorzki
Posts: 2
Joined: Saturday 23 May 2020 0:04
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Contact:

Re: Dimmer level as condition in Blocky

Post by ggorzki »

I am trying to implement something similar, but it looks that Level % as a condition in IF does not work, it throws an error "attempt to compare string with number". I found a few threads confirming this, but I did not find any signs of workaround.
@gryzli133, did you solve it somehow in blockly?
Fox27
Posts: 5
Joined: Monday 09 November 2020 23:27
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Dimmer level as condition in Blocky

Post by Fox27 »

hallo, I have the same problem.
i used a blocky with a dimmer:
"if dimmer in room > 10% then switch lamp outside = on" It does not work. :x
If I uses a regular switch:
"if switch in room2 = on then switch lamp outside = on" works :?
User avatar
Louk
Posts: 17
Joined: Sunday 14 July 2019 13:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2 β
Location: Alkmaar, The Netherlands
Contact:

Re: Dimmer level as condition in Blocky

Post by Louk »

OK, this is an old thread, but it still has an open end: No solution or workaround... :cry:

As I ran into the same issue with the latest beta version today, I wonder what the status of this issue is???

Is there a workaround (like some kind of conversion between numbers and strings)?
Have fun,
Louk
solarboy
Posts: 320
Joined: Thursday 01 November 2018 19:47
Target OS: Raspberry Pi / ODroid
Domoticz version: 2024.6
Location: Portugal
Contact:

Re: Dimmer level as condition in Blocky

Post by solarboy »

Blockly is great for simple events, and also for learning but do yourself a favour and learn dzvents, so so much more powerful and once you get past the initial learning curve it is actually easier (cut and paste, scrolling vs zooming etc etc).

Also, when a device changes idx you can still use the same script if the device name is the same, unlike blockly.

The dzvents wiki isn't great, it has all the details but not the supposedly obvious things but there are lots of example scripts and solutions in the forums
Intel NUC with Ubuntu Server VM (Proxmox),mosquitto(docker),RFXtrx433E,zwavejsUI (docker),Zigbee2mqtt(docker),SMA Hub (docker),Harmony Hub plugin, Kodi plugin,Homebridge(docker)+Google Home,APC UPS,SMA Modbus,Mitsubishi MQTT, Broadlink,Dombus
User avatar
Louk
Posts: 17
Joined: Sunday 14 July 2019 13:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.2 β
Location: Alkmaar, The Netherlands
Contact:

Re: Dimmer level as condition in Blocky

Post by Louk »

Thanks, and maybe I do this when I need too...

However, I was not only replying for my own benefit; I suppose I'm not the only one having this problem (wanting to test on a dimmer level) and not every Domoticz user has programming skills. For those users, Blocky is there only way out.

So my suggestion is to add a class dimmer that will return or set the dim level. Or even better to add two sub classes to this dimmer class (e.g. Dimmer.State and Dimmer.Level) where every class is a puzzle piece in Blocky of course.

The reason I want to check a dimmer's level is probably also very common: The LED lights behind this dimmer only start lightning when the level is above 15%, but that is too much light for the room most of the time, so we lower it to about 5%. When the lights are switched off and on again, it stays dark. So I designed a script that would test if the dimmer is ON and if the level is below 15%. In that case it should set the level 15% and, after a little delay, back to the original level. Quite simple, but not possible in Blocky because of this issue :( ...
Have fun,
Louk
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests