-
Notifications
You must be signed in to change notification settings - Fork 574
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
What is a DP? #148
Comments
Yeah, our documentation is kinda scarce and we will have to improve that over time (there are lots of information on other pages on the net in the mean time). But a datapoint is basically a function of the device, e.g if it's on, current power consumption, position of a cover, brightness value, etc. A datapoint is just a number mapping to something representing its value. For a switch/outlet for instance, DP 1 normally maps to the state of the switch. Since it can be either on or off, it's a boolean value (True/False). I would expect that this is the case for you as well. The other datapoint is likely a built in timer, which we don't support. In due time, the config flow will suggest likely values for you as well (see PR #125). |
Thank you for the answer. Would a dimmable switch still be considered a switch? Light bulb seems to be more appropriate. When I add it this way, I have these values for ID and Brightness: Brightness Lower Value defaults to 29 and Brightness Upper Value defaults to 1000. How do I know which values for ID and Brightness are appropriate? |
You should use DP 1 for ID and DP 3 for brightness. The range is hard to tell, but I suggest that you set the maximum value in the app you are using and then try to add the switch. DP 3 should have the maximum value in the list now. The do the same thing for lowest brightness, or close to it. Based on what you are saying it's likely that lower limit is 0 and upper 255. |
Ok, I finally got it working. Your reply helped. The values that eventually worked were 25 for the min and 255 for the max. Interestingly, the min value defaults to 29 every time. If I use any values other than 25 and 255, the slider acts funny. For example, at 29 and 255, if I drag the slider to 100%, the light does change to full brightness but the slider snaps back to about 1/3. |
There were some errors along the way. Here are some logs if it helps.
|
Would it be possible if you tried running using the code in #177? Based on the error, I guess you are using. 3.0.3 or so? Lots of fixes have been made since then. |
I updated to 3.1.0 via HACS. There are still some errors in the logs. `Log Details (ERROR) [420...4ae] Heartbeat failed (), disconnecting I also see frequent 'unavailable' messages in the log book, although the lights appear to be working OK.
|
I'm sorry to report that things are worse with the new version. I sometimes see switches physically flash red. In HA, it's now not uncommon to see the switch toggle not match the state of the light, or not respond to moving the slider. Usually, this means it's stuck in the on position. If I try to toggle it off, it quickly goes back to on, regardless of the actual light status. |
The docs instruct:
The first question that comes to mind is: wth is DP? o.O And I'm here after googling two years later after OP :( |
Thank you for the work on this project. I appreciate your efforts.
The documentation states, 'For each entity, the associated DP has to be selected' and presumes the reader knows what DP stands for. What is DP? I have two options (for my Tuya OEM), but I don't know which option to select.
The text was updated successfully, but these errors were encountered: