GammaTroniques / TICMeter

TICMeter is a small product to collect data from a Linky meter and send them to a home automation server via MQTT, Zigbee or HTTP
Other
29 stars 4 forks source link

Missing entities in home assistant with MQTT #14

Open baptistebisson opened 2 weeks ago

baptistebisson commented 2 weeks ago

The problem encountered

Hello. I've just setup the device with zigbee thanks to zigbee2mqtt. On the web interface, I have all the data:

Screenshot 2024-06-19 at 20 04 06

But in home assistant, I only have unnecessary values:

Screenshot 2024-06-19 at 20 05 44

It's also not updating after the first update.

In the MQTT info button, you can see that all data is available and up to date:

Screenshot 2024-06-19 at 20 07 20

Any idea ? Thanks

Firmware version

No response

Steps for reproducing the error

No response

What I've already tested

No response

Relevant log output

No response

AurelTyson commented 1 week ago

Hello, same problem on my side. Updated to the latest version and the problem is still here. Don't hesitate to ping me if you need more informations 😊

dbozec commented 1 week ago

Same here

damienbunlet commented 1 week ago

Bonjour,

Avant de commencer, je tiens à préciser que cela sera peut être plus simple de poursuivre en français pour le bien de ce ticket.

J'ai constaté le même soucis que vous dés lors que j'ai reçu mon TICMeter hier. J'ai donc cherché à savoir d'où pouvait provenir ce soucis.

Lorsque j'ai consulté les logs de HA, j'ai pu constaté que la découverte automatique via MQTT ne fonctionnait pas correctement :

Enregistreur: homeassistant.components.mqtt.discovery
Source: components/mqtt/discovery.py:228
intégration: MQTT (documentation, problèmes)
S'est produit pour la première fois: 25 juin 2024 à 21:39:12 (50 occurrences)
Dernier enregistrement: 16:11:50

Received message on illegal discovery topic 'homeassistant/sensor/0x404ccafffe53b308/Index BASE/config'. The topic contains not allowed characters. For more information see https://www.home-assistant.io/integrations/mqtt/#discovery-topic
Received message on illegal discovery topic 'homeassistant/sensor/0x404ccafffe53b308/Intensité instantanée/config'. The topic contains not allowed characters. For more information see https://www.home-assistant.io/integrations/mqtt/#discovery-topic
Received message on illegal discovery topic 'homeassistant/sensor/0x404ccafffe53b308/Intensité maximale/config'. The topic contains not allowed characters. For more information see https://www.home-assistant.io/integrations/mqtt/#discovery-topic
Received message on illegal discovery topic 'homeassistant/sensor/0x404ccafffe53b308/Dépassement de puissance/config'. The topic contains not allowed characters. For more information see https://www.home-assistant.io/integrations/mqtt/#discovery-topic
Received message on illegal discovery topic 'homeassistant/number/0x404ccafffe53b308/Durée d'actualisation/config'. The topic contains not allowed characters. For more information see https://www.home-assistant.io/integrations/mqtt/#discovery-topic

En analysant donc les topics à l'aide de MQTT Explorer, j'ai constaté que le soucis venait du fait qu'il y avait des espaces dans le noms de certains paramètres.

image

Seuls ceux écrits en minuscules avec les traits du 8 sont affichés côté Home Assistant.

Je ne vois cependant pas où effectuer la modification au sein de ce code. Faut-il faire une modification côté Z2M peut être ?

EDIT : Pour plus de précision voici le message du topic concernant la puissance apparente :

{
   "availability":[
      {
         "topic":"zigbee2mqtt/bridge/state"
      },
      {
         "topic":"zigbee2mqtt/TICMeter/availability"
      }
   ],
   "availability_mode":"all",
   "device":{
      "identifiers":[
         "zigbee2mqtt_0x404ccafffe53b308"
      ],
      "manufacturer":"GammaTroniques",
      "model":"TICMeter pour Linky (TICMeter)",
      "name":"TICMeter",
      "sw_version":"V3.2.7",
      "via_device":"zigbee2mqtt_bridge_0x00124b00237ba4e0"
   },
   "enabled_by_default":true,
   "json_attributes_topic":"zigbee2mqtt/TICMeter",
   "name":"Puissance Apparente",
   "object_id":"ticmeter_Puissance Apparente",
   "origin":{
      "name":"Zigbee2MQTT",
      "sw":"1.38.0",
      "url":"https://www.zigbee2mqtt.io"
   },
   "state_topic":"zigbee2mqtt/TICMeter",
   "unique_id":"0x404ccafffe53b308_Puissance Apparente_zigbee2mqtt",
   "unit_of_measurement":"VA",
   "value_template":"{{ value_json.apparent_power }}"
}

On voit que "object_id" fait intervenir un nom d'objet avec un espace, ce qui a aussi une répercussion sur "unique_id" également.

xmow49 commented 1 week ago

Slt, Yes, ca a été fix il y a 2 semaines ici: https://github.com/Koenkk/zigbee-herdsman-converters/pull/7640 Il faut attendre la mise à jour Z2M... Normalement il y en a une par mois.

damienbunlet commented 1 week ago

Parfait, je vois que les mises à jour ont principalement lieu dès la première semaine du mois, on verra peut être du coup la mise à jour de Z2M la semaine prochaine. En attendant, voulant suivre la puissance apparente, j'ai ajouté ces lignes dans mon fichier configuration.yaml sur HA :

mqtt:
  sensor:
    - availability:
        - topic: zigbee2mqtt/bridge/state
        - topic: zigbee2mqtt/TICMeter/availability
      availability_mode: all
      device_class: apparent_power
      device:
        identifiers:
          - zigbee2mqtt_0x404ccafffe53b308
        manufacturer: GammaTroniques
        model: TICMeter pour Linky (TICMeter)
        name: TICMeter
        sw_version: V3.2.7
        via_device: zigbee2mqtt_bridge_0x00124b00237ba4e0
      enabled_by_default: true
      json_attributes_topic: zigbee2mqtt/TICMeter
      name: Apparent Power
      object_id: ticmeter_apparent_power
      state_topic: zigbee2mqtt/TICMeter
      unique_id: 0x404ccafffe53b308_apparent_power_zigbee2mqtt
      unit_of_measurement: VA
      value_template: '{{ value_json.apparent_power }}'

A adapter et à implémenter manuellement pour les autres données si jamais la prochaine mise à jour de Z2M ne corrige pas le soucis.

xmow49 commented 2 days ago

Tester avec la dernière update Z2M (1.39.0), ca fontionne image

Si cela ne se règle pas tout seul, vous pouvez tenter de supprimer le ticmeter de Z2M en cochant "Forcer la suppression" et de le reappairer.

baptistebisson commented 1 day ago

Étant passé en mode STANDARD, je ne pourrais valider le fonctionnement, car je n'ai aucune donnée.

dbozec commented 14 hours ago

Problème corrigé avec la mise à jour Z2M 1.39.0 en effet :)