SMA Energy Meter in Home Assistant

Can you explain me, whats wrong?

So for the SMA Energy Meter, core-mosquitto should appear under MQTT_HOST. Try this.

It’s me again, with SMA Serials you don’t have to give anything.

I also doesnt receive any data. I habe changed the value like your plan


Hi, I had to reload the broker today.
Uninstall the add-on and then just reinstall it and just start it, if necessary reload the broker.
Often a restart of the whole HA helps.

look here.

Hello,

I’ve restarted everything several times. Unfortunately, uninstalling and reinstalling SMA EM was also unsuccessful. Is the error in the MQTT or maybe because the HA is not receiving any data from the HM 2.0. I installed an unmanged switch, I don’t think that’s the reason.

I started debug mode. Now I get these logs:

[s6-init] making user provided files available at /var/run/s6/etc…exited 0.
[s6-init] ensuring user provided files have correct perms…exited 0.
[fix-attrs.d] applying ownership & permissions fixes…
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts…
[cont-init.d] done.
[services.d] starting services
[services.d] done.
DEBUG:asyncio:Datagram endpoint remote_addr=None created: (<_SelectorDatagramTransport fd=8 read=idle write=<idle, bufsize=0>>, <main.MulticastServerProtocol object at 0x7f967e43a0>)
INFO:sensors:Unknown sensor: u1
INFO:sensors:Unknown sensor: u1
INFO:sensors:Unknown sensor: u1
INFO:sensors:Unknown sensor: p1consume
INFO:sensors:Unknown sensor: p1consumecounter
INFO:sensors:Unknown sensor: p2consume
INFO:sensors:Unknown sensor: p2consumecounter
INFO:sensors:Unknown sensor: p3consume
INFO:sensors:Unknown sensor: p3consumecounter
INFO:sensors:Unknown sensor: pconsume
INFO:sensors:Unknown sensor: pwrong
ic| res: []
INFO:sensors:Discover 0/11 sensors on SMA 4294967295
WARNING:asyncio:Executing <Task pending name=‘Task-2’ coro=<process_emparts() running at /usr/src/app/sensors.py:85> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f9665be80>()] created at /usr/local/lib/python3.9/asyncio/base_events.py:424> created at /usr/src/app/./run.py:29> took 0.333 seconds

Hi, All.

Like many, I’m relatively new to home assistant, but I’m so glad I found and opted for this platform. The possibilities seem endless!

Having followed the various instructions, I’ve managed to get as far as seeing data in the log on the SMA addon as per below.

So the ‘SMA Energy Meter’ Add-on has a connection to the hardware… I see values that change over time in the log.

The Device in HA is as per the second image

And looking at CPU percent///

Which I assume confirms the data from the ‘SMA Energy Meter’ Add-on is getting through?

But how do I access the values attached to the ‘FIELD’ names? in the first image. I understand that I need to configure these values into entites, but from there it all gets a bit muddy.

Thanks in advance for in help!

Just to add to my previous post…

I have now confirmed that I can see the values in the MQTT Explorer. Took me a while to spot the ‘OPEN WEB UI’ button :o?!

Now I’m just left with how to translate the senor values into Entities?

Hi Jim
If you go to developer tools and click on states and search for pconsume or psupply you should see the entity there.
Are you running Home Assistant Core? if yes you can use the Energy dash to track those entities.

Make sure you can see your SMA EM on your network.

there is a reset button on the SMA EM. looks like it can see the meter just cant see the sensors.

https://my.sma-service.com/s/article/Resetting-and-Restating-the-SMA-Energy-Meter?language=en_US

Hi Nick, Thanks for taking the time. I got distracted by about 10 other things.

In MQTT Explorer I see the values I’d expect coming from the SMA EM add-on.

eg:

▼homeassistant

▼sensor

▼1900242911

▼pconsume

config = {“name”: “pconsume”, “dev_cla”: “power”, “stat_t”: “SMA-EM/status/1900242911/pconsume”, “unit_of_meas”: “W”, “uniq_id”: “1900242911_pconsume”, “dev”: {“ids”: [“sma_em_1900242911”], “name”: “SMA Energy Meter”, “mdl”: “Energy Meter”, “mf”: “SMA”}}

:arrow_forward:pconsumecounter_max

image

and so on…

But in Dev Tools / STATES I can only see values I see attached to the device, which just came in when the add-on was first loaded.

image

I assume I need to ‘introduce’ these values to HA in some way, possibly involving a template? But how?

Could anyone confirm that this might be on the right track…

in configuration.yaml I have…

mqtt:
sensor:
- name: “pconsume12”
state_topic: “SMA-EM/status/1900242911/pconsume”
unit_of_measurement: “W”
unique_id: “1900242911_pconsume11”
value_template: “{{ value_json.pconsume }}”

A new entity does appear after a restart but info just shows as ‘Unavailable’.

Why are you writing something in the yaml ? Just search the integrations at mqtt and you will find everything you need.



1 Like

It was that simple? You’ve no idea how happy this makes me! Thank you! I’ve been at this for days…

Adding the broker Integration was the missing part of the puzzle.

Game changer! I kept thinking, it really shouldn’t be this hard! Thanks again.

No problem, I’m always happy to help.
I know what it’s like when you’re faced with a problem and don’t know what to do next.
How did you integrate your system/WR?

I installed a Sunny Home Manager 2.0. I can’t access the WebUI no matter what I try.
That’s probably why I can’t install it in Home Assistant with the official integration.
Could the problem be that HM2.0 reaches my router through a switch to which my PC is connected?

rozsap
If you find an answer to this I will keep my eyes out. Sunny Home manager from all I am finding out is a bit like Apple. We love to talk to apple devices but forget it if you are the people who run something else.
Pat