Page 1 of 1
How to select actions that not exist in blockly
Posted: Sunday 01 September 2019 10:54
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
Re: How to select actions that not exist in blockly
Posted: Sunday 01 September 2019 11:23
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
Re: How to select actions that not exist in blockly
Posted: Sunday 01 September 2019 16:09
by Gerwin
i have this
Gerwin
Re: How to select actions that not exist in blockly
Posted: Monday 02 September 2019 0:13
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
Re: How to select actions that not exist in blockly
Posted: Monday 02 September 2019 1:32
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
}
Re: How to select actions that not exist in blockly
Posted: Wednesday 04 September 2019 20:46
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