antonijn / mqtt4dsmr

Yet another DSMR to MQTT daemon, with Home Assistant support
ISC License
2 stars 0 forks source link

No Entities in Home Assistant #3

Closed dajomas closed 5 months ago

dajomas commented 5 months ago

Python: 3.12.2 HA Core: 2024.2.0 (on a VM) SmartMeter: Landis&Gyr E350 (DSMR 2.2+) P1 connected to an RPi via serial splitter (used ser2net in the past which worked but ser2net was not stable enough)

I created the following compose.yaml file:

version: "3"

services:
  mqtt4dsmr:
    image: "ghcr.io/antonijn/mqtt4dsmr:latest"
    environment:
      MQTT_HOST: "***"
      MQTT_PORT: "1883"
      MQTT_USERNAME: "***"
      MQTT_PASSWORD: "***"
      DSMR_VERSION: V2_2
      SERIAL_SETTINGS: V2_2
    devices:
      - "/dev/serial/by-id/usb-FTDI_FT232R_USB_UART_A50285BI-if00-port0:/dev/ttyDSMR"
    restart: always

via MQTT Explorer, I can see a topic dsmr which only contains a status with value online but I can't find any entries in the homeassistant topic and in HA, I can't find any dsmr entries either.

Did I miss anything? Where should I find the dsmr entries in HA?

Thanx for your help.

antonijn commented 5 months ago
  1. What does docker logs mqtt4dsmr report?
  2. Are you using the MQTT integration in Home Assistant? Are other MQTT devices working as expected?
dajomas commented 5 months ago
/srv/mqtt4dsmr $ docker logs mqtt4dsmr-mqtt4dsmr-1
2024-02-21 11:49:12,346 INFO Using mqtt4dsmr v0.9.4
2024-02-21 11:49:12,348 WARNING Not using MQTT over TLS; set MQTT_PORT=8883 or MQTT_TLS=1 to enable TLS
2024-02-21 11:49:12,348 INFO Using MQTT username/password authentication
2024-02-21 11:49:12,349 INFO Connecting to mqtt.godfried.net:1883
2024-02-21 11:49:12,349 INFO Availibility topic: dsmr/status
2024-02-21 11:49:12,370 INFO Connected to broker
/srv/mqtt4dsmr $

And yes, I am using the MQTT integration succesfully with Zigbee2MQTT (2 instances, over 80 devices), ZWave JS UI (formerly Zwave2MQTT) and ITHOWiFi

antonijn commented 5 months ago

I suspect this has something to do with the serial settings. If you set the environment variable LOG_LEVEL=DEBUG in the container, do the logs show that any serial messages are received?

I suggest you try SERIAL_SETTINGS=V4 or even SERIAL_SETTINGS=V5.

The device will only show up in Home Asssistant after a serial message is successfully read from the P1 port; only then does the application know exactly which information is available. Perhaps I should make this situation easier to troubleshoot - have the device show up in Home Assistant with a message that it is not receiving messages. Something like that.

dajomas commented 5 months ago

I set SERIAL_SETTINGS=V5 in compose.yaml and export LOG_LEVEL=DEBUG on the commandline and ran docker compose up -d

/srv/mqtt4dsmr $ docker logs mqtt4dsmr-mqtt4dsmr-1
2024-02-21 17:30:36,110 INFO Using mqtt4dsmr v0.9.4
2024-02-21 17:30:36,113 WARNING Not using MQTT over TLS; set MQTT_PORT=8883 or MQTT_TLS=1 to enable TLS
2024-02-21 17:30:36,114 INFO Using MQTT username/password authentication
2024-02-21 17:30:36,115 INFO Connecting to mqtt.godfried.net:1883
2024-02-21 17:30:36,116 INFO Availibility topic: dsmr/status
2024-02-21 17:30:36,139 INFO Connected to broker
/srv/mqtt4dsmr $

And nothing changed in MQTT and HA

antonijn commented 5 months ago

The LOG_LEVEL=DEBUG option must be specified in compose.yml, sorry for not making that clear. Have you tried serial settings V4? I suspect we're dealing with the DSMR 4 version of this meter.

dajomas commented 5 months ago

I'll give that a try now. On the meter it actually says DSMR 2.2+

dajomas commented 5 months ago

I finally got it working!

Problem was on my end: a fault cable. Replace the P1 cable and all is working now. DMSR_VERSION and SERIAL_SETTING are set to V2_2 and I have a DSMR Smart Meter device in the MQTT devices list