Stokerforum

Interface => Interface til varme systemer => Emne startet af: zune efter Apr 15, 2020, 02:03

Titel: integration med hass.io
Indlæg af: zune efter 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
Titel: Sv: integration med hass.io
Indlæg af: motoz efter Maj 13, 2020, 17:24
It can...
Titel: Sv: integration med hass.io
Indlæg af: John Doe efter Okt 22, 2020, 10:38
It can...

Motoz could you be helpful in telling us how to? And is it possible without pellmon?
Titel: Sv: integration med hass.io
Indlæg af: motoz efter 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.
Titel: Sv: integration med hass.io
Indlæg af: John Doe efter 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.
Titel: Sv: integration med hass.io
Indlæg af: martinnygaard efter 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!
Titel: Sv: integration med hass.io
Indlæg af: motoz efter 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?
Titel: Sv: integration med hass.io
Indlæg af: motoz efter 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.
Titel: Sv: integration med hass.io
Indlæg af: John Doe efter 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?
Titel: Sv: integration med hass.io
Indlæg af: motoz efter 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.
Titel: Sv: integration med hass.io
Indlæg af: John Doe efter 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
Titel: Sv: integration med hass.io
Indlæg af: Jre efter 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?
Titel: Sv: integration med hass.io
Indlæg af: Jre efter 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?

Titel: Sv: integration med hass.io
Indlæg af: John Doe efter 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!
Titel: Sv: integration med hass.io
Indlæg af: motoz efter 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... :-)

Titel: Sv: integration med hass.io
Indlæg af: Jre efter Dec 25, 2020, 16:47
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... :-)

Have you tried starting the Android app lately? 
It takes on average 30 seconds from starting the app, showing splash screen, waiting for it to connect and read all needed values.  This is perhaps what annoys me the most about the app.  And then you even have to wait every time you open a new screen.  The usage graph screen takes on average 35 seconds to load, and then it even keeps reloading data every so often when you are looking at and browsing the graphs.  :'(
If it would just start and then load the values in the background, perhaps blanking out the values until loaded.. but nooo, you have to wait, every freaking time...  >:(

Obviously if you don't use HA, but PellMon, then this doesn't really make much sense, but for me, that already have a HA setup, then setting up PelMon would not make much sense, as it basically implements most of the same features (from what I can see) - at least the ones I would be interested in.


Besides that I have actually really wanted the ability to compare my usage graphs with weather information.  Looking at historical usage makes for very poor comparison.  For example: This and last winter has been quite mild, compared to 2017. 
Some sort of normalization with outside temperature and/or wind would really make those values more useful when you try to see if any changes to the house has actually saved any amount of fuel burned.

I guess such would be quite easy to implement in PellMon, if not already done,  and also in HA, but the Android App... yeah, I generally try only to use it when I absolutely have to, when making any config changes.
Titel: Sv: integration med hass.io
Indlæg af: Juel efter Feb 08, 2023, 22:18
I know this is an old thread.
I have been a Pellmon user since the beginning, and I love it, I'm using the plugin for my own python script, to control the furnace/pumps/valves in our house and workshop.
Now I started to set up Home Assistant, to control the charger for the EV, control the solar inverter, and based on the nordPool prices I want to switch between the furnace and an electric boiler, to make the cheapest heat.
So a HA plugin would be great! My PR3 with pellmon died the other day, so now I'm in a split situation..  I'm thinking about moving everything to HA it would make good sense, but it would be nicer without a RP on the side to communicate with HA.
I at the moment use the serial comm between the RP and the furnace..
Have any of you progressed with HA and NBE furnaces?