Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation request: How to call services for the light and media #33

Closed
Intecpsp opened this issue Jan 22, 2023 · 7 comments
Closed
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers

Comments

@Intecpsp
Copy link

Could you update the documentation with examples of how to control the Hatch from Home Assistant? There are many media services that could be used, and each has its own parameters. Then with the light, I see lots of options as well. What services and values are able to be used?

@dahlb dahlb added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jan 23, 2023
@Intecpsp
Copy link
Author

Intecpsp commented Feb 22, 2023

I had a thought today to pull the different values from the device when it was in different favorite states (Rest+ v1). After looking them over I think I have the correct services and values to manipulate. How does the below look?

  • Media player: Select sound mode

    • Possible options here are: Stream, PinkNoise, Dryer, Ocean, Wind, Rain, Bird, Crickets, Brahms, Twinkle, RockABye
  • Media player: Set volume

  • Media player: Play

  • Media player: Stop

  • Light: Turn on

    • Possible values to modify:
      • brightness
      • hs_color
      • rgb_color
      • xy_color
  • Light: Turn off

Here are the values I've pulled so far for the basic colors (that we use) from the app:

  • Orange
    • hs_color: 25.767, 69.658
    • rgb_color: 234, 141, 71
    • xy_color: 0.547, 0.379
  • Dark blue
    • hs_color: 212.368, 67.556
    • rgb_color: 73, 143, 225
    • xy_color: 0.173, 0.197
  • Light blue
    • hs_color: 187.586, 80.93
    • rgb_color: 41, 193, 215
    • xy_color: 0.158, 0.301
  • Green
    • hs_color: 153.051, 56.19
    • rgb_color: 92, 210, 157
    • xy_color: 0.208, 0.441
  • Pink
    • hs_color: 330.811, 60.163
    • rgb_color: 246, 98, 170
    • xy_color: 0.476, 0.248

I hope to add these services and possibly even the light values to the README for others to reference if/when they need to.

@dvhub
Copy link

dvhub commented Feb 11, 2024

I had a thought today to pull the different values from the device when it was in different favorite states (Rest+ v1). After looking them over I think I have the correct services and values to manipulate. How does the below look?

  • Media player: Select sound mode

    • Possible options here are: Stream, PinkNoise, Dryer, Ocean, Wind, Rain, Bird, Crickets, Brahms, Twinkle, RockABye
  • Media player: Set volume

  • Media player: Play

  • Media player: Stop

  • Light: Turn on

    • Possible values to modify:

      • brightness
      • hs_color
      • rgb_color
      • xy_color
  • Light: Turn off

Here are the values I've pulled so far for the basic colors (that we use) from the app:

  • Orange

    • hs_color: 25.767, 69.658
    • rgb_color: 234, 141, 71
    • xy_color: 0.547, 0.379
  • Dark blue

    • hs_color: 212.368, 67.556
    • rgb_color: 73, 143, 225
    • xy_color: 0.173, 0.197
  • Light blue

    • hs_color: 187.586, 80.93
    • rgb_color: 41, 193, 215
    • xy_color: 0.158, 0.301
  • Green

    • hs_color: 153.051, 56.19
    • rgb_color: 92, 210, 157
    • xy_color: 0.208, 0.441
  • Pink

    • hs_color: 330.811, 60.163
    • rgb_color: 246, 98, 170
    • xy_color: 0.476, 0.248

I hope to add these services and possibly even the light values to the README for others to reference if/when they need to.

How do I turn on the 'rainbow' light color that's supported by the Rest+? Do I need to use some sort of animation?

@dahlb
Copy link
Owner

dahlb commented Feb 12, 2024

@dvhub you can use an automation to cycle, the built in random function is currently not supported; though it is already available in the rest+ first gen python api interface so should be a simple enough thing to add, hard part would be finding a reasonable way to expose it through ha

I'm closing this as the Intecpsp answered their own question already

@dahlb dahlb closed this as completed Feb 12, 2024
@dvhub
Copy link

dvhub commented Feb 15, 2024

@dvhub you can use an automation to cycle, the built in random function is currently not supported; though it is already available in the rest+ first gen python api interface so should be a simple enough thing to add, hard part would be finding a reasonable way to expose it through ha

I'm closing this as the Intecpsp answered their own question already

I don't mind hacking my local ha_hatch python code to get it working for me, but I see in the hatch_rest_api that rest_plus.set_color assumes that c.R (random) is False. How do you suggest setting c.R to True?

I did some research and it looks like the 'correct' way to do this is with LightEntity effect_list and effect but I believe this would be a fairly substantial change. Would it be reasonable to expose 'random' light color as a service call as a way to expose it in HA?

@dahlb
Copy link
Owner

dahlb commented Feb 16, 2024

I've exposed things with service calls in past integrations and found most people can't handle them well.

Better to expose a simple SwitchEntity.

I exposed an optional param to set the random effect on set_color in hatch_rest_api 1.22.0

@dvhub
Copy link

dvhub commented Feb 16, 2024

I've exposed things with service calls in past integrations and found most people can't handle them well.

Better to expose a simple SwitchEntity.

I exposed an optional param to set the random effect on set_color in hatch_rest_api 1.22.0

That's great. Thank you very much!

@YayC
Copy link
Contributor

YayC commented Mar 5, 2024

Mind reopening this issue until usage is documented on the Readme @dahlb? I could create a quick PR based on @Intecpsp's comment if that helps but probably won't have time to independently test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants