[LUA] Repartition Consommation HC / HP...
Re: Repartition Consommation HC / HP...
@Moulins
Un minimum de correction consiste à lire les réponses apportées!
Un minimum de correction consiste à lire les réponses apportées!
Re: Repartition Consommation HC / HP...
Bonjour,
Je vais arrêter là pour ce problème, j'ai découvert autre chose, Mon domoticz doit avoir un problème, je ne peux pas faire de mise à jour à l'aide de la commande "apt-get update" message:
Il faut que je règle ce problème avant.
Merci pour votre collaboration.
Bonne journée.
Je vais arrêter là pour ce problème, j'ai découvert autre chose, Mon domoticz doit avoir un problème, je ne peux pas faire de mise à jour à l'aide de la commande "apt-get update" message:
Code : Tout sélectionner
Lecture des listes de paquets... Fait
W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Opération non permise)
E: Impossible d'ouvrir le fichier verrou /var/lib/apt/lists/lock - open (13: Permission non accordée)
E: Impossible de verrouiller le répertoire /var/lib/apt/lists/
W: Problème de suppression du lien /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission non accordée)
W: Problème de suppression du lien /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission non accordée)Merci pour votre collaboration.
Bonne journée.
Re: Repartition Consommation HC / HP...
bonjour
pour ceux que ca intéresse , voici la répartition consommation HC/HP ainsi qu'une gestion de 3 selfs en script DZvent
(a placer dans le dossier scripts/dzvents/scripts)
pour ceux que ca intéresse , voici la répartition consommation HC/HP ainsi qu'une gestion de 3 selfs en script DZvent
(a placer dans le dossier scripts/dzvents/scripts)
Code : Tout sélectionner
local LOGGING_POWER = false
local LOGGING_TELEINFO = false
local coeff_conversion = 1
local U_secteur
local cptSelf1 = '$Self1'
local cptSelf2 = '$Self2'
local cptSelf3 = '$Self3'
local cptvirtuel1Self1 = 'Conso Chauffage'
local cptvirtuel1Self2 = 'Conso Piscine/bain'
local cptvirtuel1Self3 = 'Chauffe eau'
local HC = 'Heures Creuses'
local HP = 'Heures Pleines'
local EDF = 'Compteur EDF Conso'
local EDF_W = 'Puissance Instant.'
local EDF_HP = '$HPleines'
local EDF_HC = '$HCreuses'
local EDF_I = 'Courant Instantané'
local envoy = 'Emphase'
local energy
--/////////////////////////////////////////////////////////////PROGRAMME PRINCIPAL///////////////////////////////////////////////////
return {
active = true,
on = {
timer = {
'every minute'
},
devices = {cptSelf1,cptSelf2,cptSelf3,EDF_HP,EDF_HC,EDF_W},
},
data = {
last_I_chauffage = {initial=0},
last_I_piscine = {initial=0},
last_I_chauffe_eau = {initial=0},
--memorisation des valeurs d'hiers pour envoi notifications
Conso_chauffage = {initial=0},
Conso_piscine = {initial=0},
Conso_chauffe_eau = {initial=0},
Conso_totale = {initial=0},
Conso_HC = {initial=0},
Conso_HP = {initial=0},
photovoltaique = {initial=0},
},
execute = function(domoticz,item)
local Temperature_Horsgel = domoticz.devices(temp_Horsgel)
local Self1 = domoticz.devices(cptSelf1)
local I_chauffage = Self1.current1/100
local Self2 = domoticz.devices(cptSelf2)
local I_piscine = Self2.current1/100
local Self3 = domoticz.devices(cptSelf3)
local I_chauffe_eau = Self3.current1/100
local virtuel1Self1 = domoticz.devices(cptvirtuel1Self1)
local virtuel1Self2 = domoticz.devices(cptvirtuel1Self2)
local virtuel1Self3 = domoticz.devices(cptvirtuel1Self3)
local compteur_edf_hc = domoticz.devices(EDF_HC).WhTotal/1000
local compteur_edf_hp = domoticz.devices(EDF_HP).WhTotal/1000
local compteur_edf_puissance = domoticz.devices(EDF_W).WhActual
local compteur_edf_intensite = domoticz.devices(EDF_I).current1
local compteur_edf = domoticz.devices(EDF)
local emphase = domoticz.devices(envoy)
local Heure_creuses = domoticz.devices(HC)
local Heure_pleines = domoticz.devices(HP)
local tension_secteur = domoticz.devices('U Secteur')
--
if LOGGING_POWER then
domoticz.log('[POWER]>>>>>>>>>>>> VIRTUALHP = '..Heure_pleines.WhTotal, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> VIRTUALHC = '..Heure_creuses.WhTotal, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> EDF power = '..compteur_edf_puissance, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> EDF Intensite = '..compteur_edf_intensite, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> WhTotal self1= '..virtuel1Self1.WhTotal, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> WhTotal self2 = '..virtuel1Self2.WhTotal, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> WhTotal self3 = '..virtuel1Self3.WhTotal, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> WhToday self3 = '..virtuel1Self3.WhToday, domoticz.LOG_INFO)
end
if LOGGING_TELEINFO then
domoticz.log('[POWER]>>>>>>>>>>>> VIRTUAL HP= '..Heure_pleines.WhTotal, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> VIRTUAL HC = '..Heure_creuses.WhTotal, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> EDF power = '..compteur_edf_puissance, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> EDF Intensite = '..compteur_edf_intensite, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> EDF HC = '..compteur_edf_hc, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> EDF HP = '..compteur_edf_hp, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> compteur_edf counter = '..compteur_edf.counter, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> compteur_edf counter today = '..compteur_edf.counterToday, domoticz.LOG_INFO)
end
-- calcul de la tension du reseau
U_secteur = compteur_edf_puissance/compteur_edf_intensite
if (U_secteur < 240 or U_secteur > 245) then U_secteur = 242.5 end
if tension_secteur.voltage ~= U_secteur then tension_secteur.updateVoltage(U_secteur) end
if LOGGING_POWER then domoticz.log('[POWER]>>>>>>>>>>>> U_Secteur = '..U_secteur, domoticz.LOG_INFO)end
-- mise a l'ehcelle
I_chauffage = I_chauffage * coeff_conversion
I_piscine = I_piscine * coeff_conversion
I_chauffe_eau = I_chauffe_eau * coeff_conversion
-- conversion en puissance
local W_chauffage = I_chauffage*U_secteur
local W_piscine = I_piscine*U_secteur
local W_chauffe_eau = I_chauffe_eau*U_secteur
-- gestion heure
local Time = require('Time')
local now = Time() -- current time
--domoticz.log('[POWER]>>>>>>>>>>>> heure '..now.hour, domoticz.LOG_INFO)
--domoticz.log('[POWER]>>>>>>>>>>>> minutes '..now.minutes, domoticz.LOG_INFO)
--domoticz.log('[POWER]>>>>>>>>>>>> secondes '..now.seconds, domoticz.LOG_INFO)
--domoticz.log('[POWER]>>>>>>>>>>>> domoticz.time.rawDate '..domoticz.time.rawDate, domoticz.LOG_INFO)
if item.isDevice then
if (item.name == EDF_HC and item.changed)then
Heure_creuses.updateElectricity(compteur_edf_puissance,compteur_edf_hc)
Heure_pleines.updateElectricity(0,compteur_edf_hp)
compteur_edf.updateP1(compteur_edf_hp,compteur_edf_hc,0,0,compteur_edf_puissance,0)
if LOGGING_TELEINFO then
domoticz.log('[POWER]>>>>>>>>>>>> UPDATE HC= '..compteur_edf_hc, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> UPDATE HC W= '..compteur_edf_puissance, domoticz.LOG_INFO)
end
end
if (item.name == EDF_HP and item.changed)then
Heure_creuses.updateElectricity(0,compteur_edf_hc)
Heure_pleines.updateElectricity(compteur_edf_puissance,compteur_edf_hp)
compteur_edf.updateP1(compteur_edf_hp,compteur_edf_hc,0,0,compteur_edf_puissance,0)
if LOGGING_TELEINFO then
domoticz.log('[POWER]>>>>>>>>>>>> UPDATE HP= '..compteur_edf_hp, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> UPDATE HP W= '..compteur_edf_puissance, domoticz.LOG_INFO)
end
end
if (item.name == EDF_W and item.changed)then
Heure_creuses.updateElectricity(0,compteur_edf_hc)
Heure_pleines.updateElectricity(0,compteur_edf_hp)
compteur_edf.updateP1(compteur_edf_hp,compteur_edf_hc,0,0,compteur_edf_puissance,0)
if LOGGING_TELEINFO then
domoticz.log('[POWER]>>>>>>>>>>>> UPDATE W HC= '..compteur_edf_hc, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> UPDATE W HP= '..compteur_edf_hp, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> UPDATE W= '..compteur_edf_puissance, domoticz.LOG_INFO)
end
end
--SELF chauffage
--mise a jour puissance du capteur en direct
if (item.name == cptSelf1 and item.changed)then
if (domoticz.data.last_I_chauffage ~= I_chauffage) then domoticz.data.last_I_chauffage = I_chauffage else domoticz.log('[POWER]>>>>>>>>>>>> Self1 (chauffage ) Valeur precedente identique', domoticz.LOG_INFO)end
if (LOGGING_POWER)then
domoticz.log('[POWER]>>>>>>>>>>>> I_chauffage = '..I_chauffage ..' A', domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> W_chauffage= '..W_chauffage..' W', domoticz.LOG_INFO)
end
virtuel1Self1.updateElectricity(domoticz.utils.round(W_chauffage,1),virtuel1Self1.WhTotal)
end
--SELF piscine
--mise a jour puissance du capteur en direct
if (item.name == cptSelf2 and item.changed)then
if (domoticz.data.last_I_piscine ~= I_piscine) then domoticz.data.last_I_piscine = I_piscine else domoticz.log('[POWER]>>>>>>>>>>>> Self2 (piscine ) Valeur precedente identique', domoticz.LOG_INFO)end
if (LOGGING_POWER)then
domoticz.log('[POWER]>>>>>>>>>>>> I_piscine = '..I_piscine ..' A', domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> W_piscine = '..W_piscine ..' W', domoticz.LOG_INFO)
end
virtuel1Self2.updateElectricity(domoticz.utils.round(W_piscine,1),virtuel1Self2.WhTotal)
end
--SELF chauffe eau
--mise a jour puissance du capteur en direct
if (item.name == cptSelf3 and item.changed)then
if (domoticz.data.last_I_chauffe_eau ~= I_chauffe_eau) then domoticz.data.last_I_chauffe_eau = I_chauffe_eau else domoticz.log('[POWER]>>>>>>>>>>>> Self3 (chauffe eau ) Valeur precedente identique', domoticz.LOG_INFO)end
if (LOGGING_POWER)then
domoticz.log('[POWER]>>>>>>>>>>>> I_chauffe_eau = '..I_chauffe_eau ..' A', domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> W_chauffe_eau = '..W_chauffe_eau ..' W', domoticz.LOG_INFO)
end
virtuel1Self3.updateElectricity(domoticz.utils.round(W_chauffe_eau,1),virtuel1Self3.WhTotal)
end
end
--mise a jour des wh toutes les minutes
if item.isTimer then
energy = domoticz.utils.round((virtuel1Self1.WhTotal + (W_chauffage /60)),0)
if LOGGING_POWER then domoticz.log('[POWER]>>>>>>>>>>>> energy chauffage = '..energy, domoticz.LOG_INFO)end
virtuel1Self1.updateElectricity(domoticz.utils.round(W_chauffage,1),energy)
energy = domoticz.utils.round((virtuel1Self2.WhTotal + (W_piscine /60)),0)
if LOGGING_POWER then domoticz.log('[POWER]>>>>>>>>>>>> energy piscine = '..energy, domoticz.LOG_INFO)end
virtuel1Self2.updateElectricity(domoticz.utils.round(W_piscine,1),energy)
energy = domoticz.utils.round((virtuel1Self3.WhTotal + (W_chauffe_eau /60)),0)
if LOGGING_POWER then domoticz.log('[POWER]>>>>>>>>>>>> energy chauffe eau = '..energy, domoticz.LOG_INFO)end
virtuel1Self3.updateElectricity(domoticz.utils.round(W_chauffe_eau,1),energy)
if (now.hour == 0 and now.minutes ==0) then
domoticz.data.Conso_totale = compteur_edf.counterToday
domoticz.data.Conso_HP = Heure_pleines.WhToday/1000
domoticz.data.Conso_HC = Heure_creuses.WhToday/1000
domoticz.data.Conso_chauffage = virtuel1Self1.WhToday/1000
domoticz.data.Conso_piscine = virtuel1Self2.WhToday/1000
domoticz.data.Conso_chauffe_eau = virtuel1Self3.WhToday/1000
domoticz.data.photovoltaique = emphase.WhToday/1000
end
--domoticz.log('[POWER]>>>>>>>>>>>> dump= '..compteur_edf.dump(), domoticz.LOG_INFO)
if LOGGING_POWER then
domoticz.log('[POWER]>>>>>>>>>>>> domoticz.data.Conso_totale= '..domoticz.data.Conso_totale *1000, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> domoticz.data.Conso_HP = '..domoticz.data.Conso_HP*1000, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> domoticz.data.Conso_HC = '..domoticz.data.Conso_HC*1000, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> domoticz.data.Conso_chauffage = '..domoticz.data.Conso_chauffage*1000, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> domoticz.data.Conso_piscine '..domoticz.data.Conso_piscine*1000, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> domoticz.data.Conso_chauffe_eau '..domoticz.data.Conso_chauffe_eau*1000, domoticz.LOG_INFO)
domoticz.log('[POWER]>>>>>>>>>>>> domoticz.data.photovoltaique '..domoticz.data.photovoltaique*1000, domoticz.LOG_INFO)
end
-- envoi du rapport consomation sur telegram
if (now.hour == 9 and now.minutes ==0) then
local message = 'Power Repport \n \n Conso Totale = '..domoticz.data.Conso_totale.. 'Kw \n Heures Creuses = '..domoticz.data.Conso_HC..'Kw \n Heures Pleines = '..domoticz.data.Conso_HP..'Kw \n Chauffage = '..domoticz.data.Conso_chauffage..'Kw \n Piscine/bain = '..domoticz.data.Conso_piscine..'Kw \n Chauffe Eau ='..domoticz.data.Conso_chauffe_eau..'Kw \n \n Production Solaire = '..domoticz.data.photovoltaique..'Kw'
domoticz.log('[POWER]>>>>>>>>>>>> message= '..message, domoticz.LOG_INFO)
domoticz.notify('POWER',message,domoticz.PRIORITY_HIGH)
end
end
end
}Re: Repartition Consommation HC / HP...
Bonjour a tous,
J'ai réparé l' "apt-get" et reconfiguré le "dpkg" qui étaient plantés. ce qui empêchaient les erreur de remonter dans les logs.
Maintenant, j'ai l'erreur "Error: (Cons. Electrique): Async Secure Read Exception: 1, stream truncated" qui remonte . (j'ai rien changé dans mon script lua HP-HC.
De quoi s'agit-il?
Si quelqu'un avait une solution? Merci.
J'ai réparé l' "apt-get" et reconfiguré le "dpkg" qui étaient plantés. ce qui empêchaient les erreur de remonter dans les logs.
Maintenant, j'ai l'erreur "Error: (Cons. Electrique): Async Secure Read Exception: 1, stream truncated" qui remonte . (j'ai rien changé dans mon script lua HP-HC.
De quoi s'agit-il?
Si quelqu'un avait une solution? Merci.
Re: Repartition Consommation HC / HP...
j'ai rien changé dans mon script lua HP-HC....Moulins58 a écrit :Bonjour a tous,
J'ai réparé l' "apt-get" et reconfiguré le "dpkg" qui étaient plantés. ce qui empêchaient les erreur de remonter dans les logs.
Maintenant, j'ai l'erreur "Error: (Cons. Electrique): Async Secure Read Exception: 1, stream truncated" qui remonte . (j'ai rien changé dans mon script lua HP-HC.
De quoi s'agit-il?
Si quelqu'un avait une solution? Merci.
Et bien relis les réponses données par Imet ...
Envoyé de mon SM-A530F en utilisant Tapatalk
Re: Repartition Consommation HC / HP...
Je ne comprends pas?
Bonne soirée.
Bonne soirée.
Re: Repartition Consommation HC / HP...
Je me reponds a moi-même, j'ai réussis en reprenant la page ligne par ligne et tout fonctionne, je n'ai pas tout compris.
Re: Repartition Consommation HC / HP...
bonjour je beug sur cette partie
Nous avons un déjà capteur électrique qui cumule tout ("Compteur Electrique Global")
je n'arrive pas a trouver comment faire pour recuperé les valeur de mon owl


avez vous une idée ?
merci d'avance
Nous avons un déjà capteur électrique qui cumule tout ("Compteur Electrique Global")
je n'arrive pas a trouver comment faire pour recuperé les valeur de mon owl


avez vous une idée ?
merci d'avance
-
vil1driver
- Messages : 5661
- Inscription : 30 janv. 2015, 11:07
- Localisation : Rennes (35)
Re: Repartition Consommation HC / HP...
Si tu suis ce que je t'ai dis tu dois pouvoir créer des capteurs virtuel.
https://easydomoticz.com/forum/viewtopi ... 798#p85798
Même procédé pour les switchs virtuels.
Les variables à créer également (tu devrais trouver facilement dans le menu de Domoticz)
https://easydomoticz.com/forum/viewtopi ... 798#p85798
Même procédé pour les switchs virtuels.
Les variables à créer également (tu devrais trouver facilement dans le menu de Domoticz)
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
/!\Les mises à jour de Domoticz sont souvent sources de difficultés, ne sautez pas dessus
modules.lua
Un ex domoticzien
Re: Repartition Consommation HC / HP...
j'ai crée le capteur virtuel mais il n'est relier a rien pour le moment, je cherche comment faire