Page 3 sur 18

Re: Luminosité théorique extérieure

Publié : 19 mars 2016, 14:05
par deennoo
jml a écrit : Notamment, depuis la beta #4937 , vous pouvez utiliser le virtual sensor " custom type" pour créer les sensor Altitude et azimuth et saisir votre propre texte pour l'unité. Par exemple "degré". Vous pouvez ensuite choisir votre icone (une fois créé, allez sur le dashboard pour éditez à nouveau le sensor).
Je viens de passer en #4981 il a disparut ce virtual "custom type", il etait bien creable dans les "dummy" ?

Re: Luminosité théorique extérieure

Publié : 19 mars 2016, 21:45
par jml
Il a été supprimé par mégarde. Gizmocuz l'a remis il y a 5j.Voir ici :
https://github.com/domoticz/domoticz/co ... f3d4223901

Je suppose que la beta d'aujourd'hui doit à nouveau l'inclure.

Et sinon, c'est bien dans les dummy :
Screenshot - 19_03_2016 , 21_32_38.jpg
Screenshot - 19_03_2016 , 21_32_38.jpg (47.77 Kio) Consulté 9511 fois

Re: Luminosité théorique extérieure

Publié : 19 mars 2016, 21:50
par jml
@ daeenoo:
What did you expect ? 8-) https://www.domoticz.com/wiki/Scripts#Library

Re: Luminosité théorique extérieure

Publié : 19 mars 2016, 21:57
par jml
@Neutrino :
Pour le pseudo dans le wiki, c'est normal. Ta transcription en Lua était un gros travail. J'en sais quelque chose puisque j'étais moi-même en cours de conversion depuis 1j quand tu m'as coiffé au poteau !

Re: Luminosité théorique extérieure

Publié : 19 mars 2016, 22:05
par deennoo
I think that i don't see this, and with last beta custom sensor are back, all is good.

I say that i say nothing...

Re: Luminosité théorique extérieure

Publié : 20 avr. 2016, 14:36
par staber
Bonjour,

J'ai un bug dans l'implémentation du script :
Voici le log :
2016-04-20 08:35:01.431 LUA: Lat: 48.29999924Long: -70.93000031Alt: 135.00000000
2016-04-20 08:35:01.432 LUA:
2016-04-20 08:35:01.432 LUA: 2016-04-20 08:35:01
2016-04-20 08:35:01.432 LUA: la_baie, latitude:48.31881, longitude:-70.90116
2016-04-20 08:35:01.432 LUA: Home altitude = 117 m
2016-04-20 08:35:01.432 LUA: number Of Day = 111
2016-04-20 08:35:01.432 LUA: 2016 is a leap year !
2016-04-20 08:35:01.432 LUA: Angular Speed = 0.98562628336756 per day
2016-04-20 08:35:01.432 LUA: Declinaison = 11.978865228918°
2016-04-20 08:35:01.432 LUA: Universel Coordinated Time (UTC)12.583333333333 H.dd
2016-04-20 08:35:01.432 LUA: Solar Hour 7.8565893333333 H.dd
2016-04-20 08:35:01.432 LUA: Altitude of the sun = 27.315361434852°
2016-04-20 08:35:01.432 LUA: Angular hourly = 62.15116°
2016-04-20 08:35:01.432 LUA: Azimuth of the sun = 103.22536787969°
2016-04-20 08:35:01.432 LUA: Duration of the sunstroke of the day = 13.84 H.dd
2016-04-20 08:35:01.432 LUA: Radiation max en atmosphere = 1345.8 W/m²
2016-04-20 08:35:01.432 LUA: Local relative pressure = 1028 hPa
2016-04-20 08:35:01.433 LUA: Absolute pressure in atmosphere = 1013.9 hPa
2016-04-20 08:35:01.433 LUA: Coefficient of mitigation M = 2.2027938057559 M0:2.1725803887704
2016-04-20 08:35:01.433 LUA: curl "http://www.ogimet.com/cgi-bin/getsynop? ... 1604201100"
2016-04-20 08:35:01.926 LUA: ogimet:71728,2016,04,20,12,00,AAXX 20124 71728 13986 33210 11017 21083 30062 40287 53013 60001 8///1 333 10072 21041 42012 70000=
2016-04-20 08:35:01.927 LUA: Station SYNOP = 71728
2016-04-20 08:35:01.927 LUA: 3 Octa
2016-04-20 08:35:01.927 LUA: Kc = 0.97328423751949
2016-04-20 08:35:01.927 LUA: Direct Radiation = 200.45 W/m²
2016-04-20 08:35:01.927 LUA: Scattered Radiation = 108.43 W/m²
2016-04-20 08:35:01.927 LUA: Total radiation = 308.88 W/m²
2016-04-20 08:35:01.927 LUA: Total Radiation in lux = 39098.33 Lux
2016-04-20 08:35:01.927 LUA: and at last, Total weighted lux = 38053.79 Lux
2016-04-20 08:35:01.927 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua: /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua:203: attempt to perform arithmetic on a nil value
Merci pour votre aide

Re: Luminosité théorique extérieure

Publié : 20 avr. 2016, 19:13
par Neutrino

Code : Tout sélectionner

2016-04-20 08:35:01.927 Error: EventSystem: in /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua: /home/pi/domoticz/scripts/lua/script_time_SolarSensor.lua:203: attempt to perform arithmetic on a nil value
Signifie que l'erreur se situe à la ligne 203 de ton script.
Il y a quoi à cette ligne ?
Tu as bien créer les virtual sensors et la uservariable ? (j'aime bien ce franglais :mrgreen: )

Re: Luminosité théorique extérieure

Publié : 20 avr. 2016, 20:06
par staber
Allo,

Voici la ligne 203 :

Code : Tout sélectionner

if tonumber(otherdevices_svalues['Lux'])+round(weightedLux,0)>0   -- No update if Lux is already 0. So lastUpdate of the sensor$
        then
                commandArray[indexArray] = {['UpdateDevice'] = idxLux..'|0|'..tostring(round(weightedLux,0))}
                indexArray=indexArray+1
        end
Il utilise les variables Lux et weightedLux qui ont pourtant des valeurs d'après le log :
2016-04-20 08:35:01.927 LUA: Total Radiation in lux = 39098.33 Lux
2016-04-20 08:35:01.927 LUA: and at last, Total weighted lux = 38053.79 Lux
J'ai bien créé les virtual sensors ;) :
ils sont bien déclaré au début du script :

Code : Tout sélectionner

local idxLux ='122'            -- Your virtual Lux Device ID
       local idxSolarAzimuth ='123'       -- Your virtual Azimuth Device ID
       local idxSolarAltitude ='124'       -- Your virtual Solar Altitude Device ID
       local idxUserVarOcta='2'           -- Your user variable ID , named octa
et la UserVariable aussi d'ailleurs elle est bien updaté :
2016-04-20 08:35:01.927 LUA: 3 Octa
J'ai du rater un truc...

Re: Luminosité théorique extérieure

Publié : 20 avr. 2016, 20:38
par Neutrino
A mon avis, c'est otherdevices_svalues['Lux'] qui renvoie le fameux nil.
Tu as un capteur qui s'appelle Lux ? (genre celui qui a l'idx 122)

Re: Luminosité théorique extérieure

Publié : 20 avr. 2016, 21:03
par staber
j'ai un matériel virtuel : Virtual Lux -> Dummy (Does nothing, use for virtual switches only)

avec un Dummy : Lux de type lux :lol: (idx 122)