Skip to content

Latest commit

 

History

History

homeassistant_addon

README.md

Home Assistant Add-on: Lunar Sensor

Ambient light sensor that can send data to the 🌕 Lunar macOS app for controlling monitor brightness automatically.

Installation

Follow these steps to get the add-on installed on your system:

Open your Home Assistant instance and show the Supervisor add-on store.

adding the lunarsensor repo to HomeAssistant addons

How to use

This add-on requires configuration for knowing where to fetch the lux data from:

  1. Click on the "Configuration" tab.
  2. Type in the entity ID of the lux sensor into the sensor_entity_id field.
  3. Click the "SAVE" button.

Configuration

Add-on configuration:

sensor_entity_id: "sensor.lux"

Option: sensor_entity_id (required)

Set it to the entity_id of the lux sensor you want to use for adapting monitor brightness.

Option: color_entity_id (optional)

The entity_id of a color temperature sensor (in Kelvin). When set, Lunar can adapt the white point of external monitors to the room's light (True Tone).

Lunar app configuration

The addon announces itself over mDNS as _lunarsensor._tcp, so recent Lunar versions discover it automatically the moment it starts (no configuration needed). For this to work the addon runs with host networking.

Older Lunar versions connect to the addon at homeassistant.local:8899 (since v6.2.4).

If the HomeAssistant instance is available on a different hostname, configure Lunar by running the following commands on your Mac:

defaults write fyi.lunar.Lunar sensorHostname your-homeassistant-hostname
defaults write fyi.lunar.Lunar sensorPort 8899

Troubleshooting

  • Check if one-shot lux reading works
❯ curl homeassistant.local:8899/sensor/ambient_light

{"id":"sensor-ambient_light", "state":"0 lx", "value":0.000000}
  • Check if the EventSource is sending lux values every 2 seconds
❯ curl -N homeassistant.local:8899/events

event: state
data: {"id": "sensor-ambient_light", "state": "400.0 lx", "value": 400.0}

event: state
data: {"id": "sensor-ambient_light", "state": "400.0 lx", "value": 400.0}

event: state
data: {"id": "sensor-ambient_light", "state": "400.0 lx", "value": 400.0}

Support

Got questions?

You have several options to get them answered: