pyduofern icon indicating copy to clipboard operation
pyduofern copied to clipboard

Add Home Assistant custom component to HACS

Open DomiStyle opened this issue 5 years ago • 13 comments

It would be nice to have the custom component available in HACS so updating is easier.

The requirements are listed here: https://hacs.xyz/docs/publish/start

While it's possible to get a sub directory added as repository it probably would make more sense to copy the current HA component to a new repository?

DomiStyle avatar Oct 05 '20 12:10 DomiStyle

This sounds like a good idea. Also at first glance the requirements seem achievable with reasonable effort. I'll try to look into this over the weekend. Do you already have experience with providing components via HACS?

gluap avatar Oct 06 '20 20:10 gluap

@gluap I don't but I would be willing to help if there's a repository to work with.

DomiStyle avatar Oct 08 '20 21:10 DomiStyle

@DomiStyle status update: I started working on it in a separate repository (I agree this makes more sense) and think the best will be to move the custom component there completely once it works (while leaving a readme in this repo for people to find that installed the old way and maybe another readme in the new repo for those who don't want to switch to hacs).

Currently it's just a stub but you can find it here https://github.com/gluap/pyduofern-hacs .

So far I only did the first few steps in the tutorial and haven't really set up anything yet so I wouldn't expect it to work. But after promising to work on it over the weekend I thought I should post an update.

gluap avatar Oct 12 '20 19:10 gluap

I added the repository to my Home Assistant instance and it looks like this in HACS:

hacs_ui hacs_ui2

I didn't try to install it yet since i need to disable the original custom component first but looks good so far.

This is the repository for HACS itself so it can probably be used as reference for the readme and info file: https://github.com/hacs/integration

DomiStyle avatar Oct 13 '20 09:10 DomiStyle

I ran a first test using it as a custom component and it works (installs latest version of pyduofern and the module "just works" with the existing config). I'll implement some more suggestions from their readme and at some point send a pull request to add it to hacs.

gluap avatar Oct 21 '20 20:10 gluap

Took me quite some time but with the release of Home Assistant 2020.12 I finally found some time to switch over to the HACS version.

So far no issues, everything works perfectly and should be a lot easier to maintain.

DomiStyle avatar Dec 14 '20 12:12 DomiStyle

Hello, thanks for your work!

I wanted to test it too:

  • A fresh installation of HACS on my test server was not possible under 2020.12.0.

  • With HASS.IO 0.118.5 and HACS 1.8.0 I don't find any integration "DUOFERN" .....

RaKa

rakaandro avatar Dec 14 '20 21:12 rakaandro

hi @rakaandro, it's not yet at the stage where it's available from ~~hass~~HACS from the default repos, to install it via HACS you need to add the hacs repo https://github.com/gluap/pyduofern-hacs as a source for integrations. You can add custom repositories by clicking three menu dots on the top right in HACS and selecting "Custom Repositories" image

gluap avatar Dec 14 '20 21:12 gluap

What´s the current status on this?

Sounds like the easiest way to use your great work in Home Assistant especially when using HASS OS.

bcutter avatar Jan 17 '21 16:01 bcutter

@bcutter Works perfectly from HACS, just follow the steps a post above and it will be installed automatically.

DomiStyle avatar Jan 18 '21 09:01 DomiStyle

Alright, installation done. But the pairing process for new devices is somehow intransparent. I

  • set pairing mode on the device to "On"
  • in HA I ran service "duofern.start_pairing" with "timeout: 120"
  • as nothing happened, after some time I ran service "duofern.sync_devices"
  • After some time the device (has display) switched from "00 devices in DuoFern network" to "01", at the same time duofern.json had a new device added (ID matches the one I wanted to pair)

BUT: what is the expected outcome in Home Assistant? Integration still shows: grafik

grafik

Shouldn´t there be a new device and an entity? Please assist. Adding the integration by the way worked smoothly.

Update: found the entity named with the paired device' ID.

Would be good to have them shown on the integration page, mockup see: grafik

bcutter avatar Feb 14 '21 14:02 bcutter

Hi @bcutter, what kind of device are you trying to pair?

When going through your entities, does searching for "duofern" list the entity you paired?

I see that other integrations do somehow manage to show their integrated devices and entities on that pane. My guess is that the whole pairing mechanism used by the duofern integration somehow works around what was meant for pairing from the homeassistant side. Back when I wrote it there just was no framework available for pairing-like actions (or maybe it was too hard to find). This is also why pyduofern is using the "call a service" as a workaround to trigger pairing.

I'll file this as a new bug, but as it is hacs-only It'll be in the issue tracker of pyduofern-hacs

gluap avatar Feb 14 '21 18:02 gluap

Everything is working meanwhile in terms of pairing. Besides very few situations where commands have not been executed by the RolloTron device and few log warnings and fewer errors everything is fine.

Thanks for filing the idea as separate issue.

bcutter avatar Feb 14 '21 21:02 bcutter