-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Adding system scripts that are automatically executed when idle level is changed #531
Conversation
… the idle level is changed. * idle_off.cmd * idle_short.cmd * idle_long.cmd In example this scripts can use to easy control the backlight or change page * idle_off.cmd ``` backlight {"state": true, "brightness": 255} moodlight {"state": false} ``` * idle_short.cmd ``` backlight {"state": "on", "brightness": 50} ``` * idle_long.cmd ``` backlight {"state": false, "brightness": 5} moodlight {"state": true, "color":"green"} ```
Thanks. Please also update CHANGELOG.md and the docs repo. |
I like the idea with individual scripts for different idle status levels 👍 |
The scripts are for every user, even those who don't use HA and they work even if Wifi is disturbed. If you use HA and the scripts, you have to make sure that they do not contradict each other. |
How? |
I don't use HA, I don't know but you can certainly customize the HA configuration to your liking. https://openhasp.haswitchplate.com/0.6/integrations/home-assistant/sampl_autom/ In the link above you can see the "action" section in the HA script. Change it. |
The custom component responds with a backlight state and brightness setting whenever openHASP issues an idle_xx mesage. It's actually an ongoing issue which is not resolved yet. Using the HA custom component it's impossible to configure whether or not you want it to respond or not on some/all idle messages. The idle_brightness and brightness values are dynamic, but the responses are hardcoded. It's all or nothing... I had to hack the component doing my openHASP proximity sensor custom code. |
I don't see a problem unless you configure contradicting brightness settings locally and in HA... |
Brightness values can be altered in HA (manually or by automation). IMO backlight idle state/brightness should ideally be configurable and fully controlled locally on the device. |
This PR implements that, and more since you can use other commends too besides brightness. |
The idle scripts are not only to control the backlight. In example you can use it go to a default page or control the moodlight. |
Yep, full local control. But on the other hand you'll then loose the possibility to dynamically control the brightness values / BL states for all three idle states. The main issue here is that it's impossible to use the CC and at the same time control the brightness with the new scripts.
That's why I wrote as I did earlier. From a Home Assistant user perspective it simply would be much easier if the BL state & brightness level for the three idle states were controlled completely by openHASP core in the device. The timing config is already there. We just need the brightness/states variables internally, the ability to change these via commands and a few lines of code to change the state/levels accordingly. If I had the skills I would definitely have made a PR for this 😉 |
I'm aware of that 😉 The BL control & brightness just came to my mind as the current solution in the CC for HA users is somewhat flawed |
scripts not fires when idle state changing.
But run
|
Adding additional system scripts that are automatically executed when the idle level is changed.
In example this scripts can use to easy control the backlight or change page