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] Turn on/off display via a timer #203

Open
Leeefy opened this issue Dec 18, 2024 · 20 comments
Open

[Feature] Turn on/off display via a timer #203

Leeefy opened this issue Dec 18, 2024 · 20 comments
Labels
SW Enhancement New feature or request for software.

Comments

@Leeefy
Copy link

Leeefy commented Dec 18, 2024

basically have an option to turn on/off the display at certain times (eg. 10am mon-fri turn on, 6pm mon-fri turn off).
also maybe have it so people can change brightness at user-defined times

@BlueAndi BlueAndi added the SW Enhancement New feature or request for software. label Dec 18, 2024
@BlueAndi
Copy link
Owner

Interesting idea to turn it on/off by a timer. Because the development boards with 4 MB flash are full, next year we have to think about how to get some space back to be able to implement more general features.

@BlueAndi
Copy link
Owner

BlueAndi commented Dec 27, 2024

Example:
image

BlueAndi added a commit that referenced this issue Dec 29, 2024
…brightness. Note, brightness change will only work, if the automatic brightness adjustment is disabled.

#203
@BlueAndi
Copy link
Owner

The development branch contains now the TimerService, which can be enabled in the config's. For the 8/16 MB flash modules its enabled by default. Note, that the development branch requires already to update the filesystem too.

Please verify.

@Leeefy
Copy link
Author

Leeefy commented Dec 30, 2024

I have a 4MB flash and I do not see an option for that anywhere, is it not implemented for the 4MB flash modules?

@BlueAndi
Copy link
Owner

I have a 4MB flash and I do not see an option for that anywhere, is it not implemented for the 4MB flash modules?

You can add it, by removing the ";" in front of the used configXXXX.ini file.

See here the part out of the config/configSmall.ini

    ...
    # ********** Services (keep the order) **********
    SettingsService @ ~0.1.0 # Mandatory, can not be removed.
    ;MqttService @ ~0.1.0
    TopicHandlerService @ ~0.1.0 # Mandatory, can not be removed.
    FileMgrService @ ~0.1.0 # Mandatory, can not be removed.
    ;AudioService @ ~0.1.0
    ;TimerService @ ~0.1.0 <---------------- Remove ";" in front here.
    ...

Remove one ore more plugins to get some space back.

@Leeefy
Copy link
Author

Leeefy commented Dec 30, 2024

Nevermind, I found it. It doesn't seem to work reliably on my end, and the settings for the service doesnt save between reboot. I also want to suggest to have an option to turn on and off the display from somewhere on the website (perhaps under display tab?) (doesnt make sense to have an option to turn on/off the display via a timer without having an option to turn on/off the screen directly)

@BlueAndi
Copy link
Owner

Nevermind, I found it. It doesn't seem to work reliably on my end, and the settings for the service doesnt save between reboot.

Hmm ... will check it again later.

I also want to suggest to have an option to turn on and off the display from somewhere on the website (perhaps under display tab?) (doesnt make sense to have an option to turn on/off the display via a timer without having an option to turn on/off the screen directly)

The display can be switched on and off via physical buttons, I thought thats enough. :-)
https://github.com/BlueAndi/Pixelix/tree/Development?tab=readme-ov-file#user-interface

But yes, a button can be added.

@BlueAndi
Copy link
Owner

BTW can you load the config/timerService.json file to the file editor in the development web page once after you edit it. And then after reboot. Are they equal or are your configurations lost?

@Leeefy
Copy link
Author

Leeefy commented Dec 30, 2024

The display can be switched on and off via physical buttons, I thought thats enough. :-)

Thing is, I have no physical button on my clock lmao (I just have 2 bare wires inside the clock just incase)

BTW can you load the config/timerService.json file to the file editor in the development web page once after you edit it. And then after reboot. Are they equal or are your configurations lost?

before reboot:

...
  "timerSettings": [
    {
      "enabled": true,
      "hour": 1,
      "minute": 20,
...

after reboot:

...
  "timerSettings": [
    {
      "enabled": false,
      "hour": 0,
      "minute": 0,
...

They arent the same.

@Leeefy
Copy link
Author

Leeefy commented Dec 30, 2024

ALSO while i mention physical button control, (1 button control) holding down the button increases the brightness then decreases it. It doesn't increase a second time, therefore not making it into a loop

BlueAndi added a commit that referenced this issue Dec 30, 2024
… provided memory. The same for saving the timer settings.

Additional introduced a processing period of 100ms instead of processing per call.
#203
@BlueAndi
Copy link
Owner

Problem regarding cleared timer settings after reboot should be solved. Please pull from Development branch again.

@BlueAndi
Copy link
Owner

ALSO while i mention physical button control, (1 button control) holding down the button increases the brightness then decreases it. It doesn't increase a second time, therefore not making it into a loop

Can you please open a bug issue for that, so its tracked separately?

@Leeefy
Copy link
Author

Leeefy commented Dec 30, 2024

Problem regarding cleared timer settings after reboot should be solved. Please pull from Development branch again.

Seems to save upon a restart now.

Can you please open a bug issue for that, so its tracked separately?

Ive opened a new issue for that just now

@BlueAndi
Copy link
Owner

Regarding the button in the webpage, I am thinking about providing the possibility not only via REST API, but via MQTT too. It will take some time, because I would like to have a general architectural approach to provide it. The lower interface is clear by using the TopicHandler, which will automatically provide it on REST and MQTT, but in the higher application level its not that clear right now.

@BlueAndi
Copy link
Owner

The display can now be powered on/off via REST API and MQTT. A button to the display page was added.

@BlueAndi
Copy link
Owner

Update of the REST API on swagger is not ready yet.

@BlueAndi
Copy link
Owner

BlueAndi commented Jan 1, 2025

@BlueAndi
Copy link
Owner

BlueAndi commented Jan 6, 2025

@Leeefy Did you verify successful?

@Leeefy
Copy link
Author

Leeefy commented Jan 6, 2025

Apologies, I wont be able to test it until this Friday

@Leeefy
Copy link
Author

Leeefy commented Jan 11, 2025

Ive tested everything again (besides api)
Timerservice still doesnt work
The button on the webpage is there but it doesnt work (gets disabled (grays out) but does nothing regarding the clock)
Upon entering the display section, the "Power Off", "Enable auto. display update", "Previous slot", "Next slot", "Next fade effect", "Install" and "Enable" buttons and the " Min. brightness soft limit:" and " Max. brightness soft limit:" are disabled (grayed out) until you interact with something on that webpage (like "Current Brightness:" slider, enabling a plugin slot, etc), then those buttons and sliders becomes enabled
In Development>Debug>Restart, the Restart button doesnt work (gets disabled but doesnt restart)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SW Enhancement New feature or request for software.
Projects
None yet
Development

No branches or pull requests

2 participants