Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate to Home assistant #1

Closed
bf8392 opened this issue Dec 2, 2021 · 28 comments
Closed

Integrate to Home assistant #1

bf8392 opened this issue Dec 2, 2021 · 28 comments

Comments

@bf8392
Copy link

bf8392 commented Dec 2, 2021

Hey ?=) Your solution looks interesting =). Is it also possible to Integrate this solution in Home assistant, and if yes how?

@Netskeh
Copy link
Contributor

Netskeh commented Dec 3, 2021

Hello,

unfortunately I am not familiar with Home Assistant myself, so I'll have to rely on documentation to be able to give you pointers.

As far as I can tell, Home Assistant is able to communicate via MQTT. See here: https://www.home-assistant.io/docs/mqtt/
So the first step would be for you to set this functionality up and take a look at this example code in this repository: https://github.com/NEXXTLAB/go-smarty-reader/blob/master/cmd/OnlineDecryptionAndPublishing/main.go

After that you will need something which will be able to interpret DSMR messages, I was able to find these 2, pick which ever you prefer.

And starting from here you have the data available in your Home Assistant.

Finally a word of advice. If you rely in a private MQTT broker there is not much to worry about, however if you use an external / public broker you want want to pay attention to 2 aspects in particular:
(1) Make sure the communication is encrypted (TLS/MQTTS),
(2) Instead of using the example code I sent you, which decrypts your data, you may want to use a combination of CipherForwarding and MQTTMessage, both found HERE. This would take the encrypted message from your smart meter and send that. Advantage: even if someone has access to that payload, not one will be able to read it. Disadvantage: you will need to decrypt the message in your Home Assistant, which appears to be the case for the first suggested link above?

@bf8392
Copy link
Author

bf8392 commented Dec 3, 2021

Wow great thanks! I think I'm gonna try it out =). As far as I know, these two need a serial connection (for example with ser2net like described here: https://www.home-assistant.io/integrations/dsmr/
Optional configuration example for ser2net 4.x.x:

Example /etc/ser2net.yaml for proxying USB/serial connections to DSMRv4 smart meters

connection: &con0096
accepter: tcp,2001
enable: on
options:
banner: *banner
kickolduser: true
telnet-brk-on-sync: true
connector: serialdev,
/dev/ttyUSB0,
115200n81,local

is this also in your solution? because this would be the optimum for Home assistant and to stay interconnectable =). Also do you have a predefined Image (like for raspberryppi which you can simply flash). Or do I have to build it? =). Just for the understanding what I try to do:

I want to grab an USB to P1 cable and a raspberrypi zero w, plug it there, and let the values send to another pi, where Home-Assistant runs (over wifi with ser2net). Then I would have all values in Home assistant. Would this be possible?

@Netskeh
Copy link
Contributor

Netskeh commented Dec 3, 2021

if you happen to have your home assistant device close to your smart meter, can can skip go-smarty-reader all together and just connect your serial cable to home assistant & the DSMR integration.

If this not the case, then the solution presented in this repository can indeed help you, and yes establishing the serial connection is part of this (as seen HERE ).
However there are no images or containers available. That might be indeed a nice addition. For now you will need to follow the build instructions, or if you are inclined to do so - provide a container configuration which I will test as soon as I can.

To answer your question, assuming both RPIs are not next to each other, you will need to install golang on your first device, and have this application connect to an MQTT broker. Either home assistant offers something, or just install an MQTT broker on either RPI. Then, using the MQTT & DMSR integration you should be able to get the different measurements into Home Assistant. Right now I do not know what additional use ser2net would have.

@bf8392
Copy link
Author

bf8392 commented Dec 3, 2021 via email

@marcddd
Copy link

marcddd commented Dec 4, 2021

I set up dsmr with Domoticz on a raspberry pi 3. The software includes a possibility to enter a decryption key. Then I publish the values via mqtt to home assistant. Not an very elegant solution but it works.

@Netskeh
Copy link
Contributor

Netskeh commented Dec 4, 2021

indeed the MQTT payload is no longer the serial signal from the smartmeter, instead it is in its string (text) form, similar to what you can find in this document on page 24 & 25. Interesting enough, the integration you linked has a DIY solution which also sends its data via MQTT.

In the case of Luxembourg you also have to option to send the encrypted data via MQTT, yet you will need to handle the decryption step yourself, or find an integration which handles it for you.

However I see the need to update this solution to be easier to deploy, update golang and the dependencies. If time permits I will start looking into that.

Looking into other solutions like marcddd mentioned is obviously also a path to investigate. The important part is reach the goal of getting your data into your home automation tool.

@bf8392
Copy link
Author

bf8392 commented Dec 6, 2021

(text) form, similar to what you can find in this document
-> so this would be the mqtt output?

yet you will need to handle the decryption step yourself,
-> So in Luxembourg I would have the problem that I can't use your solution with home assistant, cause it handels the decryption in the DSMR Integration, which awaits a serial connection...

The solution of @marcddd is a nice workaround thanks! but yet not very useable as I want it to keep the rpi zero on the meter as simple as possible...

I've heard you also made a "plug and play" hardware-solution is that true?

@marcddd
Copy link

marcddd commented Dec 6, 2021

I found this on the web. It could be a solution too.

https://github.com/zuidwijk/dsmr

https://www.zuidwijk.com/product/slimmelezer/

@bf8392
Copy link
Author

bf8392 commented Dec 7, 2021

Wow that looks nice! Great thanks =) Gonna look into it :-)

@alexboss
Copy link

alexboss commented Jun 2, 2022

Hi @bf8392
Did you look into the slimmelezer? It is officially supported and promoted by Home Assistant.
Would love to give it a try but before make sure it would work on the LU meters (which are apparently following the same standards as the NL / BE meters).
Also, hope Sudstroum will provide the keys to decrypt the signals.
Thank you.
Alexandre

PS: I'm afraid SmartyPlus and Smartbirds are missing a lot of potential buyers as long as they don't provide integrations in Home Assistant / OpenHab / JeeDom / Domoticz / etc.

@d1nd141
Copy link

d1nd141 commented Jun 2, 2022

I installed the SlimmeLezer+ a few month ago. Works excellent with HA! No additional power supply needed. (Powered over RJ12 connector)
To be able to read the GAS values, you have to ask to Creos / Luxmetering to add your Gas contract to your Luxmetering contract.

Regarding the key: should be no problem, just ask them.

@bf8392
Copy link
Author

bf8392 commented Jun 2, 2022

@alexboss yes I meanwhile found an bought a Slimmelezer2, and it is amazing :-) I first tried it with the esp-link software, which I didn't get integrated in Home assistant at all, but with the esp-home approach, it worked like a charm :-). I can recommend it very much, as it even doesn't use extra power...it's powered by the P1 port itself so it's very flexible!

After getting the decryption-key for my Luxembourg-meter, the data streams in perfectly :-)

If anyone need any help to set this up for ha, just look here: https://community.home-assistant.io/t/how-to-set-up-slimmelezer-with-home-assistant-for-dummies/335174

Worked perfectly for me :-)

@bf8392
Copy link
Author

bf8392 commented Jun 2, 2022

Uh nice I didn't try gas yet! Also want to try water :-)

@alexboss
Copy link

alexboss commented Jun 2, 2022

Thanks @bf8392 and @d1nd141 for your precious feedback and confirming it works on LU meters, even without extra power supply, greatly appreciated 👍
Gonna order a Slimmelezer right now (but will order the ethernet version since don't want to add an extra wifi repeater in the garage where the meter is installed).
This way, we'll know if it also works as perfectly with the ethernet version as with the wifi version.
Concerning the gas meter, I'm not connected to the grid, and for the water, didn't know there was a "smart" water meter; the one from Mamer is a good old classical / mechanical one.
Merci encore 🙏

@d1nd141
Copy link

d1nd141 commented Jun 2, 2022

Only a few city's in Lux are connecting the water counter to the Luxmetering power counter. They have long term contracts with company's providing water-counters, so they can't switch easily to Luxmetering devices.

Anyway, afaik the water counter feature is not yet implemented in Slimmelezer.

@marcddd
Copy link

marcddd commented Jun 2, 2022

I got a watermeter but can't get it to work. I think esphome hasn't configured the sensor for this.

The watermeter is a GWF, modell MTK3coder Mp water meter and has a M-Bus M7. The gas meter runs on channel 1 and the water meter on channel 2 of the m-bus. Both are connected via one cable to a sagecom t-210d.

Thus the gasmeter is sending values the water meter should too.

Anyone an idea how ro resolve the problem.

Slimmeleezer+ is working great on luxemburgisch meter like mine. Till now of course only gas and electricity. You just need the key and ask for the gas meter to be configured by your provider.

@alexboss
Copy link

alexboss commented Jun 7, 2022

Hmmm... I have a similar water meter, the only difference is that it is covered with some Radio transmitter to allow the commune to retrieve consumption and other metrics remotely: Supercom 581.

There's a nice DIY tutorial for measuring the water consumption: https://www.pieterbrinkman.com/2022/02/02/build-a-cheap-water-usage-sensor-using-esphome-home-assistant-and-a-proximity-sensor/

But since there's this huge radio transmitter on my meter, I'm afraid the proximity sensor won't be powerful enough to trigger the magnet / electric pulses.

@alexboss
Copy link

alexboss commented Jun 15, 2022

Thanks @bf8392 and @d1nd141 for your precious feedback and confirming it works on LU meters, even without extra power supply, greatly appreciated 👍 Gonna order a Slimmelezer right now (but will order the ethernet version since don't want to add an extra wifi repeater in the garage where the meter is installed). This way, we'll know if it also works as perfectly with the ethernet version as with the wifi version. Concerning the gas meter, I'm not connected to the grid, and for the water, didn't know there was a "smart" water meter; the one from Mamer is a good old classical / mechanical one. Merci encore 🙏

Alright, I received the Slimmelezer P1 Ethernet and got a headache to configure it... While Slimmelezer+ has ESPHome integrated and is natively supported by HA, the P1 Ethernet is not. The decryption has to be made by an additional app (https://svrooij.io/smartmeter2mqtt/) on an additional device and is partly supported by HA (had to modify the configuration.yaml to override the sensor with the consumption). It works, but it's a pain in the arse and a lot of hassle (debugging, trying and hacks).

So to my fellow Luxemburgers using HA, if you want to have a direct and painless integration, I'll definitely recommend the Slimmelezer+ with ESPHome.

@bf8392
Copy link
Author

bf8392 commented Sep 17, 2022

I tried it with Slimmelezer+, and can read the Electrical consumption perfectly, but gass and water is not working...esphome/issues#3585

@Netskeh
Copy link
Contributor

Netskeh commented Sep 17, 2022

@bf8392 in Luxembourg you need to request via your providers to unlock those channels. Gas via Creos/Sudenergy (whoever is your network provider), and water you need to call up your municipality.

If you have further questions please create new issue ticket.

@Netskeh Netskeh closed this as completed Sep 17, 2022
@bf8392
Copy link
Author

bf8392 commented Sep 19, 2022

Great great thanks!!! I'm gonna try that today =)

@bf8392
Copy link
Author

bf8392 commented Sep 22, 2022

@Netskeh that worked!!! Great great thanks :-)

@bf8392
Copy link
Author

bf8392 commented Sep 22, 2022

I haven't managed to integrate Weather thow, because it's not connected to the P1... municipality uses this: https://www.smartenergy.honeywell.com/product/waveflow-trc600/

If someone has a solution to integrate this in HA, please post it here: https://community.home-assistant.io/t/luxembourg-water-meter-general-water-meter/464164

@bf8392
Copy link
Author

bf8392 commented Sep 22, 2022

@marcddd
Copy link

marcddd commented Sep 27, 2022

My watermeter is connected to the p1 port of the powermeter too, so I think I cannot install the honeywell Waveflow. in between this connection?
I contacted municipality and they told me they unlocked the channel so it should be visible, but nevertheless no result.

I think that esphome is missing the sensor (Watermeter not supported yet) used in SlimmeLezer+ Hardware to read out water consumtion.

As my watermeter is connected via m-bus on channel 2 and gas on channel 1 (gas is working) the problem should be the esphome platform.

@Netskeh
Copy link
Contributor

Netskeh commented Sep 27, 2022

could you provide a readout of the P1 port? It is pretty easy to tell if the water meter data is in there once you know what to look for.

@marcddd
Copy link

marcddd commented Sep 27, 2022

Hi. If you tell me how to do it, I could provide you with the data.

@Netskeh
Copy link
Contributor

Netskeh commented Sep 28, 2022

Hey, obviously there are also other tools available - but for instance using the tool provided by this repository or https://github.com/mweimerskirch/smarty_dsmr_proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants