Migration P1 cable from Domoticz to HomeAssistant - values not updating

Hi, I am a newbe with Home Assistent. I have read through a lot of websites and viewed several YouTube videos. So excuse me if I asked some beginners questions!

I am migrating from Domoticz. With Domoticz I was monitoring my energy consumption. This was working without major problems for about 8 years. Now I would like to move to Home Assitant.

Dutch Smart meter: Kaifa M105C

Old situation:
Device: Raspberry Pi B+ with Raspbian OS and Domoticz
P1 cable connected directly to the Raspberry USB port and to the Kaifa smart meter on the other end of the cable.

New situation:
Device: Raspberry Pi 4B, 2GB ram
The same P1 cable connected directly to the Raspberry Pi 4B USB port and to the Kaifa smart meter on the other end of the cable.
Home Assistant 2022.09.1 (superviser)
Operating system 9.0

I have added in the configuration.yaml file:

sensor:
  - platform: dsmr
    port: /dev/ttyUSB0
    dsmr_version: 5

After restart I see the integration:
dsmr

And I even get the several values:
waardes

But the problem is, that those values are fixed and they are not being updated. I have also played with the update value (10 sec instead of the default 30, but also 0 sec, to get values if they are sent by the smart meter).

This is what I see under the hardware:

So the values are read once and they are not updating.
If I plug this P1 USB cable back in the Domoticz Raspberry, it is working great, so I think the cable must be compatible.

Maybe I will use an esp board with mqtt protocol in the future, but for now I would like to use the P1 USB cable, because the Raspberry with Home Assistant lays next to the smart meter.

Can someone help me, why the values are not updating?
Sorry for being a noob in Home Assistant, I have to learn a lot!

Have you tried to set it up using the DSMR integration for the P1 port, because that is the official way of using an integration. The yaml integrations is probably not properly supported anymore.

Hi, thank you for your reply!

I have removed the lines in configuration.yaml and have also removed the DSMR integration.
After rebooting the Raspberry I have tried to re-install, but still did not succeed.

I have tried several combinations:
/dev/ttyUSB0 and /dev/ttyAMA0
Version 2.2, 4 and 5 (Dutch meter).

But everytime I get the message “could not connect”
error

If the USB P1 cable works with Domoticz, I assume, it will also work with Home Assistant?

With the extra lines in the configuration.yaml file I suddenly did get a few values, but that stopped again after about 5 values…

There could be 2 reasons for this:

  • The P1 cable is not a supported cable, or,

  • The P1 USB is on a different address from what you and HA assumes. This may happen if you connect and disconnect the USB.

I would check which device address has been assigned to the USB (command: ls -l /dev/ttyU* ). Are there any messages in the log on this ?, maybe you have to enable debug for the dsmr integration.

I have succesfully moved a P1 cable from Domoticz. That is on the same pi, first we had domotics and we replaced it by HA, so it is possible.

BTW are you on latest pi OS ?

It is a selfmade cable.

It worked on a Raspberry Pi B+ with Domotcz.
Now I am trying with a Raspberry Pi 4B with Home Assistant.

So, same smart meter, same USB P1 cable, different device, different software.
I think, if the cable works with Domtoicz, it should also work with Home Assistant?

After rebooting the device, values are visible, so the USB address has been found? Only the update does not work and the values stay frozen.
Where/how can I look in the log?

I am using using the Home Assistant OS flashed from the complete image, as per installation

Well then I think HA OS has a problem with your home made cable. I presume that Domoticz was running in raspbian OS (like I had in my situation) and there moving to HA was without any problems, so the only possible conclusion is that something is wrong/missing in HA OS so your P1cable doesnt work. I suggest you try rasbian OS and give that a whirl, or search this forum for other people having problems with HA OS, maybe a plugin is missing ?

Thank you for your help!
Because the cable is still working within Domoticz, I was thinking the cable would not be the problem, but like you said, it is another OS.
Because I just started, Maybe it is good to try your suggestion with Rasbian OS first, or I will try to use some kind of DSMR reader and send the values thruogh MQTT…

Within Domoticz I had to set things like Baudrate. Is that maybe nescessary or even possible within Home Assistant?

No you don’t have to set that inside the HA DSMR integration, he will find out himself (by trial and error I presume).

If you are going to try with raspbian OS, I would recommend some extra time for setting it up using docker technology, extremely flexible and very easy to maintain. Plenty of instructions and configs for that on this forum. I use solely docker images for just about everything.

For now I have solved it differently.
I have removed the usb-serial converter part from the P1 cable and attached the other side (with inverter and RJ connector) to a esp8266 wifi board.

After flashing it with esphome it is working now!

Thank you for your help.

Well, I did choose another way… I have flashed an esp board with esphome and connected part of the P1 cable to this esp. Now I have the right values and they are updated every 10 seconds!

So maybe for some reason the Raspberry was not compatible with this cable, even when Domoticz did work with it great.

Thanks for the help.