Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add more UPK key descriptions #219

Merged
merged 7 commits into from
Dec 8, 2023

Conversation

szupi-ipuzs
Copy link
Contributor

Based on description from tuya website (links provided in #218) I have filled in some of the missing information. The description was for bluetooth devices, but the keys I described seem to be more or less universal.

szupi-ipuzs and others added 4 commits December 7, 2023 01:08
This time by experimenting on my PIR-enabled lamp.
Motion is reported correctly via GPIO defined as pirin_pin.
I am also trying to set the PIR sensitivity by applying PWM to the pirsense_pin, and I _think_ it works. More experiments are needed.
@@ -8,7 +8,7 @@ Key(s) | Meaning
--------------------------------------------|---------------------------------------|---------------------------------------------------------
`crc` | |
`module` | |
`category` | |
`category` |Device type encoded on a set of digits | 0502 - cw light<br>0505 - rgbcw light
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are values from my actual devices, not from the description. The ones in description had 1s instead of 5s.

@@ -113,9 +119,23 @@ Key(s) | Meaning
`keyccfg1`, `keyccfg2` | |
`keyfunc`, `keyglobefunc` | |
`keylt`, `keynumber` | |
**Pairing-related** | |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really see a need for keeping detailed description of the pairing-related keys.
I doubt anyone would want to duplicate this behavior in esphome :)

IMHO, simply enumerating them as ones should be sufficient.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rstnum is useful for Cutting, as they indicate how to get a device into the proper pairing modes without having the specific product manual.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I didn't think of them. Then we should re-check the ones i marked as "not relevant", as they did have a description in sdk and might actually be useful.

Copy link
Member

@kuba2k2 kuba2k2 Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep the "known, not relevant" keys apart from the "unknown, not described yet" keys.

--------------------------------------------|---------------------------------------|---------------------------------------------------------------------------------------
`crc` | UPK data checksum |
`module` | Tuya module used | `CB3S` / `WB3S` / `CBU`, etc.
`category` | Device type as a number | 0502 - CW light<br>0505 - RGBCW light
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually belongs in the Lights/bulbs section, it only exists for bulbs, and they always start with 050
The last number is number of channels
0501 is monochromatic (usually warm white)
0503 is RGB
0504 is RGBW
but all this is covered by cmod anyway

`pmemory` | Power-off memory enabled | 0 / 1
`defcolor` | Default Color | `c` / `r`
`defbright` | Default Brightness | 0%-100%
`deftemp` | Default Color Temperature | 0-100 when defcolor is cool white
`cwmaxp` | Cold-Warm Max Power | 0%-100%
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The values here are wrong, the docs say it's 100-200 with a pitch of 10. I've actually just flashed a lamp which has it set to 200.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to correct it, of course. What I did today was just move stuff around, add a few missing descriptions and introduce some formatting changes. I didn't change the values or ranges.

Copy link
Collaborator

@Cossid Cossid Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide an example. CloudCutter has ~175 UPKs with defbright and deftemp and none are above 100.

Sorry, I was looking at the highlighted section. I see you're referring to cwmaxp in which case, yes, there are 2 examples of 200 and none below 100, none inbetween, but pitch 10 is probably right if documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem, I should've been more precise, but github's UI is still new to me (i'm used to gerrit).
@kuba2k2 Sure, this note was more for me to remember later :)

@@ -111,6 +111,12 @@ Key(s) | Meaning
`pirsense_pin` + `pirsense_lv` | PIR sensitivity (PWM) + Active Level |
`pirrange` | |
`pirwarn` | |
**Ambient light sensor** | |
Copy link
Contributor Author

@szupi-ipuzs szupi-ipuzs Dec 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are actually a guess, but I have 4 lamps (2 brennenstuhls and 2 lsc) with PIR and ambient light sensor and can observe that these valuse more or less match the actual lighting reported as ADC value. And they do differ between models a bit.

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 8, 2023

Is it ready to merge, or are you going to add more descriptions?

@kuba2k2 kuba2k2 changed the title Added description of some UPK keys [docs] Add more UPK key descriptions Dec 8, 2023
@szupi-ipuzs
Copy link
Contributor Author

szupi-ipuzs commented Dec 8, 2023 via email

@kuba2k2 kuba2k2 merged commit bb7fcd5 into libretiny-eu:master Dec 8, 2023
@kuba2k2 kuba2k2 added the documentation Improvements or additions to documentation label Dec 8, 2023
@szupi-ipuzs szupi-ipuzs deleted the upk_docs branch December 10, 2023 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants