A method for controlling the appointment of functions of smart home appliances, wherein comprising at least one mobile terminal providing a user control interface, and at least one smart home appliance capable of communicating with the mobile terminal, a control module of the smart home appliance is a microcontroller with a function activation counter and a function duration counter, the method comprises the following steps:
- setting the mobile terminal and the controlled smart home appliance in the same wireless communication network, or via a common remote server, so that the mobile terminal and the controlled smart home appliance can realize communication interaction;
- defining the communication protocol between the mobile terminal and the controlled smart home appliance, a data structure of a single function appointment sent by the mobile terminal is:
- a controlled smart home appliance ID+a countdown value of the function activation counter+a countdown value of the function duration counter+a corresponding function ID+a function control parameter+a flag bit for cyclic control+a N work flag bits used to indicate whether the function is activated or not+a shift control bit;
- the shift control bit controls the value of the first bit of the N work flag bits used to indicate whether the function is activated or not to move to the last bit, and the values of other bits are all shifted to the left by one;
- completing an appointment setting on the user control interface provided by the mobile terminal, the user control interface comprising the following input items and/or options:
- a list of certified controlled smart home appliances, a list of functions corresponding to the controlled smart home appliances, a parameter input and/or selection list corresponding to each function, a time point of the activation of the function, a duration of the function, a periodic list of optional function, a periodic list provides N options of appointment, an interval between the two options is T1;
- only when the appointment setting is completed on the user control interface, the mobile terminal sending an appointment control instruction to the controlled smart home appliance, the mobile terminal does not send the appointment control instruction until the next time the appointment setting is updated;
- after the user completes the appointment setting, calculating with the mobile terminal the countdown value of the function activation counter according to the interval from the current time at the time of setting to the time point of the activation of the function, and calculates the countdown value of the function duration counter according to the duration of the function, and at the same time, according to the current time, the time point of the activation of the function, the duration of the function, and the options of appointment in the periodic list, N work flags are formed to indicate whether the function is activated or not, the flag bit is 0 for not working, 1 for working, and sending a control command comprising at least one function appointment to the controlled smart home appliance;
- after the controlled smart home appliance receives the appointment control instruction, only when the controlled smart home appliance ID matches, an MCU of the controlled smart home appliance obtains the countdown value of the function activation counter, the countdown value of the function duration counter, corresponding function ID, function control parameters, flag bit for cyclic control, N work flag bits and shift control bits used to indicate whether the function is activated or not from the appointment control instruction, the function activation counter and function duration counter of the microcontroller count down respectively, in conjunction with N work flags used to indicate whether the function is activated or not of the cyclic shift, so as to periodically control the cyclic activation and deactivation of the specific function of the controlled smart home appliance at the time point when the function is activated.