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

Add support for setting RGBW parameters without turning on the light #280

Open
klew opened this issue Feb 17, 2022 · 2 comments
Open

Add support for setting RGBW parameters without turning on the light #280

klew opened this issue Feb 17, 2022 · 2 comments

Comments

@klew
Copy link
Member

klew commented Feb 17, 2022

It should be possible to set RGBW (and standard dimmer as well) parameters without turning on the light. I.e. after 10 pm I'd like to have light configured to 10% of brightness, and 100% after 6 am, so when somebody use local button to turn it on, it will use configured brighness.

https://forum.supla.org/viewtopic.php?t=10231
https://forum.supla.org/viewtopic.php?t=9425
https://forum.supla.org/viewtopic.php?p=128111#p128111

@klew
Copy link
Member Author

klew commented Feb 17, 2022

There is flag in proto for this functionality:
SUPLA_CHANNEL_FLAG_RGBW_SET_LEVEL_WITHOUT_SWITCHING_ON

@klew
Copy link
Member Author

klew commented Oct 13, 2023

Update:
Flag was renamed to SUPLA_CHANNEL_FLAG_RGBW_COMMANDS_SUPPORTED

List of commands:

// Values from other fields are applied in a standard way
#define RGBW_COMMAND_NOT_SET 0
// Ignores all other bytes and turns on the dimmer
#define RGBW_COMMAND_TURN_ON_DIMMER 1
// Ignores all other bytes and turns off the dimmer
#define RGBW_COMMAND_TURN_OFF_DIMMER 2
// Ignores all other bytes and toggles the dimmer
#define RGBW_COMMAND_TOGGLE_DIMMER 3
// Ignores all other bytes and turns on the RGB
#define RGBW_COMMAND_TURN_ON_RGB 4
// Ignores all other bytes and turns off the RGB
#define RGBW_COMMAND_TURN_OFF_RGB 5
// Ignores all other bytes and toggles the RGB
#define RGBW_COMMAND_TOGGLE_RGB 6
// Ignores all other bytes and turns on the RGB and Dimmer
#define RGBW_COMMAND_TURN_ON_ALL 7
// Ignores all other bytes and turns off the RGB and Dimmer
#define RGBW_COMMAND_TURN_OFF_ALL 8
// Ignores all other bytes and toggles the RGB and Dimmer (with sync, so both
// will be off or both will be on)
#define RGBW_COMMAND_TOGGLE_ALL 9
// Stores brightness value and ignores all other bytes, if dimmer is off, it
// stays off
#define RGBW_COMMAND_SET_BRIGHTNESS_WITHOUT_TURN_ON 10
// Stores colorBrightness value and ignores all other bytes.
// If RGB is off, it stays off
#define RGBW_COMMAND_SET_COLOR_BRIGHTNESS_WITHOUT_TURN_ON 11
// Stores color value (R, G, B) and ignores all other bytes.
// If RGB is off, it stays off
#define RGBW_COMMAND_SET_RGB_WITHOUT_TURN_ON 12
// Start brightness dimmer iteration
#define RGBW_COMMAND_START_ITERATE_DIMMER 13
// Start color brightness iteration
#define RGBW_COMMAND_START_ITERATE_RGB 14
// Start dimmer and rgb brightness iteration
#define RGBW_COMMAND_START_ITERATE_ALL 15
// Stop brightness dimmer iteration
#define RGBW_COMMAND_STOP_ITERATE_DIMMER 16
// Stop color brightness iteration
#define RGBW_COMMAND_STOP_ITERATE_RGB 17
// Stop dimmer and rgb brightness iteration
#define RGBW_COMMAND_STOP_ITERATE_ALL 18

Command is on value[6] byte. When not set, everything works as before commands. When set, only part of value array is parsed (description is in comments above).

On server part those commands should be used for MQTT integration. Setting of brightness, color should use those "without turn on" variants. See #383

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant