-
Notifications
You must be signed in to change notification settings - Fork 725
Create test_make_sky_blue.yaml #3275
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
Conversation
Hi! How to add support for this charger.. Ready to test on my own. What is needed for this? Through the tuya platform, I extracted the Id and the name of the entities returned by the device.
` |
trailing spaces
add sensor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of these comments that apply to other entities as well.
dps: | ||
- id: 101 | ||
type: enum | ||
name: charge_mode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A sensor entity needs a dp with the name sensor
which corresponds to the value of the sensor.
type
needs to be one of the basic types string
, integer
, boolean
, or special purpose types hex
, base64
, bitfield
. It should match the type of the underlying local data from the Tuya device.
enum in the Tuya portal is implemented as a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
name: charge_mode | ||
mapping: | ||
- dps_val: mode_1 | ||
value: mode_1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these be made more meaningful? The value is what will be shown in the UI, so should make sense to users without needing to fully understand the details of how the device works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course you can do it. But I only saw two values Standby and MPPT. Tuya provides the following information.
"actions":[],
"code":"",
"description":"",
"events": [],
"name":"default service",
"properties":[
{"abilityId":101,
"accessMode":"ro",
"code":"charge_mode",
"description":"",
"name":"charge mode",
"typeSpec":{
"type":"enum",
"range":["mode_1","mode_2","mode_3","mode_4","mode_5"]}},
If you tell me how to look, I will do it.
later I will look at the Standby mode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you made the change the wrong way around.
dps_val is what comes from the device, so must match the "range":["mode_1","mode_2","mode_3","mode_4","mode_5"]
from tuya documentation. value is what will show in HA, so that is the one you should change to whatever makes most sense to the end user.
dps: | ||
- id: 109 | ||
type: integer | ||
name: uv_reco_value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Number entity needs a dp with a name value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
min: 0 | ||
scale: 1 | ||
step: 1 | ||
- entity: number |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be a select entity, if it is editable (dp should have a name option
), or sensor if it is detected by the device and reported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
scale: 1 | ||
step: 1 | ||
- entity: sensor | ||
name: battery_cell |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Names of entities should be human readable, for display in the UI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
binary_sensor
class: problem category: diagnostic
name: charge_mode | ||
mapping: | ||
- dps_val: mode_1 | ||
value: mode_1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you made the change the wrong way around.
dps_val is what comes from the device, so must match the "range":["mode_1","mode_2","mode_3","mode_4","mode_5"]
from tuya documentation. value is what will show in HA, so that is the one you should change to whatever makes most sense to the end user.
model: v123 | ||
entities: | ||
- entity: sensor | ||
class: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you changed the wrong things here also. class: enum
was correct, enum is one of the classes allowed in HA for a sensor, and is required if the values are from a fixed list (which is what you get if there is a mapping with dps_val and value entries)
The enum that needed to change to string, was the type: enum
below under the dps listing. There may also be others in the file that need updating, since I only made the comment once for each issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see you've made the second part of the change now, but this class still needs reverting back to class: enum
, and the name
under entity needs to be human readable, and the name
under dps needs changing to name: sensor
so that the sensor has a dp to use (otherwise any dps with non-recognised names are added as extra attributes, only the one named sensor is used for the main state of the sensor).
category: config | ||
dps: | ||
- id: 106 | ||
type: bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a type bool from Tuya, then it needs to be spelt out as boolean here (the syntax of these config files was invented before the Tuya developer portal was known, so there are lots of little differences like this), and the whole mapping should be removed.
The dp name below also needs to change to name: switch
. because that is what the switch entity is looking for for its primary function.
- dps_val: "on" | ||
value: true | ||
- entity: binary_sensor | ||
name: fault |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to remove the name: fault
, and let the default name for class: problem
show, since that will have translations.
- filename: avoid case sensitivity issues by standardising lower case - Branding: seems to be MakeSkyBlue without spaces - range not needed for sensors - scale of 1 not needed - Entity names should be human readable, but use translations provided by underlying class where possible and unambiguous PR make-all#3275
No description provided.