There are two themes in the device: cmd is the command theme, state is the state theme.
When connected to an MQTT broker, the device sends a status line, for example:
{"device": {"up_time": 10000, "down_time": 10000, "stay_time": 10000, "always_on": false, "always_off": false. , "mov_det": false, "dev_state": false}}
The device accepts a command line like:
{"device": {"up_time": 10000, "down_time": 10000, "stay_time": 10000, "always_on": false, "always_off": false}}
or can accept each key individually, for example: {“device”: {“up_time”: value}}
The up_time and down_time keys can take values from 1000 to 10000.
The stay_time key ranges from 1000 to 60000.
These three keys require input fields or a knotted toggle switch.
The always_on and always_off keys can be true or false.
A slide switch is enough for them. Moreover, if the always_on key is selected, then the always_off key cannot be activated; vice versa.
The mov_det and dev_state keys are true or false and cannot be changed. They need two icons to show the state.
When the parameter value is changed, a string is sent to the device in the CMD subject, for example, of the form: {“device”: {“up_time”: new_value}}
In response to the change in the key value, the device sends a feedback string to the STATE topic of the form: {“device”: {“up_time”: value}}
How to arrange all this in the configurator?
1 post - 1 participant