How to select actions that not exist in blockly

Moderator: leecollings

Post Reply
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

How to select actions that not exist in blockly

Post by Ptje »

Hello,

I want to control my airco with the selector I made, but the actions on the buttons of de selector, does not exist. How can I do that action ? I tried it this way, but that does not work. Someone any ideas ?

Greetings,
Peter
Attachments
5nExI3K7QTqHqp9fk3YjHw_thumb_542.jpg
5nExI3K7QTqHqp9fk3YjHw_thumb_542.jpg (217.47 KiB) Viewed 888 times
UNADJUSTEDNONRAW_thumb_543.jpg
UNADJUSTEDNONRAW_thumb_543.jpg (299.75 KiB) Viewed 888 times
tozzke
Posts: 135
Joined: Friday 02 January 2015 9:22
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: Netherlands
Contact:

Re: How to select actions that not exist in blockly

Post by tozzke »

in the do-section you'll have to use the corresponding % (so Set [Chigo huiskamer] Level (%) [10] for 'max cool', 20 for '21 graden cool' etc)

In the if-section you can use the names you gave those percentages
Gerwin
Posts: 84
Joined: Friday 12 August 2016 13:08
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: How to select actions that not exist in blockly

Post by Gerwin »

i have this
Gerwin
Attachments
Blocky3.jpg
Blocky3.jpg (66.02 KiB) Viewed 867 times
blockly1.jpg
blockly1.jpg (95.33 KiB) Viewed 867 times
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: How to select actions that not exist in blockly

Post by Ptje »

Hello,

Thanks for the reactions. You use the selector only as dummy to select a real button in blockly. At my situation the selector is a real selector. It are four learned functions on a broadlink mini.

I want to make a script, that based on several conditions, the selector "Chigo huiskamer" in the right setting switched. Do I have to do that with json ?

Greetings,
Peter
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: How to select actions that not exist in blockly

Post by waaren »

Ptje wrote: Monday 02 September 2019 0:13 I want to make a script, that based on several conditions, the selector "Chigo huiskamer" in the right setting switched. Do I have to do that with json ?
using dzVents would be an option. See below how that could look like. From your profile I cannot see which domoticz version you use.

When not yet familiar with dzVents please start with reading Get started Before implementing (~ 5 minutes). Special attention please for "In Domoticz go to Setup > Settings > Other and in the section EventSystem make sure the checkbox 'dzVents disabled' is not checked. Also make sure that in the Security section in the settings you allow 127.0.0.1 to not need a password. dzVents uses that port to send certain commands to Domoticz. Finally make sure you have set your current location in Setup > Settings > System > Location, otherwise there is no way to determine nighttime/daytime state."

Code: Select all

return {

   on = { 
       timer = {'every minute'}      -- Name of your button
    },           
   execute = function(dz)
        auto = dz.devices('Automatisch').active
        temperature  = dz.devices('Temperatuur huiskamer').temperature
        selector = dz.devices('Temperatuur huiskamer')
        eco = dz.devices('Eco Mode')

        if auto and ( temperature > 22 ) then
            selector.switchSelector(20)
            -- selector.switchSelector('21 graden cool') -- using label name is only possible in dzVents > 2.4.22  
            eco.switchOn()
        elseif auto and ( temperature <= 22.5 ) then
            selector.switchSelector(10)
            -- selector.switchSelector('max cool') -- using label name is only possible in dzVents > 2.4.22  
            eco.switchOn()
        end

    end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Ptje
Posts: 73
Joined: Sunday 06 March 2016 23:56
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Schaijk
Contact:

Re: How to select actions that not exist in blockly

Post by Ptje »

Hello,

Thanks for the answers. I would like to use blockly for my events. Can I switch the button "max cool" for example with a json command in blockly ?

Greetings,
Peter
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest