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

[Feature Request] Integration with Home Assistant #51

Open
jorgeassuncao opened this issue Oct 3, 2023 · 2 comments
Open

[Feature Request] Integration with Home Assistant #51

jorgeassuncao opened this issue Oct 3, 2023 · 2 comments

Comments

@jorgeassuncao
Copy link

Is it possible to integrate the Clock with Home Assistant? Being based on ESPhome i believe it would be realy simple to do.

At the moment when trying to integrate it with HA this is the result

image

@jnthas
Copy link
Owner

jnthas commented Oct 8, 2023

Hi Jorge. This is an interesting feature that I didn't work yet. I agree that it won't be difficult to add it. For now, I think you can use the endpoints available on Clockwise to do a basic integration with Home Assistant
https://clockwise.page/docs/api

@karl0ss
Copy link

karl0ss commented Jan 2, 2024

@jorgeassuncao

I created 2 rest_command in my HA yaml

rest_command:
  clockwise_set_display_brightness:
    url: "http://<CLOCKIP>/set?displayBright={{ brightness }}"
    method: POST
  clockwise_restart:
    url: "http://<CLOCKIP>/restart"
    method: POST
    content_type: "application/x-www-form-urlencoded"

You can then execute the services using

service: rest_command.clockwise_set_display_brightness
data:
  brightness: 25
service: rest_command.clockwise_restart

I have then created automations tied into "day and night routines" that will execute the first rest command, setting the brightness to X, sleeping for 2 seconds, then executing the restart service.

Something like this


description: "Turn off clock at 11pm"
mode: single
trigger:
  - platform: time
    at: "23:00:00"
condition: []
action:
  - service: rest_command.clockwise_set_display_brightness
    data:
      brightness: 1
  - delay:
      hours: 0
      minutes: 0
      seconds: 2
      milliseconds: 0
  - service: rest_command.clockwise_restart
    data: {}

Seems to give a nice way of turning the display on/off via an automation in HA

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants