TheMicDiet / chihiros-led-control

Control your Chihiros LEDs with Home Assistant or CLI
MIT License
25 stars 7 forks source link

Feature: Home Assistant Integration #2

Closed TheMicDiet closed 5 months ago

TheMicDiet commented 1 year ago

https://developers.home-assistant.io/docs/creating_component_index

titilambert commented 6 months ago

Hello ! Thanks for your work ! I have 2 chihiros eggs and your tool is working ! (even if it has only 2 ilghts (red and green) I can probably help on the home assistant integration. I have few questions for you

Thanks again !

TheMicDiet commented 6 months ago

Hi, I think we can add it in this repo as a third party integration with hacs

kingunlim commented 6 months ago

i cant wait for the addon in home assistant

titilambert commented 6 months ago

Hello ! I have an alpha first version of a custom integration which is working with my 2 tiny terrarium eggs ! image image

@TheMicDiet I'm not sure if we can add the code of the integration in the same repo of the library. I will do some researches. Once I know what to do, I will let you know. Then I could push my code there to let people testing it. Finally, I will do a PR to add Chihiros icon/logo to the home assistant brands repo.

For now, I have some doubts how the code will act with other Chihiros lights…

Also, do you know if the Chihiros lights are only RGB (and RB for tiny terrarium eggs) ? Or there are some models RGBW/RGBWW ?

Thanks !

TheMicDiet commented 6 months ago

Hi @titilambert, afaik, there are lights that are RGB, RGBW as well as single color (white) only.

titilambert commented 6 months ago

@TheMicDiet @kingunlim I need your opinion: I have 2 tiny terrarium eggs which are exposing ONLY red and green. So this is only RG of the RGB. Should I create an RGB light entity in HA or two BRIGHTNESS lights (one for red, the other for green) ? And I have the same question for any other Chihiros lights. I mean, for this kind of light, we do not care about the colour of the light, but we want to control each colour individually (one red, one green, one blue, maybe one or two white)? Thanks for your answers.

TheMicDiet commented 6 months ago

Hi @titilambert, I have no RGB light so it doesn't really matter to me. However, if you ask me, it would make sense to have separate controls for each color, as long as it doesn't get too complicated. Feel free to implement it the way you prefer.

kingunlim commented 6 months ago

@TheMicDiet @kingunlim I need your opinion:

I have 2 tiny terrarium eggs which are exposing ONLY red and green. So this is only RG of the RGB.

Should I create an RGB light entity in HA or two BRIGHTNESS lights (one for red, the other for green) ?

And I have the same question for any other Chihiros lights. I mean, for this kind of light, we do not care about the colour of the light, but we want to control each colour individually (one red, one green, one blue, maybe one or two white)?

Thanks for your answers.

so i have a chihiros wrgb2 so individual controlls would be very nice. but im not entirely sure what can be possible? in the app there are scenes and so on, but when i can activate the light and the last set light in the app is loaded that would be great enough, i thing a gradual shift is hard to make? so i mean when home assistant turn on the light maybe the light slowly turns to a specific percentage. (but as i write i think a automation can do this also?) thank you guys for your work!

titilambert commented 6 months ago

Ok ! So I will do one monochrome light entity per colour. It will not be more difficult !

kingunlim commented 6 months ago

@titilambert awesome, im curious, can i already add the addon in home assistant via hacks?

titilambert commented 6 months ago

Not yet, we have to make the repo hacs compatible. I never did that since I'm NOT using hacs... But you can still get the custom_components folder from my fork and put it in the config folder of your home assistant

kingunlim commented 6 months ago

alright i asume you mean you dont use hacs? so then i will wait for an option to install it via homeassistant via an install option. can you please write again if there is a option to install? best regards and thx again

titilambert commented 6 months ago

Sorry, I confirm I do not use hacs. To help you I need to know more about your HA installation. Can you give me more details ? Or if you can wait few more days I should be able to make it hacs compatible.

kingunlim commented 6 months ago

of corse no problem i can wait till you are ready 👍

titilambert commented 6 months ago

Hello ! my fork/branch is ready for a first HACS test: https://github.com/titilambert/chihiros-led-control/tree/ha_integration I do not know how you can put a git repo URL and branch in HACS, but here is the info I can give:

Let me know if you have any questions/issues/comments !

Note: this will change when it will be merged to this repo

kingunlim commented 6 months ago

i dont know but i think something is wrong image

kingunlim commented 6 months ago

maybe this is the problem? https://github.com/hacs/integration/issues/2754

kingunlim commented 6 months ago

image

titilambert commented 6 months ago

@kingunlim did you had a chance to select the ha_integratoin branch ? If not, this error is completely normal. Let me know, and I will do something to get my main branch working

kingunlim commented 6 months ago

im sry i dont know how i coild do that? normaly i go in hacs and select user repository and the i insert the url an choose the category like this: image

titilambert commented 6 months ago

@kingunlim can you retry ? I just merged on my main branch. Just try with:

kingunlim commented 6 months ago

yes, now its working ;) image

so, now i must learn to make the right actions to turn the lights on and off, when im in the app i can akticate the light and then i goes for example 70 white 70 red and 70 blue, now in your integration i must activate all channels manually? or do you plan to update the integration for better communication with for example the wrgb2? best regards!

titilambert commented 6 months ago

Hello! First thanks for testing it ! I'm happy it is now working for you. In fact, the app keeps some “profiles” about each color, like a shortcut. I don't think I can do that in the integration since it will be different for each user. So I would recommend creating a group of light, see https://www.home-assistant.io/integrations/group/#binary-sensor-light-and-switch-groups. With that, I guess you will have the behavior you want to turn on/off the light quickly. Let me know if it works