-
Notifications
You must be signed in to change notification settings - Fork 4
Testing Strategies Dimmers
Initial setup details
There are a number of SetOption settings which affect operation. To try to get some consistant test results, it's preferable if we start with a 'default' configuration. Specifically Setoption20 and setoption54 affect Tuya MCU dimmers.
Backup your configuration, find the device template page on Blakadder.
From the web console, perform a 'reset 6' ("erase all flash and reset parameters to firmware defaults but keep Wi-Fi and MQTT settings and restart").
(note, this will lose your device name, etc., but the device will come up on wifi).
Refresh the browser, go to configuration/Configure Other, paste the template, check 'Activate', and save.
Go to configuration/Configure Logging, and set for 'More Debug' on the logging output(s) you will use. (setup syslog details if it's your method) (see logging wiki page about logging to disk).
Note: if the device comes back, but does not seem to be a dimmer, re-paste the template, and re-save.
e.g. for the Athom dimmer template below, the CMND did not seem to take the first time?
In fact, re-applying set the TuyaMCU 21,2
but did not set the DimmerRange 10,1000
- so maybe templates are a little broken in 11?
It may be best to send any commands manually in the web console, and then restart.
{"NAME":"Athom Dimmer Switch","GPIO":[576,2272,0,2304,0,0,0,0,0,0,0,0,0,1],"FLAG":0,"BASE":54, "CMND":"TuyaMCU 21,2|Ledtable 0|DimmerRange 10,1000"}
If you DON'T reset to defaults (e.g. because you don't have time, do not wish to, etc.), then please at least issue setoption20 and setoption54 in the web console, and note the values, then setoption20 0, setoption54 0, and note above your boot log that it's not been reset completely.
Note: if your template has a button allocated, I believe this may lead to odd behaviour (e.g. WF-DS01). It's under investigation...
Boot log details
If possible, do a power-off restart, and capture startup logs (MQTT logging can get quite close to startup).
Start a new wiki page under 'Devices'.
Add a short device description/link, and add the template.
Remove any reference to passwords or other private info in the log.
Attach the base log like this markdown:
(blank line after details is important!) thankyou to @tzagim for using this form of log attachment :).
<details><summary>Power-on log|reset log</summary>
```
paste the log here
enclosed in triple back-ticks
```
</details>
e.g. (edit this page to see the source):
reset log
paste the log here
enclosed in triple back-ticks
webUI operation.
Check the basic operation.
Toggling the light should work.
Setting the dim level should work in the ON state.
When Setting the dim level in the OFF state, TAS will turn on the light, wait 2 seconds, and then send the requested dim value.
If you encounter any strange behaviour, try to repeat it, and add an additional folding log your/the device page in the wiki (see boot log entry above).
If all seems to be ok, add a note in your/the device page in the wiki (see boot log entry above).
buttons operation.
Check the basic operation.
Toggling the light from button should work.
using up and down should work.
Note: TAS webui will NOT refresh the dim level without a page refresh.
Try combining physical control with webconsole/webui control (e.g. turn it off via the switch, and back on using TAS).
If you encounter any strange behaviour, try to repeat it, and add an additional folding log your/the device page in the wiki (see boot log entry above).
If all seems to be ok, add a note in your/the device page in the wiki (see boot log entry above).
web console operation.
Check the basic operation.
Commands/Command sequences to try:
power off
dimmer 50
power on
dimmer 20
dimmer 0
dimmer 100
power on
backlog power on; dimmer 30; power off; dimmer 60; power on
backlog power off; power off; power off; power off
backlog power on; dimmer 30; dimmer 60; dimmer 100; dimmer 30
If you encounter any strange behaviour, try to repeat it, and add an additional folding log your/the device page in the wiki (see boot log entry above).
One thing we need to understand about the devices is the dim levels that they will actually end up at through sequences like the above.
The Tuya MCU sends dim levels, and TAS stores them... the trouble with this is that in a 'power off' scenario, we'd probably like to keep the last lit dim level, but MCUs tend to send all the values as they slowly dim, so we end up with a low value stored in TAS. So a subsequent 'power on' may restore a dim level which was the last rxed - i.e. a low level. But of course this all depends on the MCU...
If all seems to be ok, add a note in your/the device page in the wiki (see boot log entry above).
MQTT operation.
In theory, MQTT commands should be the same as console commands. However, experience has shown that controlling systems can do some strange things.
It's probably only worth moving on to this test if other testing worked or is completely understood.
Control your dimmer via whatever control system you have.
If you encounter any strange behaviour, try to repeat it, and add an additional folding log your/the device page in the wiki (see boot log entry above), with a brief explanation of the type of control, and what it did/did not do.
If all seems to be ok, add a note in your/the device page in the wiki (see boot log entry above), with a brief explanation of the type of control, tests done, and what it did.