You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ADVANCED_OPTIONS.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,7 @@ Before configuring, you may need to:
27
27
-`onSet` - **optional**: A one-line JavaScript code to convert the new value to the old value. The function is called with two arguments: `device` and `value`. Returning `undefined` means to skip sending the command.
28
28
-`hidden` - **optional**: Whether to hide the schema. Defaults to `false`.
29
29
30
+
30
31
## Examples
31
32
32
33
### Hide device / scene
@@ -43,6 +44,7 @@ Before configuring, you may need to:
43
44
}
44
45
```
45
46
47
+
46
48
### Offline as off
47
49
48
50
If you want to display off status when device is offline:
@@ -61,6 +63,7 @@ If you want to display off status when device is offline:
61
63
}
62
64
```
63
65
66
+
64
67
### Change DP code
65
68
66
69
```js
@@ -78,6 +81,7 @@ If you want to display off status when device is offline:
78
81
}
79
82
```
80
83
84
+
81
85
### Convert from enum DP to boolean DP
82
86
83
87
A example of convert `open`/`close` into `true`/`false`.
@@ -98,6 +102,7 @@ A example of convert `open`/`close` into `true`/`false`.
98
102
}
99
103
```
100
104
105
+
101
106
### Adjust integer DP ranges
102
107
103
108
Some odd thermostat stores double of the real value to keep the decimal part (0.5°C).
@@ -143,6 +148,7 @@ Here's the example config:
143
148
144
149
After transform value using `onGet` and `onSet`, and new range in `property`, it should be working now.
145
150
151
+
146
152
### Reverse curtain motor's on/off state
147
153
148
154
Most curtain motor have "reverse mode" setting in the Tuya App, if you don't have this, you can reverse `percent_control`/`position` and `percent_state` in the plugin config:
@@ -167,6 +173,7 @@ Most curtain motor have "reverse mode" setting in the Tuya App, if you don't hav
167
173
}
168
174
```
169
175
176
+
170
177
### Skip send on/off command when touching brightness/speed slider
171
178
172
179
Some products (dimmer, fan) having issue when sending brightness/speed command with on/off command together. Here's an example of skip on/off command.
@@ -186,6 +193,7 @@ Some products (dimmer, fan) having issue when sending brightness/speed command w
0 commit comments