Aller au contenu

Recommended Posts

Great! Found it!

 

Is the general thought that the could should now be <Condition>, <Action>?

 

Prev i had lines like this that don't work anymore.

 

--  GEA.add({"Global", "G_SPC_ZONE_INPUT_9", "OPEN"}, -1, "", {{"Global", "G_SPC_AREA_STATUS_1", "SET"},{"Scenario", 188}})

In this case the Global value G_SPC_AREA_STATUS_1 gets "SET".

 

What about multiple conditions like this? Should the all be move to the "left?

 

 GEA.add(id["TOILET_PIR"], -1, "", {{"Value-", id["TOILET_LUX"], 200},{"Time", "06:00", "21:30"}, {"Value", id["TOILET_LIGHT1"], 50}})
  

 

Partager ce message


Lien à poster
Partager sur d’autres sites

This kind of line work find for me but don't forget to add your G:SPC_ZONE_INPUT_9 in the header of the script.

 

Yes all conditions HAVE to be on the left (except Time, Days, Dates, DST, NODST, armed and disarmed that GEA move automatically for historical meaning)

 

So "Value-" must be on left like this :

 

GEA.add({id["TOILET_PIR"],{"Value-", id["TOILET_LUX"], 200}, {"Time", "06:00", "21:30"}}, -1, "", {"Value", id["TOILET_LIGHT1"], 50})

 

Partager ce message


Lien à poster
Partager sur d’autres sites

And what about

 

  GEA.add({"Value", id["HALL_WALL"], 0}, {"Time", "Sunset-35", "00:00"}, -1, "Force Hall wall light to turn on", {"TurnOn", id["HALL_WALL"]})
  
Hall wall gets triggered instantly with header.

Still gets

[DEBUG] 12:45:33: line 1149: attempt to compare table with number

and also

 

   GEA.add({"Days", "Weekdays"}, {"Time", "09:00", "09:02"}, 30, "", {"turnOff", id["TV_CHRIST"]})

 

Modifié par Kristiano

Partager ce message


Lien à poster
Partager sur d’autres sites

Hi @Kristiano

 

Is your Id HALL_WALL  prensent in declaration local id ?

Partager ce message


Lien à poster
Partager sur d’autres sites
à l’instant, pepite a dit :

Hi @Kristiano

 

Is your Id HALL_WALL  prensent in declaration local id ?

yes

Partager ce message


Lien à poster
Partager sur d’autres sites

Ok i understand @Kristiano

 

It misses braces in your code when you use many conditions like this :

 

KO :

GEA.add({"Value", id["HALL_WALL"], 0}, {"Time", "Sunset-35", "00:00"}, -1, "Force Hall wall light to turn on", {"TurnOn", id["HALL_WALL"]})

 

OK

 

 GEA.add({ {"Value", id["HALL_WALL"], 0}, {"Time", "Sunset-35", "00:00"} }, -1, "Force Hall wall light to turn on", {"TurnOn", id["HALL_WALL"]})

  GEA.add({ {"Value", id["HALL_WALL"], 0}, {"Time", "Sunset-35", "00:00"} }, -1, "Force Hall wall light to turn on", {"TurnOn", id["HALL_WALL"]})

Modifié par pepite

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 8 minutes, pepite a dit :

Ok i understand @Kristiano

 

It misses braces in your code when you use many conditions like this :

 

KO :


GEA.add({"Value", id["HALL_WALL"], 0}, {"Time", "Sunset-35", "00:00"}, -1, "Force Hall wall light to turn on", {"TurnOn", id["HALL_WALL"]})

 

OK

 


 GEA.add({ {"Value", id["HALL_WALL"], 0}, {"Time", "Sunset-35", "00:00"} }, -1, "Force Hall wall light to turn on", {"TurnOn", id["HALL_WALL"]})

  GEA.add({ {"Value", id["HALL_WALL"], 0}, {"Time", "Sunset-35", "00:00"} }, -1, "Force Hall wall light to turn on", {"TurnOn", id["HALL_WALL"]})

Worked! Thanks! And makes sense since it all points to the -1 immediate trigger

  • Like 1

Partager ce message


Lien à poster
Partager sur d’autres sites

For a more easy reading of your code (and this is new in GEA 6.0)

instead of {"Value", id["HALL_WALL"], 0} you can write  {"TurnOff", id["HALL_WALL"]}

This is exactly the same but more easy to read.

 

if turnOff and time then turnOn

  • Like 1

Partager ce message


Lien à poster
Partager sur d’autres sites

Salut. Je viens d'installer GEA 6.00 (pas eu le temps avant).

J'ai suivi le tutu et j'ai une erreur. La voici:

[DEBUG] 17:39:35: line 1038: bad argument #1 to 'lower' (string expected, got table)

Voici la ligne 1038:

      sname = string.lower(object[1]):gsub("!", ""):gsub("+", ""):gsub("-", "") 

Ou ça:

    if (tname == "table") then 
      sname = string.lower(object[1]):gsub("!", ""):gsub("+", ""):gsub("-", "") 
      originalName = object[1]
    else
      sname = string.lower(tostring(object)):gsub("!", ""):gsub("+", ""):gsub("-", "")  
    end

Help!

Modifié par fredokl

Partager ce message


Lien à poster
Partager sur d’autres sites

Bon apparemment mon problème vient de la dernière ligne pour ma lampe du couloir:

--Lampe couloir
--La lampe s'allume à 05% de 23h à 06h
GEA.add({{"Value+", id["LAMPE_VAR_COULOIR"], 05}, {"Global","Jour_Nuit","Nuit"}}, -1, "", {{"Time", "23:00", "06:00"}, {"Value", id["LAMPE_VAR_COULOIR"], 05}})

--La lampe s'allume à 65% en journée
GEA.add({{"Value-", id["LAMPE_VAR_COULOIR"], 65}, {"Global","Jour_Nuit","Jour"}},-1, "", {{"Value", id["LAMPE_VAR_COULOIR"], 65}})

--Éteindre la lampe du couloir au bout de 2 mn si pas de détection avec le capteur du couloir.
GEA.add({"Value+", id["LAMPE_VAR_COULOIR"],1}, 2*60, "", {{"turnOff", id["LAMPE_VAR_COULOIR"]}, {"If",{{"Value-",id["DETECTEUR_MOUVEMENT_COULOIR"],1}}}})

J'ai modifié la dernière ligne par celle-ci, c'est le "IF" qui posait problème, GEA fonctionne pour le moment:

GEA.add({"Value+", id["LAMPE_VAR_COULOIR"],1}, 2*60, "", {{"turnOff", id["LAMPE_VAR_COULOIR"]}, {"Value-",id["DETECTEUR_MOUVEMENT_COULOIR"],1}})

La lampe s'éteint bien au bout de 2 min.

Modifié par fredokl

Partager ce message


Lien à poster
Partager sur d’autres sites

Quelqu'un peut m'aider à optimiser mes lignes du dessus avec la nouvelle version GEA?

Partager ce message


Lien à poster
Partager sur d’autres sites

Voila M. @fredokl


 

--Lampe couloir
--La lampe s'allume à 05% de 23h à 06h
GEA.add({ {"Value+", id["LAMPE_VAR_COULOIR"], 05}, {"Global","Jour_Nuit","Nuit"}, {"Time", "23:00", "06:00"} }, -1, "", {"Value", id["LAMPE_VAR_COULOIR"], 05})

--La lampe s'allume à 65% en journée
GEA.add({{"Value-", id["LAMPE_VAR_COULOIR"], 65}, {"Global","Jour_Nuit","Jour"}},-1, "", {"Value", id["LAMPE_VAR_COULOIR"], 65} )

--Éteindre la lampe du couloir au bout de 2 mn si pas de détection avec le capteur du couloir.
GEA.add( { id["DETECTEUR_MOUVEMENT_COULOIR"], {"Value+", id["LAMPE_VAR_COULOIR"],1} }, 2*60, "", { {"Inverse"}, {"turnOff", id["LAMPE_VAR_COULOIR"]} })

 

Partager ce message


Lien à poster
Partager sur d’autres sites

Merci @pepite

C'est bon pour ces deux lignes:

--Lampe couloir
--La lampe s'allume à 05% de 23h à 06h
GEA.add({ {"Value+", id["LAMPE_VAR_COULOIR"], 05}, {"Global","Jour_Nuit","Nuit"}, {"Time", "23:00", "06:00"} }, -1, "", {"Value", id["LAMPE_VAR_COULOIR"], 05})

--Éteindre la lampe du couloir au bout de 2 mn si pas de détection avec le capteur du couloir.
GEA.add( { id["DETECTEUR_MOUVEMENT_COULOIR"], {"Value+", id["LAMPE_VAR_COULOIR"],1} }, 2*60, "", { {"Inverse"}, {"turnOff", id["LAMPE_VAR_COULOIR"]} })

Mais pour celle-là, elle s'allume à 100% et non pas 65% comme prévu. Elle fonctionne parfaitement avec l'ancienne version de GEA.

--La lampe s'allume à 65% en journée
GEA.add({{"Value-", id["LAMPE_VAR_COULOIR"], 65}, {"Global","Jour_Nuit","Jour"}},-1, "", {"Value", id["LAMPE_VAR_COULOIR"], 65} )

--J'ai modifier comme ceci, on verra demain matin
GEA.add({ {"Value-", id["LAMPE_VAR_COULOIR"], 65}, {"Global","Jour_Nuit","Jour"}, {"Time", "06:01", "23:00"} }, -1, "", {"Value", id["LAMPE_VAR_COULOIR"], 65})

 

Modifié par fredokl
  • Like 1

Partager ce message


Lien à poster
Partager sur d’autres sites

Some more question, I love GEA 6.0!

 

- How to accommodate a Popup with an easy "Yes" / "No" button? eg. "Play some music?" 

 

- A plugin is a separate scene, right? eg. Can I use it to sum the parameters 1-4 and return the result.

- 1+2+3+4 = 10

 

GEA.add({"Scenetest", "1", "2", "3", "4", "Result"}, 30, "Result is: #value#")

Different scene?
					local param1 = GEAPlugin.param1
					local param2 = GEAPlugin.param2		
					local param3 = GEAPlugin.param3
					local param4 = GEAPlugin.param4
local Result = param1 + param2 + param3 + param4

					GEAPlugin.retour("Result")

 

- And then I can choose to have a local function instead of a plugin? Using the same code. What are the differences between plugin and function?

- Simple custom condition, then function. But if more heavy "stuff" like a do while loop that will run for a while, then a plugin is preferred?

 

- If door gets unlocked and I want to send a REST PUT, this will do?

GEA.add({"Doorlock", id["UTILITY_DOOR"], 1}, -1, "", {{"ApiPut", "https://10.0.1.100:80/xx/xx/xx/xx"}})
  

 

Thanks!

 

Partager ce message


Lien à poster
Partager sur d’autres sites
Il y a 1 heure, Kristiano a dit :

- How to accommodate a Popup with an easy "Yes" / "No" button? eg. "Play some music?" 

hi @Kristiano

 

Like this

 1- Create a scene with the code of playing music, exemple : with the id 36
 2 - in setEvents()

GEA.add( {CONDITIONS}, 30, "", {"Ask", <id_portable>, "Play some Music ?", 36} )

 

Il y a 1 heure, Kristiano a dit :

A plugin is a separate scene, right

Right ;-)

 

Il y a 1 heure, Kristiano a dit :

GEA.add({"Scenetest", "1", "2", "3", "4", "Result"}, 30, "Result is: #value#")

For me, No, you can't but to confirmed with @steven, #value# will be "Result", then the push will be : "Result is : Result"

 

Il y a 1 heure, Kristiano a dit :

local function

What do you mean about "Local function"  ? the possibility of users to create personal action and condition ? like this :


-

-  GEA.options.detection = {name="Detection",
  --          getValue = function(id_motion)
  --            return fibaro:getGlobalValue("Presence") == "Holidays" and fibaro:getValue(id_motion, "value") ~= "0"
  --          end,
  --        }

  --GEA.add( {"Detection", 112}, -1, "Be careful, mmvement during my holidays le #date# à #time#")  

 

Il y a 1 heure, Kristiano a dit :

"stuff" like a do while loop that will run for a while, then a plugin is preferred?


I think it(s better to keep the high availabality of your GEA ;-)

 

Il y a 1 heure, Kristiano a dit :

If door gets unlocked and I want to send a REST PUT, this will do?

No, you can't.

 

The actions ApiPut, ApiGet, ApiPost are only available inside the HC2. The code behind for ApiGe for exemple is

api.get(url)...wich is used inside

 

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 13 minutes, pepite a dit :

hi @Kristiano

 

Like this

 1- Create a scene with the code of playing music, exemple : with the id 36
 2 - in setEvents()


GEA.add( {CONDITIONS}, 30, "", {"Ask", <id_portable>, "Play some Music ?", 36} )

 

Right ;-)

 

For me, No, you can't but to confirmed with @steven, #value# will be "Result", then the push will be : "Result is : Result"

 

What do you mean about "Local function"  ? the possibility of users to create personal action and condition ? like this :


-


-  GEA.options.detection = {name="Detection",
  --          getValue = function(id_motion)
  --            return fibaro:getGlobalValue("Presence") == "Holidays" and fibaro:getValue(id_motion, "value") ~= "0"
  --          end,
  --        }

  --GEA.add( {"Detection", 112}, -1, "Be careful, mmvement during my holidays le #date# à #time#")  

 


I think it(s better to keep the high availabality of your GEA ;-)

 

No, you can't.

 

The actions ApiPut, ApiGet, ApiPost are only available inside the HC2. The code behind for ApiGe for exemple is

api.get(url)...wich is used inside

 

Thanks a lot @Pepite,

 

- I know I won't work but if the pop-up would instead trigger a virtual device button would be great! 

- I guess I mean if its possible to get a returned value from a plugin, 

Im thinking of a GEA condition (eg. house is armed) that in a separate plugin simulates the lights in my house. In a separate scene.

The scene would run as long as the house is armed and then get terminated.

I guess on the other hand that a GEA condition could trigger the start and another condition could trigger a termination of the same.

 

- I guess I then need to create a local function to trigger the REST call.

 

 

 

 

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 9 minutes, Kristiano a dit :

I know I won't work but if the pop-up would instead trigger a virtual device button would be great! 

It's imposed by fibaro not by GEA ;-)

 

il y a 13 minutes, Kristiano a dit :

I guess I then need to create a local function to trigger the REST call.

yes, i do this for Jeedom

 

il y a 13 minutes, Kristiano a dit :

Im thinking of a GEA condition (eg. house is armed) that in a separate plugin simulates the lights in my house. In a separate scene.

i think so
 

GEA.add({"Global", "house", "Armed"}, 30, "", {"Scenetest", "house", "armed"} ) -- simulation of lights

GEA.add( {"Scenetest", "house", "Armed", "End"}, 30, "", {"Scenetest", "house", "disarmed"} -- stop the simulation

something like this maybe

 

 

 

 

Partager ce message


Lien à poster
Partager sur d’autres sites
il y a 11 minutes, pepite a dit :

It's imposed by fibaro not by GEA ;-)

 

yes, i do this for Jeedom

 

i think so
 


GEA.add({"Global", "house", "Armed"}, 30, "", {"Scenetest", "house", "armed"} ) -- simulation of lights

GEA.add( {"Scenetest", "house", "Armed", "End"}, 30, "", {"Scenetest", "house", "disarmed"} -- stop the simulation

something like this maybe

 

 

 

 

Sorry but I don't follow,

 

- If the global value of the house is armed then? Running scene "Scenetest" with parameter "House" and "Armed" as parameter 1 & 2?

 

Then second line? Whats the condition and action?

Partager ce message


Lien à poster
Partager sur d’autres sites

Salut,

Je n'arrive pas à faire fonctionner cette ligne. La lampe se met à 100% au lieu de 65%.

   --La lampe s'allume à 65% en journée
GEA.add({{"Value-", id["LAMPE_VAR_COULOIR"], 65}, {"Global","Jour_Nuit","Jour"}},-1, "", {"Value", id["LAMPE_VAR_COULOIR"], 65} )

Pourtant elle fonctionnait parfaitement sur GEA 5.

Partager ce message


Lien à poster
Partager sur d’autres sites

Ton code indique que si la lampe est à moins de 65% {"Value-"} alors il faut la mettre à 65%. Mais si elle est à 100% elle restera donc à 100%.

 

Est-ce bien ce que tu veux ?

Partager ce message


Lien à poster
Partager sur d’autres sites

Salut Steven. Non ce que je veux c’est que la lampe s’allume à 65% quand la variable Jour_Nuit est à Jour et ce quelque soit la valeur de la lampe au départ. J’ai essayé avec value! Mais la lampe ne faisait que s’allumer en permanence.


Envoyé de mon iPhone en utilisant Tapatalk

Partager ce message


Lien à poster
Partager sur d’autres sites

Salut Steven. Non ce que je veux c’est que la lampe s’allume à 65% quand la variable Jour_Nuit est à Jour et ce quelque soit la valeur de la lampe au départ. J’ai essayé avec value! Mais la lampe ne faisait que s’allumer en permanence.


Envoyé de mon iPhone en utilisant Tapatalk

Partager ce message


Lien à poster
Partager sur d’autres sites

salut @fredokl

 

tu souhaite que ta lampe s’allume à 65% quand la variable passe a jour?

Partager ce message


Lien à poster
Partager sur d’autres sites
Il y a 13 heures, fredokl a dit :

Salut Steven. Non ce que je veux c’est que la lampe s’allume à 65% quand la variable Jour_Nuit est à Jour et ce quelque soit la valeur de la lampe au départ. J’ai essayé avec value! Mais la lampe ne faisait que s’allumer en permanence.


Envoyé de mon iPhone en utilisant Tapatalk

Essaie ceci :

 

GEA.add({id["LAMPE_VAR_COULOIR"], {"Global","Jour_Nuit","Jour"}}, -1, "", {"Value", id["LAMPE_VAR_COULOIR"], 65} )

 

Partager ce message


Lien à poster
Partager sur d’autres sites
Il y a 14 heures, Javier Carelli a dit :

Good afternoon  @Steven the scene with the Door Windows to turn on the lights at night when they open, the problem is that when it remains open the door does not turn off the lights. For that create another scene that when it detects that the door is open more than 5 minutes to turn off the Light, the problem I had is that if it does not close it turns on and off every 5 minutes.
This can be done with GEA? Or with Lua?
What would logic be like?


Thank you very much!
Best regards!!!
 

I have some questions but yes GEA can help you ... (in LUA this is possible for sure because GEA is in LUA but it will be complicated).

 

1. Between Sunset-15 and Sunrise+5 the light should be turn on.

Always ? I mean force it to turn on if someone turn it off ?

 

2. After Sunrise+5 the light should be turn off

Always ? needs to force it to turn off if someone turn it on ?

 

3. When a door is open at night, this must turn on the light

But the light is already turn on ? ... see point 1.

 

4. When a door is open during the day

this must NOT turn on the light because it is the day :-)

 

 

Partager ce message


Lien à poster
Partager sur d’autres sites

×