Forfatter Emne: integration med hass.io  (Læst 33155 gange)

0 Medlemmer og 3 Gæster læser dette emne.

Offline zune

  • Beta tester
  • Top of the pop
  • *
  • Indlæg: 152
  • Respekt optjent: +1/-0
  • Klejnsmed
integration med hass.io
« Dato: Apr 15, 2020, 02:03 »
Det kunne være super fedt hvis styringen kunne ekponere "sensore" og "switches" ud mod eks, en mqtt eller noget i den dur således at man kunne trække dem ind i hass.io eller endnu bedre lavede en rigtig integration med systemet :D
110 kvm 2 etager.

10kw v13 BS20
100L ældre Metro combi VVB.
6-8 ton forbrug
http://www.stokercloud.dk/dev/30221.html

Offline motoz

  • Top of the pop
  • *****
  • Indlæg: 255
  • Respekt optjent: +18/-0
Sv: integration med hass.io
« Svar #1 Dato: Maj 13, 2020, 17:24 »
It can...
Bio Comfort 30kW, compressor cleaning, lambda. Termax 25cr boiler. Matene vertical pellet conveyor. PellMon open source pellet logger: https://github.com/motoz/PellMon

Offline John Doe

  • Top of the pop
  • *****
  • Indlæg: 126
  • Respekt optjent: +11/-4
    • Mit fyr
Sv: integration med hass.io
« Svar #2 Dato: Okt 22, 2020, 10:38 »
It can...

Motoz could you be helpful in telling us how to? And is it possible without pellmon?

Offline motoz

  • Top of the pop
  • *****
  • Indlæg: 255
  • Respekt optjent: +18/-0
Sv: integration med hass.io
« Svar #3 Dato: Okt 22, 2020, 16:54 »
Sorry about that... No, the controller can't do it directly. It speaks two protocols (as far as I know of), the homegrown UDP based (server) and http (client, for stokercloud). The only ready made solution to bridge from the UDP protocol to MQTT that I know of is pellmon + pellmonmqtt, but there could be others. This combination gives you access to all measurement values and all settings. The openhab binding + openhab + somethingmqtt might work also, I don't know. There has been very little interest in pellmonmqtt so I never made an installer for it. It's just one python script though, so there isn't much to install. You have to make it start on boot however.
Bio Comfort 30kW, compressor cleaning, lambda. Termax 25cr boiler. Matene vertical pellet conveyor. PellMon open source pellet logger: https://github.com/motoz/PellMon

Offline John Doe

  • Top of the pop
  • *****
  • Indlæg: 126
  • Respekt optjent: +11/-4
    • Mit fyr
Sv: integration med hass.io
« Svar #4 Dato: Okt 23, 2020, 05:58 »
Sorry about that... No, the controller can't do it directly. It speaks two protocols (as far as I know of), the homegrown UDP based (server) and http (client, for stokercloud). The only ready made solution to bridge from the UDP protocol to MQTT that I know of is pellmon + pellmonmqtt, but there could be others. This combination gives you access to all measurement values and all settings. The openhab binding + openhab + somethingmqtt might work also, I don't know. There has been very little interest in pellmonmqtt so I never made an installer for it. It's just one python script though, so there isn't much to install. You have to make it start on boot however.

But Pellmon is to be installed on another RPi? I suppose that you can't run it alongside with Home Assistant.

Offline martinnygaard

  • Begynder
  • *
  • Indlæg: 3
  • Respekt optjent: +0/-0
Sv: integration med hass.io
« Svar #5 Dato: Okt 23, 2020, 06:45 »
I am very interesten in getting a HA integration for a NBE v13 board.

This guy made a integration for OpenHAB, but not sure how easy it will be converting it for HA.
http://www.stokerforum.dk/index.php?topic=9949.0

I really hope it's possible!

Offline motoz

  • Top of the pop
  • *****
  • Indlæg: 255
  • Respekt optjent: +18/-0
Sv: integration med hass.io
« Svar #6 Dato: Okt 23, 2020, 09:06 »
I don't see why you couldn't run PellMon and PellmonMQTT together with Home Assistant on the same rpi. Do you think of some specific reason?
« Senest Redigeret: Okt 23, 2020, 09:32 af motoz »
Bio Comfort 30kW, compressor cleaning, lambda. Termax 25cr boiler. Matene vertical pellet conveyor. PellMon open source pellet logger: https://github.com/motoz/PellMon

Offline motoz

  • Top of the pop
  • *****
  • Indlæg: 255
  • Respekt optjent: +18/-0
Sv: integration med hass.io
« Svar #7 Dato: Okt 23, 2020, 09:39 »
Here is another OpenHAB binding, open source this time https://github.com/Freezerz/openhab-addons/tree/pelletburnermonitor

But if you want to code up a Home Assistant integration then the NBECom pellmon plugin is probably a better starting point since both are coded in the same language.
Bio Comfort 30kW, compressor cleaning, lambda. Termax 25cr boiler. Matene vertical pellet conveyor. PellMon open source pellet logger: https://github.com/motoz/PellMon

Offline John Doe

  • Top of the pop
  • *****
  • Indlæg: 126
  • Respekt optjent: +11/-4
    • Mit fyr
Sv: integration med hass.io
« Svar #8 Dato: Okt 25, 2020, 07:37 »
I don't see why you couldn't run PellMon and PellmonMQTT together with Home Assistant on the same rpi. Do you think of some specific reason?

The Raspberry Pi is installed with the Home Assistant OS, and is not accessible in any other way than through HA. How would you install another program, without mentioning a broker?

Offline motoz

  • Top of the pop
  • *****
  • Indlæg: 255
  • Respekt optjent: +18/-0
Sv: integration med hass.io
« Svar #9 Dato: Okt 25, 2020, 12:18 »
Citér
The Raspberry Pi is installed with the Home Assistant OS,
I see. Of course if you start with an OS purpose build to run only one application then it's going to be hard/impossible to do anything else. Home assistant however is (just like pellmon) nothing more than a bunch of python scripts, so nothing prevents you from starting with a general purpose OS instead and install everything that you need on the same computer. Including the broker, of course. If you want to keep the HA OS, then an extra raspberry zero for the broker and pellmon isn't exactly expensive.
Bio Comfort 30kW, compressor cleaning, lambda. Termax 25cr boiler. Matene vertical pellet conveyor. PellMon open source pellet logger: https://github.com/motoz/PellMon

Offline John Doe

  • Top of the pop
  • *****
  • Indlæg: 126
  • Respekt optjent: +11/-4
    • Mit fyr
Sv: integration med hass.io
« Svar #10 Dato: Okt 26, 2020, 05:54 »
Citér
The Raspberry Pi is installed with the Home Assistant OS,
I see. Of course if you start with an OS purpose build to run only one application then it's going to be hard/impossible to do anything else. Home assistant however is (just like pellmon) nothing more than a bunch of python scripts, so nothing prevents you from starting with a general purpose OS instead and install everything that you need on the same computer. Including the broker, of course. If you want to keep the HA OS, then an extra raspberry zero for the broker and pellmon isn't exactly expensive.

Well, I guess not...  :D

Offline Jre

  • Begynder
  • *
  • Indlæg: 7
  • Respekt optjent: +0/-0
Sv: integration med hass.io
« Svar #11 Dato: Dec 14, 2020, 22:26 »
I don't see why you couldn't run PellMon and PellmonMQTT together with Home Assistant on the same rpi. Do you think of some specific reason?

The Raspberry Pi is installed with the Home Assistant OS, and is not accessible in any other way than through HA. How would you install another program, without mentioning a broker?

That is not entirely true.  It is true that the HassOS is build for running HA, but it is still a Linux distro that is just made inaccessible for the user (e.g., ssh to the host os is disabled), as stuff should be running in containers, which makes the OS installation independent and easy to upgrade without breaking any add-ons.

I haven't spent any time reading up on integrations, but a quick glance suggests that they are just python3 code.  So unless Pellmon uses anything else than python for fetching and/or setting values in the controller then it should be fairly straight forward to wrap it and expose directly.

Another alternative could be to just wrap the pellmon software in a container and expose it as an add-on, however that would not integrate the values directly to HA.  Then you would need the pellmon-mqtt, and then connect that to your HA's mqtt broker, i guess?

Offline Jre

  • Begynder
  • *
  • Indlæg: 7
  • Respekt optjent: +0/-0
Sv: integration med hass.io
« Svar #12 Dato: Dec 14, 2020, 22:50 »
In fact this link would suggest that it is actually a requirement to use a third party library for the actual device coms, when creating an integration in HA: https://developers.home-assistant.io/docs/creating_platform_index#interfacing-with-devices
It just needs to be available at PyPi, which doesn't seem to be the case right now (but could easily be done).

Ah any listed requirements is just passed along to pip so a git+https:// urls is possible, thus no PyPi is strictly needed: https://developers.home-assistant.io/docs/creating_integration_manifest#custom-requirements-during-development--testing

It even seems possible to implement either pulling or pushing of new values to HA: https://developers.home-assistant.io/docs/core/entity/#updating-the-entity
If the values very only published by mqtt, you could even auto discover them: https://developers.home-assistant.io/docs/creating_integration_manifest#mqtt
However I guess it would be cleaner to expose entities directly, and then use the HA mqtt broker/node-red to export any values if you really need them externally, as you most likely just want the values inside HA and no where else?


Offline John Doe

  • Top of the pop
  • *****
  • Indlæg: 126
  • Respekt optjent: +11/-4
    • Mit fyr
Sv: integration med hass.io
« Svar #13 Dato: Dec 16, 2020, 06:13 »
@Jre it would be very nice to have the values exposed to HA as entities, even if they're not editable. But I'm not a programmer. At all. I would'nt have the slightest idea on how to do it!

Offline motoz

  • Top of the pop
  • *****
  • Indlæg: 255
  • Respekt optjent: +18/-0
Sv: integration med hass.io
« Svar #14 Dato: Dec 16, 2020, 18:41 »
The PellMon plugin for V7/13 burners  is called NBEcom, it uses the NBEprotocol python module for communicating with the burner. It's a pure python module, but like the rest of PellMon it's python 2, not python3: https://github.com/motoz/PellMon/tree/master/src/Pellmonsrv/plugins/nbecom/nbeprotocol

It should be straightforward to port this python3 and make something for HA out of it. Doing it this way you will not get access to everything else that PellMon provides besides access to the basicburner settings, but nothing prevents running several clients with the burner controller at the same time so pellmon can very well exist side by side with an HA integration and the official android app. I will of course try to support any effort made to make an HA integration out of the NBEprotocol, but myself I don't really understand the point... Maybe someone could change my mind... :-)

Bio Comfort 30kW, compressor cleaning, lambda. Termax 25cr boiler. Matene vertical pellet conveyor. PellMon open source pellet logger: https://github.com/motoz/PellMon