8000 Create test_make_sky_blue.yaml by alexeytm82 · Pull Request #3275 · make-all/tuya-local · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 39 commits into from
May 31, 2025
Merged

Create test_make_sky_blue.yaml #3275

merged 39 commits into from
May 31, 2025

Conversation

alexeytm82
Copy link
Contributor

No description provided.

make-all

This comment was marked as outdated.

@github-project-automation github-project-automation bot moved this to 👀 In review in Tuya Local May 26, 2025
@make-all make-all moved this from 👀 In review to 🏗 Stalled in Tuya Local May 26, 2025
@make-all make-all added the needs rework Rework required before merge label May 26, 2025
@alexeytm82
Copy link
Contributor Author
alexeytm82 commented May 27, 2025

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.
`

  DP ID Event Details
101 Charge_mode Standby
101 Charge_mode MPPT
102 PV input voltage 46.60V
103 Battery charging voltage 45.00V
104 Battery charging current 0.00A
105 Power 2.80W
106 OFF_ON ON OFF
107 Fault 1
108 Total Energy 4.80KW.h
109 Undervoltage recovery 46.80V
110 Undervoltage protection value 44.80V
111 SOC 0,00%
112 Type of Battery Lithium Battery
113 Temperature 28.50℃
114 Number of batteries 4
115 Absorption Charge Voltage Settings 56.00V
116 Float charging voltage setting 56.00V
117 Charging current setting 30A
118 Output timing 24H

`

@alexeytm82 alexeytm82 closed this May 27, 2025
@github-project-automation github-project-automation bot moved this from 🏗 Stalled to ✅ Done in Tuya Local May 27, 2025
@alexeytm82 alexeytm82 deleted the patch-1 branch May 27, 2025 09:01
@alexeytm82 alexeytm82 restored the patch-1 branch May 27, 2025 09:01
@alexeytm82 alexeytm82 reopened this May 27, 2025
@github-project-automation github-project-automation bot moved this from ✅ Done to 📋 Backlog in Tuya Local May 27, 2025
@make-all make-all removed the needs rework Rework required before merge label May 28, 2025
@make-all make-all moved this from 📋 Backlog to 👀 In review in Tuya Local May 28, 2025
@alexeytm82 alexeytm82 requested a review from make-all May 28, 2025 13:11
Copy link
Owner
@make-all make-all left a 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
Copy link
Owner

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.

Copy link
Contributor Author

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
Copy link
Owner

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.

Copy link
Contributor Author

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

Copy link
Owner

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
Copy link
Owner

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

Copy link
Contributor Author

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
Copy link
Owner

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.

Copy link
Contributor Author

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
Copy link
Owner

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.

Copy link
Contributor Author

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
Copy link
Owner

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
Copy link
Owner

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.

Copy link
Owner

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
Copy link
Owner

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.

@alexeytm82 alexeytm82 requested a review from make-all May 30, 2025 10:52
- dps_val: "on"
value: true
- entity: binary_sensor
name: fault
Copy link
Owner

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.

@alexeytm82 alexeytm82 requested a review from make-all May 30, 2025 10:57
@alexeytm82
Copy link
Contributor Author

Work
Знімок екрана 2025-05-30 165832
Знімок екрана 2025-05-30 165842

alexeytm82 and others added 2 commits May 30, 2025 18:08
- 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
@make-all make-all merged commit b6fc1f2 into make-all:main May 31, 2025
4 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Tuya Local May 31, 2025
make-all added a commit that referenced this pull request May 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants
0