Stokerforum

Interface => Interface til varme systemer => Emne startet af: greatdane efter Apr 10, 2020, 20:29

Titel: API til adurocloud / Aduro Hybrid
Indlæg af: greatdane efter Apr 10, 2020, 20:29
Hej !
Jeg er ny ejer af en Aduro Hybridovn - og er samtidig ihærdig bruger/udvikler på smarthome-løsninger.
Er der nogen der ved om det er muligt at udlæse data fra - samt evt. styre - aduro-hybrid-ovnen vha. http/mqtt eller lign. ?
Jeg er med på at jeg kan logge mig på adurocloud.dk og se min ovns data - men har brug for et simpelt API til at kode mod...
Gode ideer imødeses gerne ;-)

Martin
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: motoz efter Apr 12, 2020, 09:30
The aduro hybrid apparently uses mostly the same protocol as scotte V7/13, so you can use https://github.com/motoz/nbetest to read and write from/to it. (See https://github.com/motoz/nbetest/issues/4 )

Pellmon with the NBEcom plugin should then also work, and with that running you can use pellmonMQTT to connect pellmon to an mqtt broker and there you have it...

https://github.com/motoz/PellMon
https://github.com/motoz/pellmonMQTT

the 'nbetest' client is crossplatform, pellmon and pellmonmqtt only linux (but you can run in in a virtual machine).

Or you can use NBEtest as 'documentation' to code up your own protocol client in your preferred language. Some info here also: https://github.com/motoz/PellMon/issues/98#issuecomment-460740348

Hope this helps!
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: greatdane efter Maj 18, 2020, 13:21
Fantastic - it works !! - I just managed to start and then stop my Aduro H2 using the nbetest script etc.
I will now start exploring how to embed this in my smarthome setup (OpenHab) - probably through PellMon which I have yet to try out
Thanks a million !
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: greatdane efter Maj 18, 2020, 14:42
Hmm - I ran into a problem getting Pellmon to work - installation on my raspberry pi went fine - and configs are all set. However, NBECom does not connect to my Aduro H2.
I dont seem to be able to find any config where I can set the IP address of my Aduro for Pellmon to look for it ? - it says it will "autodiscover" but that does not seem to work.
When trying out NBETEST as you suggested, I simply used the -a parameter and inserted the local IP (in my case 192.168.10.124) of my Aduro. That worked fine...
Any suggestions ?
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: motoz efter Maj 18, 2020, 18:51
Hello greatdane. Great that it works, so far...

PellMon only supports autodiscovery. You probably already set your serial number and password in /etc/pellmon/conf.d/plugins/nbecom.conf? https://github.com/motoz/PellMon/blob/master/src/conf.d/plugins/nbecom.conf
And did you install the newest alpha3 release or 0.7.0? https://github.com/motoz/PellMon/releases There was some problems with V13, I think I made some small fix for that a year or so ago. V13 back then at least tripped out if you tried to connect with a port > 9999. Since aduro is new it probably is more similar to V13 than V7, so I think you need the latest alpha. There might be other issues also, you are the first that I know of to try out PellMon with aduro... Pellmon might very well misbehave if the aduro doesn't have all the data that a 'normal' V13 has, but I'm sure we can sort that out if you can help out a bit, since nbetest is already working.
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: motoz efter Maj 18, 2020, 19:09
If you are into that you can change this line:
https://github.com/motoz/PellMon/blob/3e2511ada9e2cd5715c5c9ad67f45a41ef8d82f3/src/Pellmonsrv/plugins/nbecom/__init__.py#L89
to
Kode: [Vælg]
self.proxy = Proxy(self.password, 8483, 'your.ip.number', serial = self.serial). It still uses the discovery protocol, but it sends the frame directly to that ip instead of broadcasting it. Pellmon is 'fairly easy' to run in debug mode to test and see where things go wrong: https://github.com/motoz/PellMon/wiki/Contributing-to-PellMon
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: greatdane efter Jun 06, 2020, 10:00
Hi motoz

Been offline for a few weeks. Have reset my installation to a new ubuntu server 20.04.
However, when installing the pellmon package with gdebi I get;

This package is uninstallable
Dependency is not satisfiable: python-argcomplete

When trying to install argcomplete there seem to be a complication as python-argcomplete won't install as python3-argcomplete is already installed. Somehow however, the gdebi package does not recognize this

Have you heard about this before - and do you have suggestions for how to bypass/resolve ?
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: motoz efter Jun 07, 2020, 15:49
PellMon is python 2 only, and I think in ubuntu 20.04 there is only python3 installed by default, so you have to install python2. I think that they also made the 'python' command start python3, which of course breaks all existing scripts that were made for python2. There seem to be a way to configure it however, see e.g.  https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: motoz efter Jun 08, 2020, 09:21
I realize my answer is a bit vague... I don't know if the current pellmon package can be made to work or not on ubuntu 20.04. Installing from source probably works after manually installing python 2 and configuring it to be the default python. Pellmon needs to be ported to python 3 at some point, but I'm struggling to find motivation for that at the moment.
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: greatdane efter Jun 11, 2020, 16:01
OK - installed a fresh Ubuntu and got it installed and it is running with the latest alpha - but is still not finding my Aduro.
Is there nowhere in the installation where I can make the update to search for my specific IP - instead of building a whole new install ?
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: darboo efter Jun 12, 2020, 00:03
Hello,
Thanks for the information i also want to control my Aduro directly.
I'm trying to convert it in php (i want only the udp command) and i only block on the encryption, the others things works.
Do you have more information about the RSA encryption done ?
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: motoz efter Jun 12, 2020, 06:36
Greatdane: This is python, you can just edit the installed python file in /usr/lib/python2.7/dist-packages/Pellmonsrv/plugins/nbecom/
(But running in 'debug mode' without daemonizing enables you to add print statements here and there to see what's happening and what's not happening).

Darboo: I'm afraid what I have left is only what's in the code:
Here it reads the public key from the controller:
https://github.com/motoz/nbetest/blob/a572ecf0050e341f6c41256a52812e641e08b1c8/protocol.py#L71
And here it uses it to encrypt the payload in the 'set' command:
https://github.com/motoz/nbetest/blob/a572ecf0050e341f6c41256a52812e641e08b1c8/frames.py#L84
But you can ask for more info from Jens (boinkuser).

You can also set a key for the simpler xtea chiper (using RSA), and then encrypt using xtea after that. This was never fully implemented in the nbetest program, only in PellMon. It's a way to speed up changing settings, as the RSA chipher in very slow in the controller.
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: darboo efter Jun 14, 2020, 00:00
Nice it works, the RSA encryption must be done with no padding.
I have also implemented the xtea encryption and indeed it's faster.

Now i can have the status of my Aduro, start & stop it and change the settings. Thanks a lot it will be easier to use it next winter !!
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: motoz efter Jun 14, 2020, 18:49
Great!
Does the discovery protocol work or do you have to give the IP of the controller? No padding means you are encrypting only the payload and not padding it to 64 bytes? The V7/13 controllers used textbook RSA which is not secure without padding, maybe the aduro used a better chipher? OAEP?  Or maybe I'm mixing things up, I haven't looked at this in a long time. Are you going to post the code somewhere? Would be great to have a look...
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: darboo efter Jun 15, 2020, 11:49
Yes the discovery protocol works with the Aduro hybrid.

For the RSA encryption, default library (openssl_public_encrypt in php) add automatically the padding for secure reason, so for the 512 bit key size the max size of the encrypted string is 52 Bytes. The size of the Aduro payload can be more than 52 bytes and in your software the padding is done directly by the software. So to work the encryption must be set without padding but there is a padding done by the software.



Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: greatdane efter Sep 12, 2020, 10:03
@darboo - could you explain what you did to make this work ? - potentially show config/install files ?
Dansk er også OK ;-)
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: greatdane efter Nov 09, 2020, 09:21
So, I gave up getting pellmon working with my Aduro Hybrid H2 oven - and went for implementing monitoring and controls in OpenHab with the NBEtest tool as an API.
You can read more here: https://community.openhab.org/t/aduro-h2-h1-pellet-oven-implementation-with-openhab-using-nbetest-tool/107949

Perhaps this can solve something for someone.

If anyone has ideas to get a more "realtime" interface up to the Aduro H1/H2 - I am all ears; the implementation I have provided with OpenHab is obviously not ideal, but it works for now (for me).
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: darboo efter Nov 24, 2020, 08:51
Hello,

I have develop the plugin for the eedomus box in php and I communicate directly with the Aduro. There is some mistake I must correct but it can help you to understand the protocol with the Aduro.
The php script is here : https://github.com/darboo44/eedomus-Aduro
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: Bert Haverkamp efter Dec 26, 2020, 10:37
Hello all,

Merry Christmas everybody from the Netherlands!
This Christmas break I started playing with my home automation.
My Aduro H1 is one of the things I would like to access directly, instead of via a fuzzy cloud.
(The other is my Solaredge inverters, but I think I have a way to do that now)
So I am very happy to see that you found a way to connect directly to the H1/H2.
Myself, I am using Domoticz for my home automation, so I have to find a way to translate this into a plugin for that platform.

Thanks all,
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: RomkeNL efter Feb 11, 2021, 07:53
Good to read that more people like to control the Aduro!  O0

@Bert Haverkamp
Are you a little further? (Im also from the Netherlands)
I also have the solar edge inverters, which you can read well with Home Assistant.

@darboo
I downloaded your code from github and am trying to convert it to a loose script. (I don't have an eedomus box)

I only get stuck at the value of a variable, do you have a tip for me?
see: https://github.com/darboo44/eedomus-Aduro/issues/1

Thanks!
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: Bert Haverkamp efter Maj 12, 2021, 14:06
Hi Romke,

Yes, the Solaredge reporting is solved by enabling Modbus over TCP. I can now read them directly in Domoticz and make nice graphs in Dashticz

On the H1 side, I was just browsing through the links I had saved last december to see if anything had happened since then.

Good to hear you started on a stand-alone script! And I will make some time the coming weeks to look into it and your variable issue!.
I'm not a programmer myself, so bare with me!

Where in the Netherlands are you situated? I'm living in Stein, Limburg


Bert
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: Bert Haverkamp efter Dec 18, 2022, 18:27
Hello Motoz, Darboo,

I am reviving this old thread, I hope you are still around.
I am trying to implement a Domoticz plugin to control  my Aduro H1 stove based on pyduro, a library to control the stove.
But I am missing the info on how to change the Heat level ( there are three heat levels in the Aduro app.)
I also would like to figure out how to set the stove to "wanted room temperature" (as it is called in the Aduro app)
By dumping the settings before and after changing the mode via the app, I wasn't able to figure this out.
Wireshark traces show that the requests that are sent to the stove are encrypted via XTEA.
I looked in the code of Darboo to see how the encryption works, but sofar I am not able to reuse this to decrypt the requests
(what is the key, and what is the IV used for encryption? in my aduro stove it only shows xtea_key = "0").

Any info and help is appreciated!

Bert
Titel: Sv: API til adurocloud / Aduro Hybrid
Indlæg af: motoz efter Dec 29, 2022, 16:44
Assuming the Aduro works somewhat like a V7 NBE pellet burner, it goes like this: read frames are plain text, writes must be encrypted. The xtea encryption is optional, you set the xtea_key yourself with an rsa encrypted frame using the controllers public key (which is very slow in the v7 controller), then you can write data using the much faster xtea crypto. I never implemented that part in the 'nbetest' script, but pellmon uses it. See e.g. here https://github.com/motoz/PellMon/blob/3e2511ada9e2cd5715c5c9ad67f45a41ef8d82f3/src/Pellmonsrv/plugins/nbecom/nbeprotocol/frames.py#L79 . The public key is read from the controller (misc.rsa_key). IV is set here (I think, hardly remember anything of this any more) https://github.com/motoz/PellMon/blob/3e2511ada9e2cd5715c5c9ad67f45a41ef8d82f3/src/Pellmonsrv/plugins/nbecom/nbeprotocol/protocol.py#L113 .  You can do all writes using rsa encryption to avoid having to set up an xtea key, only downside is that it is slow.