faudrait que tu regardes dans les docs de Home assistant
J’ai regardé pas mal de posts dont celui là Transformer un format date reconnaissable par HA
Cela donne :
{{ as_timestamp(states.sensor.myelectricaldata_198811XXXXX.attributes.lastUpdate) | int | timestamp_custom(‹ %d/%m/%Y %H:%M ›, true)}}
Bonsoir,
impossible pour moi d’installer l’addon HA. Je bute sur cette erreur, même avec une (re)installtion from scratch.
2022-12-20 22:48:32.477 - INFO : Connect to InfluxDB a0d7b954-influxdb:8086
2022-12-20 22:48:32.513 - INFO : => Connection success
2022-12-20 22:48:32.513 - INFO : => Méthode d’importation : SYNCHRONOUS
Traceback (most recent call last):
File « /app/main.py », line 81, in
INFLUXDB = InfluxDB(
File « /app/models/influxdb.py », line 63, in init
self.connect()
File « /app/models/influxdb.py », line 117, in connect
self.get_list_retention_policies()
File « /app/models/influxdb.py », line 142, in get_list_retention_policies
buckets = self.buckets_api.find_buckets().buckets
File « /usr/local/lib/python3.9/site-packages/influxdb_client/client/bucket_api.py », line 119, in find_buckets
return self._buckets_service.get_buckets(**kwargs)
File « /usr/local/lib/python3.9/site-packages/influxdb_client/service/buckets_service.py », line 548, in get_buckets
(data) = self.get_buckets_with_http_info(**kwargs) # noqa: E501
File « /usr/local/lib/python3.9/site-packages/influxdb_client/service/buckets_service.py », line 575, in get_buckets_with_http_info
return self.api_client.call_api(
File « /usr/local/lib/python3.9/site-packages/influxdb_client/_sync/api_client.py », line 343, in call_api
return self.__call_api(resource_path, method,
File « /usr/local/lib/python3.9/site-packages/influxdb_client/_sync/api_client.py », line 173, in __call_api
response_data = self.request(
File « /usr/local/lib/python3.9/site-packages/influxdb_client/_sync/api_client.py », line 365, in request
return self.rest_client.GET(url,
File « /usr/local/lib/python3.9/site-packages/influxdb_client/_sync/rest.py », line 268, in GET
return self.request(« GET », url,
File « /usr/local/lib/python3.9/site-packages/influxdb_client/_sync/rest.py », line 261, in request
raise ApiException(http_resp=r)
influxdb_client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({‹ Content-Type ›: ‹ text/plain; charset=utf-8 ›, ‹ X-Content-Type-Options ›: ‹ nosniff ›, ‹ X-Influxdb-Build ›: ‹ OSS ›, ‹ X-Influxdb-Version ›: ‹ 1.8.10 ›, ‹ Date ›: ‹ Tue, 20 Dec 2022 21:48:32 GMT ›, ‹ Content-Length ›: ‹ 19 ›})
HTTP response body: 404 page not found
[22:48:32] FATAL: The app has crashed. Are you sure you entered the correct config options?
Je joins mon fichier de config :
##########
# GLOBAL #
##########
debug: true
cycle: 14400
wipe_influxdb: false
####################
## Home assistant ##
####################
home_assistant:
discovery: false
discovery_prefix: homeassistant
###############
## Influx DB ##
###############
influxdb:
enable: true
hostname: a0d7b954-influxdb
port: 8086
token: ***MonTokenInfluxDB***
org: Home
bucket: myelectricaldata
method: synchronous
batching_options:
batch_size: 1000
flush_interval: 1000
jitter_interval: 0
retry_interval: 5000
max_retry_time: 180_000
max_retries: 5
max_retry_delay: 125_000
exponential_base: 2
####################
## MQTT ##
####################
mqtt:
enable: true
hostname: chronos
port: 1883
username: admin
password: ***Mdp***
prefix: myelectricaldata
client_id: myelectricaldata
retain: true
qos: 0
######################
## MYELECTRICALDATA ##
######################
myelectricaldata:
"***MonPDL***":
enable: "true"
token: ***MonToken***
name: Maison
addresses: "true"
cache: "true"
consumption: "true"
consumption_detail: "true"
consumption_price_base: "0.145907"
consumption_price_hc: "0.124364"
consumption_price_hp: "0.164915"
consumption_max_date: "2023-06-01"
consumption_detail_max_date: "2023-06-01"
offpeak_hours_0: 22H00-6H00 # LUNDI
offpeak_hours_1: 22H00-6H00 # MARDI
offpeak_hours_2: 22H00-6H00 # MERCREDI
offpeak_hours_3: 22H00-6H00 # JEUDI
offpeak_hours_4: 22H00-6H00 # VENDREDI
offpeak_hours_5: 22H00-6H00 # SAMEDI
offpeak_hours_6: 22H00-6H00 # DIMANCHE
plan: HP/HC # BASE or HP/HC
production: 'false'
production_detail: 'false'
production_price: '0.0'
production_max_date: "2021-06-01"
production_detail_max_date: "2021-06-01"
refresh_addresse: 'false'
refresh_contract: 'false'
=> merci pour toute aide.
PS: je suis en mode tempo. => rédhibitoire ?
Hello
@Theodine
regarde ce que tu dis le journal dans les grandes lignes
Cela veux dire qui ne trouve pas influxDB
Verifie ta config
influxDB , tu as bien crée un bracket pour my electra ??
influxDB est bien accessible ?
Les paramètres de influxDB , passe ses paramètre pour la version 1.8
car ton influxDB est en
‹ X-Influxdb-Version ›: ‹ 1.8.10 ›
Hello,
Une question bête, pour me faire un graph avec les conso mensuel, je doit utiliser quel sensor?
Vous avez un exemple avec Apexcharts-Card ?
Merci!
myelectricaldata_last_update:
value_template: "{{ as_timestamp(states.sensor.myelectricaldata_XXXX.attributes.lastUpdate,0) | timestamp_custom('%H:%M %d-%m-%Y',local=True)}}"
friendly_name: "Date Mise à Jour"
essaye ça
Navré si la question a déjà été traitée, mais quid du ratio HP/HC qui semble particulièrement incorrect ? 1240% c’est … improbable ^^
Bonjour,
Je viens d’installer la dernière version 0.8.11. J’ai dû complément enlever la version 0.7 car sinon pas possible de l’installer.
Maintenant j’avoue que j’ai du mal avec les modifications du fichier yaml.
À chaque fois que je copie/colle le yaml j’ai des erreurs…
Que faut il mettre exactement dans le fichier config ?
@Theodine
mais de rien
@g4seb
Regarde les posts au dessus , certain d’entre nous on mis leurs fichier comme modele
de plus te ne nous donne pas le message d’erreur que tu as.
On ne peux deviné les erreurs que tu as , poste ton journal d’erreur on y verra plus clair.
C’est vrai…oups j’ai oublié de copier le fichier.
Le voici :
verbose=‹ true ›
/etc/cont-init.d/01-custom_script.sh: executing
[17:08:56] INFO: Execute /config/enedisgateway2mqtt.sh if existing
[17:08:56] INFO: … no script found
/etc/cont-init.d/91-mqtt_autodiscover.sh: executing
[17:08:56] INFO: mqtt_autodiscover is defined in options, attempting autodiscovery…
[17:08:56] INFO: … MQTT service found, fetching server detail (you can enter those manually in your config file) …
/etc/cont-init.d/91-mqtt_autodiscover.sh: exiting 2
/etc/cont-init.d/99-run.sh: executing
[17:08:58] WARNING: Migration performed, enedisgateway.db.migrate copied in /config/enedisgateway2mqtt
creating symlink
[17:08:58] INFO: Using database file found in /config/enedisgateway2mqtt
[17:08:58] INFO: Using config file found in /config/enedisgateway2mqtt/config.yaml
Config file is a valid yaml
[17:08:58] INFO: Starting the app
INFO [alembic.runtime.migration] Context impl SQLiteImpl.
INFO [alembic.runtime.migration] Will assume non-transactional DDL.
2022-12-21 17:09:02.820 - INFO : Configure Databases
2022-12-21 17:09:02.909 - INFO : => day
2022-12-21 17:09:02.930 - INFO : => call_number
2022-12-21 17:09:02.948 - INFO : => max_call
2022-12-21 17:09:02.966 - INFO : => version
2022-12-21 17:09:02.983 - INFO : => lock
2022-12-21 17:09:03.000 - INFO : => lastUpdate
2022-12-21 17:09:03.001 - INFO : Success
2022-12-21 17:09:03.960 - INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2022-12-21 17:09:03.960 - INFO : RUN IN PRODUCTION MODE
2022-12-21 17:09:03.961 - INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2022-12-21 17:09:03.986 - INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2022-12-21 17:09:03.986 - INFO : ▌│█║▌║▌║ __ __ _____ _ _ _ _ ____ _ ║▌║▌║█│▌
2022-12-21 17:09:03.987 - INFO : ▌│█║▌║▌║ | / | _ _ | || | ___ ___ | | _ __ () ___ __ _ | || _ \ __ _ | | __ _ ║▌║▌║█│▌
2022-12-21 17:09:03.987 - INFO : ▌│█║▌║▌║ | |/| || | | || | | | / _ \ / _|| || '|| | / | / || || | | | / _
|| | / ` | ║▌║▌║█│▌
2022-12-21 17:09:03.987 - INFO : ▌│█║▌║▌║ | | | || || || | | || /| ( | | | | | || ( | (| || || || || (| || | | (| | ║▌║▌║█│▌
2022-12-21 17:09:03.988 - INFO : ▌│█║▌║▌║ || || _, ||||_| _| _| _||| |_| _| _,||||/ _,| _| _,| ║▌║▌║█│▌
2022-12-21 17:09:03.988 - INFO : ▌│█║▌║▌║ |__/ ║▌║▌║█│▌
2022-12-21 17:09:03.988 - INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2022-12-21 17:09:03.989 - INFO : ▌│█║▌║▌║ VERSION : 0.8.10 ║▌║▌║█│▌
2022-12-21 17:09:03.989 - INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2022-12-21 17:09:03.989 - INFO : Display configuration :
2022-12-21 17:09:03.990 - INFO : cycle: 3600
2022-12-21 17:09:03.990 - INFO : debug: False
2022-12-21 17:09:03.990 - INFO : home_assistant:
2022-12-21 17:09:03.991 - INFO : card_myenedis: True
2022-12-21 17:09:03.991 - INFO : discovery: True
2022-12-21 17:09:03.991 - INFO : discovery_prefix: homeassistant
2022-12-21 17:09:03.991 - INFO : mqtt:
2022-12-21 17:09:03.992 - INFO : enable: True
2022-12-21 17:09:03.992 - INFO : client_id: myelectricaldata
2022-12-21 17:09:03.992 - INFO : host: 192.168.1.37
2022-12-21 17:09:03.993 - INFO : password: ** hidden **
2022-12-21 17:09:03.993 - INFO : port: 1883
2022-12-21 17:09:03.993 - INFO : prefix: myelectricaldata
2022-12-21 17:09:03.993 - INFO : qos: 0
2022-12-21 17:09:03.994 - INFO : retain: True
2022-12-21 17:09:03.994 - INFO : username: mqtt
2022-12-21 17:09:03.994 - INFO : wipe_cache: False
2022-12-21 17:09:03.995 - INFO : myelectricaldata:
2022-12-21 17:09:03.995 - INFO : 05572503537892:
2022-12-21 17:09:03.995 - INFO : enable: true
2022-12-21 17:09:03.996 - INFO : token: ** hidden **
2022-12-21 17:09:03.996 - INFO : name: Maison
2022-12-21 17:09:03.996 - INFO : addresses: true
2022-12-21 17:09:03.996 - INFO : cache: true
2022-12-21 17:09:03.997 - INFO : consumption: true
2022-12-21 17:09:03.997 - INFO : consumption_detail: true
2022-12-21 17:09:03.997 - INFO : consumption_price_base: 0.145907
2022-12-21 17:09:03.998 - INFO : consumption_price_hc: 0.15
2022-12-21 17:09:03.998 - INFO : consumption_price_hp: 0.17
2022-12-21 17:09:03.998 - INFO : consumption_max_date: 2021-06-01
2022-12-21 17:09:03.998 - INFO : consumption_detail_max_date: 2021-06-01
2022-12-21 17:09:03.999 - INFO : offpeak_hours_0: 22H22-6H22
2022-12-21 17:09:03.999 - INFO : offpeak_hours_1: 22H22-6H22
2022-12-21 17:09:03.999 - INFO : offpeak_hours_2: 22H22-6H22
2022-12-21 17:09:04.000 - INFO : offpeak_hours_3: 22H22-6H22
2022-12-21 17:09:04.000 - INFO : offpeak_hours_4: 22H22-6H22
2022-12-21 17:09:04.000 - INFO : offpeak_hours_5: 22H22-6H22
2022-12-21 17:09:04.001 - INFO : offpeak_hours_6: 22H22-6H22
2022-12-21 17:09:04.001 - INFO : plan: HC/HP
2022-12-21 17:09:04.001 - INFO : production: false
2022-12-21 17:09:04.002 - INFO : production_detail: false
2022-12-21 17:09:04.002 - INFO : production_price: 0.0
2022-12-21 17:09:04.002 - INFO : production_max_date: 2021-06-01
2022-12-21 17:09:04.003 - INFO : production_detail_max_date: 2021-06-01
2022-12-21 17:09:04.003 - INFO : refresh_addresse: false
2022-12-21 17:09:04.003 - INFO : refresh_contract: false
2022-12-21 17:09:04.004 - INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2022-12-21 17:09:04.004 - INFO : Check config.yaml :
2022-12-21 17:09:04.004 - INFO : => Config valid
2022-12-21 17:09:04.020 - INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2022-12-21 17:09:04.020 - INFO : LOADING CONFIGURATION…
2022-12-21 17:09:04.021 - INFO : ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ◦ ❖ ◦ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
2022-12-21 17:09:04.021 - INFO : 05572503537892
2022-12-21 17:09:04.044 - INFO : => Success
Traceback (most recent call last):
File « /app/main.py », line 55, in
hostname=MQTT_CONFIG[« hostname »],
KeyError: ‹ hostname ›
[17:09:04] FATAL: The app has crashed. Are you sure you entered the correct config options?
sert toi de la balise suivante la prochaine fois pour mettre le code
Maintenant il suffit de lire quelque post au dessus tu aura ta reponse , j’ai deja donne la reponse pour cette erreur 2 / 3 fois déjà
hostname=MQTT_CONFIG[« hostname »],
KeyError: ‹ hostname ›
[17:09:04] FATAL: The app has crashed. Are you sure you entered the correct config options?
pour etre precis et de mettre sur la voix regarde vers le post 800 vers le 16 decembre 2022
Désolé je penserai à mettre les balises !!
Merci à toi je vais regarder ça.
Ça me dit quelquechose
Bin j’ai plus le problème de hostname. J’ai un problème maintenant de configuration influxdb.
Traceback (most recent call last):
File "/app/main.py", line 70, in <module>
if "method" in INFLUXDB_CONFIG:
TypeError: argument of type 'bool' is not iterable
[18:42:39] FATAL: The app has crashed. Are you sure you entered the correct config options?
C’est quoi ? La configuration qui n’est pas bonne ?
J’ai ça en config. Avec l’ancienne version je n’avais pas de problème :
# Configuration InFluxDB
influxdb:
host: a0d7b954-influxdb
port: 8086
database: edf
username: !secret id_edf_seb #seb username EDF
password: !secret id_passwd_edf #passwd EDF enedys
max_retries: 3
default_measurement: state
# Configuration InFluxDB
influxdb:
host: a0d7b954-influxdb
port: 8086
database: edf
username: !secret id_edf_seb #seb username EDF
password: !secret id_passwd_edf #passwd EDF enedys
max_retries: 3
default_measurement: state
Pour my electra c’est ceci a mettre
influxdb:
enable: true
hostname: a0d7b954-influxdb
port: 8086
token: XXXXXX:XXXXXXXX
org: "-"
bucket: myelectricaldata/autogen
asynchronous: "false"
Tu melange en faite la !
avec
config/configuration.yaml
config/enedisgateway2mqtt/config.yaml
Sur le github de Myelectra tu as un model de config yaml
Ok. Je suis en mode boulet là…
Il faut que je mette ça dans le config.yaml de enidismqtt en fait.
J’ai vu son exemple, mais je pensais qu’il fallait le mettre dans configuration.yaml. Erreur de ma part.
Par contre il dit que dans « org » il faut mettre aussi myelectricaldata et non « - ». C’est juste ?
Sans deconé , ptdr ca arrive t’inquiète pas
Alors dans config/enedisgateway2mqtt/config.yaml
Le fichier est comme ceci
cycle: 14400
debug: false
home_assistant:
card_myenedis: true
discovery_prefix: homeassistant
enable: true
influxdb:
enable: true
hostname: a0d7b954-influxdb
port: 8086
token: XXXXXXXX:XXXXXXXXX
org: "-"
bucket: myelectricaldata/autogen
asynchronous: "false"
mqtt:
client_id: myelectricaldata
enable: true
hostname: core-mosquitto
password: EdXXXXXXXXX
port: 1883
prefix: myelectricaldata
qos: 0
retain: true
username: XXXXXX
myelectricaldata:
2121XXXXXXXX9:
name: Domicile
cache: true
consumption: true
consumption_detail: true
consumption_price_base: 0.22
enable: true
plan: BASE
token: XXXXXX
refresh_addresse: true
refresh_contract: true
Est dans ton fichier
config/configuration.yaml
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
scene: !include scenes.yaml
climate: !include climate.yaml
sensor: !include_dir_merge_list sensors
influxdb:
host: a0d7b954-influxdb
port: 8086
database: edf
username: !secret id_edf_seb #seb username EDF
password: !secret id_passwd_edf #passwd EDF enedys
max_retries: 3
default_measurement: state
Bon ça a l’air d’être parti.
Dans les logs il est en train de télécharger/récupérer tout un tas de données de myelectricaldata de 2022, mais aussi 2021…
Je verrai si j’ai des remontées dans la carte et je vous tiens au jus.