https://github.com/mrebbinghaus/ha-macos-sync-display-brightness
Syncs the display brightness of a display with Home Assistant.
https://github.com/mrebbinghaus/ha-macos-sync-display-brightness
babashka home-assistant
Last synced: 23 days ago
JSON representation
Syncs the display brightness of a display with Home Assistant.
- Host: GitHub
- URL: https://github.com/mrebbinghaus/ha-macos-sync-display-brightness
- Owner: MrEbbinghaus
- Created: 2025-05-12T11:21:29.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-08-21T12:29:30.000Z (about 2 months ago)
- Last Synced: 2025-08-21T14:35:29.167Z (about 2 months ago)
- Topics: babashka, home-assistant
- Language: Clojure
- Homepage:
- Size: 171 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# macOS display brightness to HA
Listens to [lunar](https://lunar.fyi) for changes in display brightness and publishes the value to a [Home Assistant](https://www.home-assistant.io/) `input_number` entity using [HAs REST API](https://developers.home-assistant.io/docs/api/rest/).
![]()
## Todo
- [ ] Implement bidirectional sync
- [ ] Don't depend on lunar.## Configuration
Two environment variables:
- `HASS_SERVER` - URL of the HA instance
- `HASS_TOKEN` - API token for HA (see https://developers.home-assistant.io/docs/api/rest/)One constant in the code:
- `ha-monitor-brightness-entity` is the entity id of the target `input_number`. E.g.: `input_number.primary_monitor_brightness`## Installation as a [LaunchAgent](https://support.apple.com/guide/terminal/script-management-with-launchd-apdc6c1077b-5d5d-4d35-9c19-60f2397b2369/mac)
```console
$ # Copy (or symlink) the plist file to ~/Library/LaunchAgents
$ ln -s /me.ebbinghaus.display-brightness-to-ha.plist ~/Library/LaunchAgents/me.ebbinghaus.display-brightness-to-ha.plist
$ # Load it with `launchctl load`
$ launchctl load ~/Library/LaunchAgents/me.ebbinghaus.display-brightness-to-ha.plist
```