Weather Underground et THB

Forum dédié aux problématiques concernant les scripts pour DomoticZ.
Entourez votre code et les logs avec les balises nommées code grâce au bouton <\>.
vil1driver
Messages : 5661
Inscription : 30 janv. 2015, 11:07
Localisation : Rennes (35)

Re: Weather Underground et THB

Message par vil1driver »

ah oui vu comme ça.. je comprends
ça ne m'a jamais dérangé d'avoir également l'humidité.. ainsi qu'un widget baro..
faut dire que je ne me sers pratiquement pas de l'interface de domoticz autrement que pour de la config
MAJ = VIDER LE CACHE(<-Clicable)
/!\Les mises à jour de Domoticz sont souvent sources de difficultés, ne sautez pas dessus
modules.lua

Un ex domoticzien
Pixelman
Messages : 9
Inscription : 16 déc. 2016, 18:21

Re: Weather Underground et THB

Message par Pixelman »

Slt. Je reviens vers toi pour te proposer (peut-être) une solution pour l'affichage de tes deux valeurs.Dans le Wiki je suis tombé sur ça, regarde si ça fait le job en numérotant commandArray.

Code : Tout sélectionner

The commandArray also supports nested tables to send the same command type multiple times. To do this, give the command a numeric index (not alphanumeric with or without quotes!) and place the required action in a nested table:

 commandArray = {}
 commandArray[1]={['OpenURL']='www.cam1.com/api/movecamtopreset.cgi' }
 commandArray[2]={['OpenURL']='www.cam2.com/api/movecamtopreset.cgi' }
 commandArray[3]={['OpenURL']='www.cam3.com/api/movecamtopreset.cgi' }
 return commandArray

This will run three url commands with separate addresses. Always start the commandarray index at 1; Lua uses 1 based indexes, so commandArray[0] will not run.

Some examples (not meaningful, just to explain what will happen):

 commandArray = {}
 commandArray['Lamp']='On'
 commandArray[1]={['Lamp']='On'}
 commandArray[2]={['Lamp']='On'}
 commandArray[3]={['Lamp']='On'}
 commandArray['Lamp']='On'
 return commandArray

This will turn "Lamp" on 4 times (the last array item overwrites the first).

 commandArray = {}
 commandArray['Lamp']='On'
 commandArray[0]={['Lamp']='On'}
 commandArray[1]={['Lamp']='On'}
 commandArray[2]={['Lamp']='On'}
 commandArray['Lamp']='On'
 return commandArray

This will turn "Lamp" on 3 times (the last array item overwrites the first and the zero index is ignored)
Répondre