Conversation
…e some commands from tuya app. this change forces an updatedps for selected dps (usualla 20 and/or 21 should be enough and can be set in corresponding device yml to true)
…is used to force initialization of the device
| ) | ||
| # Device DPS not initialized (e.g. after power | ||
| # cycle) — nudge with updatedps to force init | ||
| if "unvalid" in str(poll["Payload"]): |
There was a problem hiding this comment.
poll.get("Err") == 900 seems to be the condition you want here based on logs in issues received with the word "unvalid" in them. This should be more efficient and more reliable in case the underlying dummy text in the payload for this condition is changed by a device manufacturer.
| @@ -0,0 +1,190 @@ | |||
| name: RGBCW ceiling light | |||
There was a problem hiding this comment.
I think the name, and more so the filename, are deceptive, because this is not a normal RGBCW light, it is separate RGB and CCT (CW) lights. The use of dp ids in the 100-199 range for core functions is not generic, so probably using the manufacturer in the filename is more appropriate (but name here should remain generic in case of rebranding, maybe just add a space between RGB and CW).
| name: RGBCW ceiling light v3.5 | ||
| entities: | ||
| - entity: switch | ||
| name: Master power |
There was a problem hiding this comment.
Leave out this name, it should be obvious from this being the main switch and separated from the lights that it is for the whole device.
| - id: 20 | ||
| type: boolean | ||
| name: switch | ||
| - entity: light |
There was a problem hiding this comment.
Consider adding the following to make it obvious that the switch above overrides the on/off switch here:
- id: 20
type: boolean
name: available| min: 0 | ||
| max: 1000 | ||
| - entity: select | ||
| name: Scene |
There was a problem hiding this comment.
This should use a translation_key instead of name (scene is lowercase in that case). I'm not sure why the CI has not flagged this.
| mapping: | ||
| - scale: 1000 | ||
| - entity: text | ||
| name: Scene data |
There was a problem hiding this comment.
Use translation_key: scene here. Because it is a different entity type than the select above, the names do not have to be unique, and it makes sense to have them the same because they are exactly the same setting, just more control here.
| name: value | ||
| optional: true | ||
| - entity: switch | ||
| name: Unknown 34 |
There was a problem hiding this comment.
Unknown dps should generally just be added as attributes on other entities for observation, not made into full entities by themselves.
| min: 1 | ||
| max: 100 | ||
| - entity: select | ||
| name: Power-on behaviour |
There was a problem hiding this comment.
dps 33 and 35 should probably have text entities also, to allow full control.
add some additional control options for this (and possibly other similar ones) https://www.amazon.de/dp/B0DGQ6WJDB with separate control of RGB and White LED.