ESPHome  2025.2.0
nextion_commands.cpp
Go to the documentation of this file.
1 #include "nextion.h"
2 #include "esphome/core/util.h"
3 #include "esphome/core/log.h"
4 #include <cinttypes>
5 
6 namespace esphome {
7 namespace nextion {
8 static const char *const TAG = "nextion";
9 
10 // Sleep safe commands
11 void Nextion::soft_reset() { this->send_command_("rest"); }
12 
13 void Nextion::set_wake_up_page(uint8_t wake_up_page) {
14  this->wake_up_page_ = wake_up_page;
15  this->add_no_result_to_queue_with_set_internal_("wake_up_page", "wup", wake_up_page, true);
16 }
17 
18 void Nextion::set_touch_sleep_timeout(uint32_t touch_sleep_timeout) {
19  if (touch_sleep_timeout < 3) {
20  ESP_LOGD(TAG, "Sleep timeout out of bounds, range 3-65535");
21  return;
22  }
23 
24  this->touch_sleep_timeout_ = touch_sleep_timeout;
25  this->add_no_result_to_queue_with_set_internal_("touch_sleep_timeout", "thsp", touch_sleep_timeout, true);
26 }
27 
28 void Nextion::sleep(bool sleep) {
29  if (sleep) { // Set sleep
30  this->is_sleeping_ = true;
31  this->add_no_result_to_queue_with_set_internal_("sleep", "sleep", 1, true);
32  } else { // Turn off sleep. Wait for a sleep_wake return before setting sleep off
33  this->add_no_result_to_queue_with_set_internal_("sleep_wake", "sleep", 0, true);
34  }
35 }
36 // End sleep safe commands
37 
38 // Protocol reparse mode
40  ESP_LOGV(TAG, "Set Nextion protocol reparse mode: %s", YESNO(active_mode));
41  this->ignore_is_setup_ = true; // if not in reparse mode setup will fail, so it should be ignored
42  bool all_commands_sent = true;
43  if (active_mode) { // Sets active protocol reparse mode
44  all_commands_sent &= this->send_command_("recmod=1");
45  } else { // Sets passive protocol reparse mode
46  all_commands_sent &=
47  this->send_command_("DRAKJHSUYDGBNCJHGJKSHBDN"); // To exit active reparse mode this sequence must be sent
48  all_commands_sent &= this->send_command_("recmod=0"); // Sending recmode=0 twice is recommended
49  all_commands_sent &= this->send_command_("recmod=0");
50  }
51  if (!this->nextion_reports_is_setup_) { // No need to connect if is already setup
52  all_commands_sent &= this->send_command_("connect");
53  }
54  this->ignore_is_setup_ = false;
55  return all_commands_sent;
56 }
57 
58 // Set Colors - Background
59 void Nextion::set_component_background_color(const char *component, uint16_t color) {
60  this->add_no_result_to_queue_with_printf_("set_component_background_color", "%s.bco=%" PRIu16, component, color);
61 }
62 
63 void Nextion::set_component_background_color(const char *component, const char *color) {
64  this->add_no_result_to_queue_with_printf_("set_component_background_color", "%s.bco=%s", component, color);
65 }
66 
67 void Nextion::set_component_background_color(const char *component, Color color) {
68  this->add_no_result_to_queue_with_printf_("set_component_background_color", "%s.bco=%d", component,
70 }
71 
72 // Set Colors - Background (pressed)
73 void Nextion::set_component_pressed_background_color(const char *component, uint16_t color) {
74  this->add_no_result_to_queue_with_printf_("set_component_pressed_background_color", "%s.bco2=%" PRIu16, component,
75  color);
76 }
77 
78 void Nextion::set_component_pressed_background_color(const char *component, const char *color) {
79  this->add_no_result_to_queue_with_printf_("set_component_pressed_background_color", "%s.bco2=%s", component, color);
80 }
81 
82 void Nextion::set_component_pressed_background_color(const char *component, Color color) {
83  this->add_no_result_to_queue_with_printf_("set_component_pressed_background_color", "%s.bco2=%d", component,
85 }
86 
87 // Set Colors - Foreground
88 void Nextion::set_component_foreground_color(const char *component, uint16_t color) {
89  this->add_no_result_to_queue_with_printf_("set_component_foreground_color", "%s.pco=%" PRIu16, component, color);
90 }
91 
92 void Nextion::set_component_foreground_color(const char *component, const char *color) {
93  this->add_no_result_to_queue_with_printf_("set_component_foreground_color", "%s.pco=%s", component, color);
94 }
95 
96 void Nextion::set_component_foreground_color(const char *component, Color color) {
97  this->add_no_result_to_queue_with_printf_("set_component_foreground_color", "%s.pco=%d", component,
99 }
100 
101 // Set Colors - Foreground (pressed)
102 void Nextion::set_component_pressed_foreground_color(const char *component, uint16_t color) {
103  this->add_no_result_to_queue_with_printf_("set_component_pressed_foreground_color", "%s.pco2=%" PRIu16, component,
104  color);
105 }
106 
107 void Nextion::set_component_pressed_foreground_color(const char *component, const char *color) {
108  this->add_no_result_to_queue_with_printf_("set_component_pressed_foreground_color", " %s.pco2=%s", component, color);
109 }
110 
111 void Nextion::set_component_pressed_foreground_color(const char *component, Color color) {
112  this->add_no_result_to_queue_with_printf_("set_component_pressed_foreground_color", "%s.pco2=%d", component,
114 }
115 
116 // Set Colors - Font
117 void Nextion::set_component_font_color(const char *component, uint16_t color) {
118  this->add_no_result_to_queue_with_printf_("set_component_font_color", "%s.pco=%" PRIu16, component, color);
119 }
120 
121 void Nextion::set_component_font_color(const char *component, const char *color) {
122  this->add_no_result_to_queue_with_printf_("set_component_font_color", "%s.pco=%s", component, color);
123 }
124 
125 void Nextion::set_component_font_color(const char *component, Color color) {
126  this->add_no_result_to_queue_with_printf_("set_component_font_color", "%s.pco=%d", component,
128 }
129 
130 // Set Colors - Font (pressed)
131 void Nextion::set_component_pressed_font_color(const char *component, uint16_t color) {
132  this->add_no_result_to_queue_with_printf_("set_component_pressed_font_color", "%s.pco2=%" PRIu16, component, color);
133 }
134 
135 void Nextion::set_component_pressed_font_color(const char *component, const char *color) {
136  this->add_no_result_to_queue_with_printf_("set_component_pressed_font_color", " %s.pco2=%s", component, color);
137 }
138 
139 void Nextion::set_component_pressed_font_color(const char *component, Color color) {
140  this->add_no_result_to_queue_with_printf_("set_component_pressed_font_color", "%s.pco2=%d", component,
142 }
143 
144 // Set picture
145 void Nextion::set_component_pic(const char *component, uint8_t pic_id) {
146  this->add_no_result_to_queue_with_printf_("set_component_pic", "%s.pic=%" PRIu8, component, pic_id);
147 }
148 
149 void Nextion::set_component_picc(const char *component, uint8_t pic_id) {
150  this->add_no_result_to_queue_with_printf_("set_component_picc", "%s.picc=%" PRIu8, component, pic_id);
151 }
152 
153 // Set video
154 void Nextion::set_component_vid(const char *component, uint8_t vid_id) {
155  this->add_no_result_to_queue_with_printf_("set_component_vid", "%s.vid=%" PRIu8, component, vid_id);
156 }
157 
158 void Nextion::set_component_drag(const char *component, bool drag) {
159  this->add_no_result_to_queue_with_printf_("set_component_drag", "%s.drag=%i", component, drag ? 1 : 0);
160 }
161 
162 void Nextion::set_component_aph(const char *component, uint8_t aph) {
163  this->add_no_result_to_queue_with_printf_("set_component_aph", "%s.aph=%" PRIu8, component, aph);
164 }
165 
166 void Nextion::set_component_position(const char *component, uint32_t x, uint32_t y) {
167  this->add_no_result_to_queue_with_printf_("set_component_position_x", "%s.x=%" PRIu32, component, x);
168  this->add_no_result_to_queue_with_printf_("set_component_position_y", "%s.y=%" PRIu32, component, y);
169 }
170 
171 void Nextion::set_component_text_printf(const char *component, const char *format, ...) {
172  va_list arg;
173  va_start(arg, format);
174  char buffer[256];
175  int ret = vsnprintf(buffer, sizeof(buffer), format, arg);
176  va_end(arg);
177  if (ret > 0)
178  this->set_component_text(component, buffer);
179 }
180 
181 // General Nextion
182 void Nextion::goto_page(const char *page) { this->add_no_result_to_queue_with_printf_("goto_page", "page %s", page); }
183 void Nextion::goto_page(uint8_t page) { this->add_no_result_to_queue_with_printf_("goto_page", "page %i", page); }
184 
185 void Nextion::set_backlight_brightness(float brightness) {
186  if (brightness < 0 || brightness > 1.0) {
187  ESP_LOGD(TAG, "Brightness out of bounds, percentage range 0-1.0");
188  return;
189  }
190  this->add_no_result_to_queue_with_printf_("backlight_brightness", "dim=%d", static_cast<int>(brightness * 100));
191 }
192 
193 void Nextion::set_auto_wake_on_touch(bool auto_wake_on_touch) {
194  this->auto_wake_on_touch_ = auto_wake_on_touch;
195  this->add_no_result_to_queue_with_set("auto_wake_on_touch", "thup", auto_wake_on_touch ? 1 : 0);
196 }
197 
198 // General Component
199 void Nextion::set_component_font(const char *component, uint8_t font_id) {
200  this->add_no_result_to_queue_with_printf_("set_component_font", "%s.font=%" PRIu8, component, font_id);
201 }
202 
203 void Nextion::hide_component(const char *component) {
204  this->add_no_result_to_queue_with_printf_("hide_component", "vis %s,0", component);
205 }
206 
207 void Nextion::show_component(const char *component) {
208  this->add_no_result_to_queue_with_printf_("show_component", "vis %s,1", component);
209 }
210 
211 void Nextion::enable_component_touch(const char *component) {
212  this->add_no_result_to_queue_with_printf_("enable_component_touch", "tsw %s,1", component);
213 }
214 
215 void Nextion::disable_component_touch(const char *component) {
216  this->add_no_result_to_queue_with_printf_("disable_component_touch", "tsw %s,0", component);
217 }
218 
219 void Nextion::set_component_picture(const char *component, uint8_t picture_id) {
220  this->add_no_result_to_queue_with_printf_("set_component_picture", "%s.pic=%" PRIu8, component, picture_id);
221 }
222 
223 void Nextion::set_component_text(const char *component, const char *text) {
224  this->add_no_result_to_queue_with_printf_("set_component_text", "%s.txt=\"%s\"", component, text);
225 }
226 
227 void Nextion::set_component_value(const char *component, int32_t value) {
228  this->add_no_result_to_queue_with_printf_("set_component_value", "%s.val=%" PRId32, component, value);
229 }
230 
231 void Nextion::add_waveform_data(uint8_t component_id, uint8_t channel_number, uint8_t value) {
232  this->add_no_result_to_queue_with_printf_("add_waveform_data", "add %" PRIu8 ",%" PRIu8 ",%" PRIu8, component_id,
233  channel_number, value);
234 }
235 
236 void Nextion::open_waveform_channel(uint8_t component_id, uint8_t channel_number, uint8_t value) {
237  this->add_no_result_to_queue_with_printf_("open_waveform_channel", "addt %" PRIu8 ",%" PRIu8 ",%" PRIu8, component_id,
238  channel_number, value);
239 }
240 
241 void Nextion::set_component_coordinates(const char *component, uint16_t x, uint16_t y) {
242  this->add_no_result_to_queue_with_printf_("set_component_coordinates command 1", "%s.xcen=%" PRIu16, component, x);
243  this->add_no_result_to_queue_with_printf_("set_component_coordinates command 2", "%s.ycen=%" PRIu16, component, y);
244 }
245 
246 // Drawing
247 void Nextion::display_picture(uint16_t picture_id, uint16_t x_start, uint16_t y_start) {
248  this->add_no_result_to_queue_with_printf_("display_picture", "pic %" PRIu16 ", %" PRIu16 ", %" PRIu16, x_start,
249  y_start, picture_id);
250 }
251 
252 void Nextion::fill_area(uint16_t x1, uint16_t y1, uint16_t width, uint16_t height, uint16_t color) {
254  "fill_area", "fill %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, x1, y1, width, height, color);
255 }
256 
257 void Nextion::fill_area(uint16_t x1, uint16_t y1, uint16_t width, uint16_t height, const char *color) {
258  this->add_no_result_to_queue_with_printf_("fill_area", "fill %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%s", x1,
259  y1, width, height, color);
260 }
261 
262 void Nextion::fill_area(uint16_t x1, uint16_t y1, uint16_t width, uint16_t height, Color color) {
263  this->add_no_result_to_queue_with_printf_("fill_area",
264  "fill %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, x1, y1,
265  width, height, display::ColorUtil::color_to_565(color));
266 }
267 
268 void Nextion::line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color) {
269  this->add_no_result_to_queue_with_printf_("line", "line %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, x1,
270  y1, x2, y2, color);
271 }
272 
273 void Nextion::line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, const char *color) {
274  this->add_no_result_to_queue_with_printf_("line", "line %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%s", x1, y1,
275  x2, y2, color);
276 }
277 
278 void Nextion::line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, Color color) {
279  this->add_no_result_to_queue_with_printf_("line", "line %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, x1,
280  y1, x2, y2, display::ColorUtil::color_to_565(color));
281 }
282 
283 void Nextion::rectangle(uint16_t x1, uint16_t y1, uint16_t width, uint16_t height, uint16_t color) {
284  this->add_no_result_to_queue_with_printf_("draw", "draw %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, x1,
285  y1, static_cast<uint16_t>(x1 + width), static_cast<uint16_t>(y1 + height),
286  color);
287 }
288 
289 void Nextion::rectangle(uint16_t x1, uint16_t y1, uint16_t width, uint16_t height, const char *color) {
290  this->add_no_result_to_queue_with_printf_("draw", "draw %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%s", x1, y1,
291  static_cast<uint16_t>(x1 + width), static_cast<uint16_t>(y1 + height),
292  color);
293 }
294 
295 void Nextion::rectangle(uint16_t x1, uint16_t y1, uint16_t width, uint16_t height, Color color) {
296  this->add_no_result_to_queue_with_printf_("draw", "draw %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, x1,
297  y1, static_cast<uint16_t>(x1 + width), static_cast<uint16_t>(y1 + height),
299 }
300 
301 void Nextion::circle(uint16_t center_x, uint16_t center_y, uint16_t radius, uint16_t color) {
302  this->add_no_result_to_queue_with_printf_("cir", "cir %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, center_x,
303  center_y, radius, color);
304 }
305 
306 void Nextion::circle(uint16_t center_x, uint16_t center_y, uint16_t radius, const char *color) {
307  this->add_no_result_to_queue_with_printf_("cir", "cir %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%s", center_x, center_y,
308  radius, color);
309 }
310 
311 void Nextion::circle(uint16_t center_x, uint16_t center_y, uint16_t radius, Color color) {
312  this->add_no_result_to_queue_with_printf_("cir", "cir %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, center_x,
313  center_y, radius, display::ColorUtil::color_to_565(color));
314 }
315 
316 void Nextion::filled_circle(uint16_t center_x, uint16_t center_y, uint16_t radius, uint16_t color) {
317  this->add_no_result_to_queue_with_printf_("cirs", "cirs %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, center_x,
318  center_y, radius, color);
319 }
320 
321 void Nextion::filled_circle(uint16_t center_x, uint16_t center_y, uint16_t radius, const char *color) {
322  this->add_no_result_to_queue_with_printf_("cirs", "cirs %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%s", center_x, center_y,
323  radius, color);
324 }
325 
326 void Nextion::filled_circle(uint16_t center_x, uint16_t center_y, uint16_t radius, Color color) {
327  this->add_no_result_to_queue_with_printf_("cirs", "cirs %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16, center_x,
328  center_y, radius, display::ColorUtil::color_to_565(color));
329 }
330 
331 void Nextion::qrcode(uint16_t x1, uint16_t y1, const char *content, uint16_t size, uint16_t background_color,
332  uint16_t foreground_color, uint8_t logo_pic, uint8_t border_width) {
334  "qrcode", "qrcode %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu8 ",%" PRIu8 ",\"%s\"", x1,
335  y1, size, background_color, foreground_color, logo_pic, border_width, content);
336 }
337 
338 void Nextion::qrcode(uint16_t x1, uint16_t y1, const char *content, uint16_t size, Color background_color,
339  Color foreground_color, uint8_t logo_pic, uint8_t border_width) {
341  "qrcode", "qrcode %" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu16 ",%" PRIu8 ",%" PRIu8 ",\"%s\"", x1,
342  y1, size, display::ColorUtil::color_to_565(background_color), display::ColorUtil::color_to_565(foreground_color),
343  logo_pic, border_width, content);
344 }
345 
347  this->add_no_result_to_queue_with_printf_("rtc0", "rtc0=%u", time.year);
348  this->add_no_result_to_queue_with_printf_("rtc1", "rtc1=%u", time.month);
349  this->add_no_result_to_queue_with_printf_("rtc2", "rtc2=%u", time.day_of_month);
350  this->add_no_result_to_queue_with_printf_("rtc3", "rtc3=%u", time.hour);
351  this->add_no_result_to_queue_with_printf_("rtc4", "rtc4=%u", time.minute);
352  this->add_no_result_to_queue_with_printf_("rtc5", "rtc5=%u", time.second);
353 }
354 
355 } // namespace nextion
356 } // namespace esphome
void goto_page(const char *page)
Show the page with a given name.
void set_nextion_rtc_time(ESPTime time)
Send the current time to the nextion display.
bool ignore_is_setup_
Sends commands ignoring of the Nextion has been setup.
Definition: nextion.h:1241
void set_component_pic(const char *component, uint8_t pic_id)
Set the picture id of a component.
void set_component_picture(const char *component, uint8_t picture_id)
Set the picture of an image component.
void add_waveform_data(uint8_t component_id, uint8_t channel_number, uint8_t value)
Add waveform data to a waveform component.
static uint16_t color_to_565(Color color, ColorOrder color_order=ColorOrder::COLOR_ORDER_RGB)
void hide_component(const char *component) override
Hide a component.
void circle(uint16_t center_x, uint16_t center_y, uint16_t radius, uint16_t color)
Draw a circle outline.
uint16_t x
Definition: tt21100.cpp:17
void set_component_position(const char *component, uint32_t x, uint32_t y)
Set the position of a component.
A more user-friendly version of struct tm from time.h.
Definition: time.h:15
bool send_command_(const std::string &command)
Manually send a raw command to the display and don&#39;t wait for an acknowledgement packet.
Definition: nextion.cpp:29
void set_component_vid(const char *component, uint8_t vid_id)
Set the video id of a component.
void set_component_picc(const char *component, uint8_t pic_id)
Set the background picture id of component.
void sleep(bool sleep)
Sets Nextion mode between sleep and awake.
void disable_component_touch(const char *component)
Disable touch for a component.
void set_auto_wake_on_touch(bool auto_wake_on_touch)
Sets if Nextion should auto-wake from sleep when touch press occurs.
void rectangle(uint16_t x1, uint16_t y1, uint16_t width, uint16_t height, uint16_t color)
Draw a rectangle outline.
bool active_mode
void show_component(const char *component) override
Show a component.
uint16_t y
Definition: tt21100.cpp:18
bool add_no_result_to_queue_with_printf_(const std::string &variable_name, const char *format,...) __attribute__((format(printf
Sends a formatted command to the nextion.
Definition: nextion.cpp:1023
void set_component_pressed_background_color(const char *component, uint16_t color)
Set the pressed background color of a component.
void set_component_pressed_foreground_color(const char *component, uint16_t color)
Set the pressed foreground color of a component.
void set_wake_up_page(uint8_t wake_up_page=255)
Sets which page Nextion loads when exiting sleep mode.
void set_component_background_color(const char *component, uint16_t color)
Set the background color of a component.
void set_component_text_printf(const char *component, const char *format,...) __attribute__((format(printf
Set the text of a component to a formatted string.
uint8_t second
seconds after the minute [0-60]
Definition: time.h:19
bool set_protocol_reparse_mode(bool active_mode)
Sets the Nextion display&#39;s protocol reparse mode.
void line(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
Draw a line on the screen.
void set_touch_sleep_timeout(uint32_t touch_sleep_timeout)
Set the touch sleep timeout of the display.
void set_component_text(const char *component, const char *text)
Set the text of a component to a static string.
uint8_t minute
minutes after the hour [0-59]
Definition: time.h:21
void set_component_font_color(const char *component, uint16_t color)
Set the font color of a component.
void set_component_font(const char *component, uint8_t font_id) override
Set the font id for a component.
void enable_component_touch(const char *component)
Enable touch for a component.
void fill_area(uint16_t x1, uint16_t y1, uint16_t width, uint16_t height, uint16_t color)
Fill a rectangle with a color.
void set_backlight_brightness(float brightness)
Set the brightness of the backlight.
bool void add_no_result_to_queue_with_set_internal_(const std::string &variable_name, const std::string &variable_name_to_send, int32_t state_value, bool is_sleep_safe=false)
Definition: nextion.cpp:1060
void soft_reset()
Softreset the Nextion.
uint16_t year
year
Definition: time.h:33
void display_picture(uint16_t picture_id, uint16_t x_start, uint16_t y_start)
Display a picture at coordinates.
void filled_circle(uint16_t center_x, uint16_t center_y, uint16_t radius, uint16_t color)
Draw a filled circled.
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
void void set_component_value(const char *component, int32_t value)
Set the integer value of a component.
uint8_t month
month; january=1 [1-12]
Definition: time.h:31
void qrcode(uint16_t x1, uint16_t y1, const char *content, uint16_t size=200, uint16_t background_color=65535, uint16_t foreground_color=0, uint8_t logo_pic=-1, uint8_t border_width=8)
Draws a QR code in the screen.
uint8_t hour
hours since midnight [0-23]
Definition: time.h:23
void set_component_foreground_color(const char *component, uint16_t color)
Set the foreground color of a component.
void set_component_coordinates(const char *component, uint16_t x, uint16_t y)
Set the coordinates of a component on screen.
void set_component_aph(const char *component, uint8_t aph)
Set the opaqueness (fading) of a component.
void set_component_pressed_font_color(const char *component, uint16_t color)
Set the pressed font color of a component.
void set_component_drag(const char *component, bool drag)
Set the drag availability of a component.
uint32_t touch_sleep_timeout_
Definition: nextion.h:1249
uint8_t day_of_month
day of the month [1-31]
Definition: time.h:27
void add_no_result_to_queue_with_set(NextionComponentBase *component, int32_t state_value) override
Definition: nextion.cpp:1050
void open_waveform_channel(uint8_t component_id, uint8_t channel_number, uint8_t value)