Using Slimmelezer+ to read data from energy meter Aidon 6534 with communication module 6442SE (swedish branschrekommendation)

Hi,

Like I said in the previous reply in this thread I used this one for my slimmelezer+:

https://github.com/Beaky2000/esphome-p1mini

I did a few changes to the yaml-file.
To match slimmelezer+ pins I changed “number” and “inverted” on uart to:

uart:
  - id: my_uart_1
    tx_pin:
      number: D8
      inverted: FALSE
      mode: OUTPUT_OPEN_DRAIN
    rx_pin:
      number: D7
      inverted: FALSE         # Set to false if inverting in hardware
      mode: INPUT_PULLUP     # Set to INPUT if inverting in hardware
    baud_rate: 115200
    rx_buffer_size: 512

As it also says in docs you need to set minimum period to 0s for slimmelezer:

p1_mini:
  - id: p1_mini_1
    uart_id: my_uart_1
    minimum_period: 0s       # Should be 0 (zero) if the RTS signal is not used.

Last thing is to add the state_class to the sensors.

For the cumulative ones:

state_class: "total_increasing"

And for the momentary ones:

state_class: "measurement"
3 Likes

Puh, thank you! Everything seems to be back! Thank you!

1 Like

Hi, I’m using the home assistant operating system but can’t seem to figure this out. I tried the repo from the Mrglad’s message but I can’t install it to slimmelezer.
This is the error I get


INFO ESPHome 2025.2.2
INFO Reading configuration /config/esphome/esphome-web-0af352.yaml...
ERROR Unexpected exception while reading configuration:
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/esphome/esphome/__main__.py", line 1049, in main
    return run_esphome(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 1027, in run_esphome
    config = read_config(dict(args.substitution) if args.substitution else {})
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/config.py", line 1095, in read_config
    res = load_config(command_line_substitutions)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/config.py", line 949, in load_config
    return _load_config(command_line_substitutions)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/config.py", line 939, in _load_config
    return validate_config(config, command_line_substitutions)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/config.py", line 835, in validate_config
    target_platform = core_config.preload_core_config(config, result)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/core/config.py", line 222, in preload_core_config
    if _is_target_platform(domain):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/core/config.py", line 184, in _is_target_platform
    if get_component(name, True).is_target_platform:
       ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/loader.py", line 205, in get_component
    return _lookup_module(domain, exception)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/loader.py", line 181, in _lookup_module
    module = importlib.import_module(f"esphome.components.{domain}")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1142, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'esphome.components.p1reader'

Mrglad had links to two repos, the orginal and the fork - use the fork! Exaclty the one I wrote about in my reply in this thread 5 days ago.

1 Like

Now I’m getting this :

INFO ESPHome 2025.2.2
INFO Reading configuration /config/esphome/esphome-web-0af352.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing p1mini (board: d1_mini; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
Dependency Graph
|-- ESPAsyncTCP-esphome @ 2.0.0
|-- ESPAsyncWebServer-esphome @ 3.2.2
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- ArduinoJson @ 6.18.5
Compiling .pioenvs/p1mini/src/main.cpp.o
Compiling .pioenvs/p1mini/lib67b/ESP8266WiFi/ESP8266WiFiAP.cpp.o
Compiling .pioenvs/p1mini/lib67b/ESP8266WiFi/ESP8266WiFiGeneric.cpp.o
Compiling .pioenvs/p1mini/lib67b/ESP8266WiFi/ESP8266WiFiGratuitous.cpp.o
Compiling .pioenvs/p1mini/lib67b/ESP8266WiFi/ESP8266WiFiMulti.cpp.o
Compiling .pioenvs/p1mini/lib67b/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o
Compiling .pioenvs/p1mini/lib67b/ESP8266WiFi/ESP8266WiFiSTA.cpp.o
In file included from src/esphome.h:29,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:70: error: 'text_sensor' has not been declared
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |                                                                      ^~~~~~~~~~~
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:83: error: expected '{' before 'TextSensor'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |                                                                                   ^~~~~~~~~~
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:95: error: expected unqualified-id before 'public'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |                                                                                               ^~~~~~
Compiling .pioenvs/p1mini/lib67b/ESP8266WiFi/ESP8266WiFiScan.cpp.o
src/main.cpp: In function 'void setup()':
src/main.cpp:485:66: error: invalid use of incomplete type 'class esphome::p1_mini::P1MiniTextSensor'
  485 |   p1_mini_p1minitextsensor_id = new p1_mini::P1MiniTextSensor("/");
      |                                                                  ^
In file included from src/esphome.h:29,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:15: note: forward declaration of 'class esphome::p1_mini::P1MiniTextSensor'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |               ^~~~~~~~~~~~~~~~
src/main.cpp:486:30: error: invalid use of incomplete type 'class esphome::p1_mini::P1MiniTextSensor'
  486 |   p1_mini_p1minitextsensor_id->set_component_source("p1_mini.text_sensor");
      |                              ^~
In file included from src/esphome.h:29,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:15: note: forward declaration of 'class esphome::p1_mini::P1MiniTextSensor'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |               ^~~~~~~~~~~~~~~~
src/main.cpp:488:28: error: cannot convert 'esphome::p1_mini::P1MiniTextSensor*' to 'esphome::text_sensor::TextSensor*'
  488 |   App.register_text_sensor(p1_mini_p1minitextsensor_id);
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                            |
      |                            esphome::p1_mini::P1MiniTextSensor*
In file included from src/esphome.h:60,
                 from src/main.cpp:3:
src/esphome/core/application.h:119:54: note:   initializing argument 1 of 'void esphome::Application::register_text_sensor(esphome::text_sensor::TextSensor*)'
  119 |   void register_text_sensor(text_sensor::TextSensor *sensor) { this->text_sensors_.push_back(sensor); }
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
src/main.cpp:489:30: error: invalid use of incomplete type 'class esphome::p1_mini::P1MiniTextSensor'
  489 |   p1_mini_p1minitextsensor_id->set_name("Meter ID");
      |                              ^~
In file included from src/esphome.h:29,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:15: note: forward declaration of 'class esphome::p1_mini::P1MiniTextSensor'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |               ^~~~~~~~~~~~~~~~
src/main.cpp:490:30: error: invalid use of incomplete type 'class esphome::p1_mini::P1MiniTextSensor'
  490 |   p1_mini_p1minitextsensor_id->set_object_id("meter_id");
      |                              ^~
In file included from src/esphome.h:29,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:15: note: forward declaration of 'class esphome::p1_mini::P1MiniTextSensor'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |               ^~~~~~~~~~~~~~~~
src/main.cpp:491:30: error: invalid use of incomplete type 'class esphome::p1_mini::P1MiniTextSensor'
  491 |   p1_mini_p1minitextsensor_id->set_disabled_by_default(false);
      |                              ^~
In file included from src/esphome.h:29,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:15: note: forward declaration of 'class esphome::p1_mini::P1MiniTextSensor'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |               ^~~~~~~~~~~~~~~~
src/main.cpp:492:30: error: invalid use of incomplete type 'class esphome::p1_mini::P1MiniTextSensor'
  492 |   p1_mini_p1minitextsensor_id->set_icon("mdi:identifier");
      |                              ^~
In file included from src/esphome.h:29,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:15: note: forward declaration of 'class esphome::p1_mini::P1MiniTextSensor'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |               ^~~~~~~~~~~~~~~~
src/main.cpp:494:30: error: invalid use of incomplete type 'class esphome::p1_mini::P1MiniTextSensor'
  494 |   p1_mini_p1minitextsensor_id->set_filters({text_sensor_substitutefilter_id});
      |                              ^~
In file included from src/esphome.h:29,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:15: note: forward declaration of 'class esphome::p1_mini::P1MiniTextSensor'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |               ^~~~~~~~~~~~~~~~
src/main.cpp:495:35: error: cannot convert 'esphome::p1_mini::P1MiniTextSensor*' to 'esphome::p1_mini::IP1MiniTextSensor*'
  495 |   p1_mini_1->register_text_sensor(p1_mini_p1minitextsensor_id);
      |                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                   |
      |                                   esphome::p1_mini::P1MiniTextSensor*
In file included from src/esphome.h:27,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/p1_mini.h:64:58: note:   initializing argument 1 of 'void esphome::p1_mini::P1Mini::register_text_sensor(esphome::p1_mini::IP1MiniTextSensor*)'
   64 |             void register_text_sensor(IP1MiniTextSensor *sensor)
      |                                       ~~~~~~~~~~~~~~~~~~~^~~~~~
Compiling .pioenvs/p1mini/lib67b/ESP8266WiFi/WiFiClient.cpp.o
In file included from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/move.h:57,
                 from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/bits/stl_pair.h:59,
                 from /data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/utility:70,
                 from src/esphome/components/binary_sensor/automation.h:4,
                 from src/esphome.h:3,
                 from src/main.cpp:3:
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/type_traits: In instantiation of 'struct std::is_base_of<esphome::Component, esphome::p1_mini::P1MiniTextSensor>':
src/esphome/core/application.h:190:50:   required from 'C* esphome::Application::register_component(C*) [with C = esphome::p1_mini::P1MiniTextSensor]'
src/main.cpp:487:53:   required from here
/data/cache/platformio/packages/toolchain-xtensa/xtensa-lx106-elf/include/c++/10.3.0/type_traits:1412:38: error: invalid use of incomplete type 'class esphome::p1_mini::P1MiniTextSensor'
 1412 |     : public integral_constant<bool, __is_base_of(_Base, _Derived)>
      |                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/esphome.h:29,
                 from src/main.cpp:3:
src/esphome/components/p1_mini/text_sensor/p1_mini_text_sensor.h:13:15: note: forward declaration of 'class esphome::p1_mini::P1MiniTextSensor'
   13 |         class P1MiniTextSensor : public P1MiniTextSensorBase, public text_sensor::TextSensor, public Component
      |               ^~~~~~~~~~~~~~~~
In file included from src/esphome.h:60,
                 from src/main.cpp:3:
src/esphome/core/application.h: In instantiation of 'C* esphome::Application::register_component(C*) [with C = esphome::p1_mini::P1MiniTextSensor]':
src/main.cpp:487:53:   required from here
src/esphome/core/application.h:190:50: error: 'value' is not a member of 'std::is_base_of<esphome::Component, esphome::p1_mini::P1MiniTextSensor>'
  190 |     static_assert(std::is_base_of<Component, C>::value, "Only Component subclasses can be registered");
      |                                                  ^~~~~
*** [.pioenvs/p1mini/src/main.cpp.o] Error 1
========================= [FAILED] Took 15.91 seconds =========================

I managed to get it working. I had to git clone it and then move the clone to /config/esphome directory. Git wouldn’t do that because it was not empty.

I am trying to get a Slimmelezer+ to work.
If I download the fork I dont get any Components folders? just the .yaml and .h then I make the secrets.yaml myself.
Edited the uart: section in .yaml, but the p1_mini: section isnt anywere?
and the last 2 changes cumulatives ones and momentary ones I cant find either…
I am really lost here.

Also section sensor in p1mini.yaml refers to Platform : custom and thats not allowed anymore and it says use an externel component, thats alot above my knowledge.
Edit: this was the main and the fork have had this fixed right?

Im getting my gasburner and toosting this Slimmelezer+.
I simply dont have the time to invest in learning me alot more stuff and use it one or two times… then next project and im stuck again… have fun.

maybee not after all…

soo getting all the files into my esphome directory isnt ezy, cant get access with SSH/Putty for some reason.

Im using native HAOS on a pie4 with external m.2 over usb.
soo no docker, oh and thats also supose to soo ezy… naa not going there…

Can’t really follow. The components folder is in the git, dont know why you don’t see it. Just download it manually and place where it needs to be.

The p1_mini section in the yaml looks like this:

and the state_class you need to add to the sensors like this:

Slow down.

This is strange?? I have uploaded this file several times and and it whould always look different than this?? I deleted all files in archive before uploding again and now it looks better, HA must have restored old files somehow??

well this was alot better… now Im on track again… alot of thanks for the repons…

EDIt: I see the state_class and also device_class missing on some sensors, ill try to add that also, amps or voltage or what is in mind, My line of work :slight_smile:

Removed encryption since its a pita to get it to accept a key, no need for it anyways internaly, and it validated ok , yeeey…

Now I got some compilation error but thats for tomorrow… Im out. :slight_smile:

I got it to work, couldnt install it from HA esphome builder soo I choosed Install but just saved the bin file in HA ESPhome builder and then installed it using ESP

it works fine

Tnx for all help.

Seems to be sorted now, but regardless, I have an Aidon 6534 and made a component that combines the default DSMR component with a custom parser to support Branschstandard 2.0 / EFS2 (as well as regular DSMR5 etc), available with config examples at GitHub - erikced/esphome-efs: DSMR/EFS2 ESPHome custom component.

1 Like