Day / night / backlight

Post Reply
sedlons
Posts: 10
Joined: Thu Aug 14, 2025 5:14 pm

Day / night / backlight

Post by sedlons »

It is possible to change day / night mode of android auto (like in openauto)?
I have now simple script, which load environmental light intensity and based on this changes backlight.

I would like to change day/night mode with python like:

Code: Select all

Trigger action 'aa_switch_mode_night' when ambient light < 20% 
Trigger action 'aa_switch_mode_day' when ambient light > 80% 
But i didnt find related actions in "List of predefined actions". Is there a predefined action or way to do it?
hudiy
Site Admin
Posts: 440
Joined: Mon Jul 14, 2025 7:42 pm

Re: Day / night / backlight

Post by hudiy »

Hello,
You can switch between light and dark mode using the API. This changes the mode for the native UI, Android Auto, and CarPlay (CarPlay might decide to do its own thing and ignore the request).

The mode change is triggered with this API message:
https://github.com/wiboma/hudiy/blob/ma ... proto#L689

Here's a quick example of how to use it:
https://github.com/wiboma/hudiy/blob/ma ... arkMode.py

You can also define your own action via the API to toggle light/dark mode. For example, in a Python script you can register your action and link it to a shortcut in shortcuts.json (https://github.com/wiboma/hudiy/blob/ma ... #shortcuts). When you click that shortcut (with appropriate action that you registered), Hudiy sends a message to the API client that registered the action - that's when you can send the SetDarkMode message.

Example of custom actions:
https://github.com/wiboma/hudiy/blob/ma ... hAction.py

As for sensors, Hudiy doesn't currently support any (gestures, light sensors, etc.). We're working on examples with different sensors and will share them on GitHub soon.
Post Reply