Closed woetski123 closed 6 months ago
@woetski123 I need to implement support for Light component with britghness entity.
I need all the logs from the "collect debug info" feature : https://github.com/Baldhor/Homey-ESPhome-Enhanced/wiki/User-Guide#manage-your-physical-devices-page
I then should be able to simulate your device, and implement it within few days.
In the meantime, I analyzed a little the attributs to implement to supports the light component fully. Note: it goes much farther than your needs, but I will do it fully if possible.
https://esphome.io/components/light/index.html
transition_length: time! Require to implement a specific input format rule to allow to input seconds, hours, ... whatever color_mode: dynamic list of values brightness: percentage => slidder 0.0 to 1.0 (if mode is compatible) color_brightness: percentage => slidder 0.0 to 1.0 (if mode is compatible) red: percentage => slidder 0.0 to 1.0 (if mode is compatible) green: percentage => slidder 0.0 to 1.0 (if mode is compatible) bleu: percentage => slidder 0.0 to 1.0 (if mode is compatible) white: percentage => slidder 0.0 to 1.0 (if mode is compatible) color_temperature: float => slidder based on minMireds and Maxmireds cold_white: percentage => slidder 0.0 to 1.0 (if mode is compatible) warm_white: percentage => slidder 0.0 to 1.0 (if mode is compatible) flash_length: time => refer to transition_length. effect: dynamic list of values
Reminder: dynamic list of values is not supported by Homey, by default, only the context aware flow cards will be available. => Implementation of user specific list of value will be on user request for a beer!
Implementation of supportedColorMode is strange! For exemple, the value 3 means ON_OFF && BRIGHTNESS. => https://www.esphome.io/api/color__mode_8h_source I feel some mapping will be required ...
flash_length This attribut require to send a color at the same time,. A color can actually be any of the attributs red, blue, green, brigthness, ... and it depends of the color mode selected. From Homey side, it's just impossible to implement such functionnality. The only way would be to use a kind of script, or a specific format like: 2G1B1bri... => I will not be supported
low level api Low level api use the legacySupported flag to authorize or not the functionnalities ... legacy means legacy ... I feel it will create some issues!
setBrightness(brightness) {
if (!this.config.legacySupportsBrightness) throw new Error('brightness is not supported');
this.command({ brightness });
}
It should be based on the "selected mode":
ON_OFF: Only on/off control.
BRIGHTNESS: Only brightness control. Accepts brightness parameter.
WHITE: Single white channel only. Accepts brightness and white parameters.
COLOR_TEMPERATURE: Color-temperature controlled white channel. Accepts brightness and color_temperature parameters.
COLD_WARM_WHITE: Cold and warm white channels. Accepts brightness, color_temperature, cold_white and warm_white parameters.
RGB: RGB color channels. Accepts brightness, color_brightness, red, green and blue parameters.
RGB_WHITE: RGB color channels and a separate white channel. Accepts parameters from RGB and WHITE color modes.
RGB_COLOR_TEMPERATURE: RGB color channels and a separate color-temperature controlled white channel. Accepts parameters from RGB and COLOR_TEMPERATURE color modes.
RGB_COLD_WARM_WHITE: RGB color channels and two separate cold and warm white channels. Accepts parameters from RGB and COLD_WARM_WHITE color modes.
Hi Baldhor, Many thanks for the fast and friendly response!
The missing "mv_unit_speed_test", should be able to control the fan speed. So i guess some sort of PWM as an input possibly.
I'm also in contact with the designer of the device, so if you have questions?
Here is the log:
"{
"versions": {
"platform": "local",
"platformVersion": 2,
"version": "10.1.0",
"appVersion": "1.2.2"
},
"physicalDeviceId": "Wizard1701083203228",
"physicalDevice": {
"physicalDeviceId": "Wizard1701083203228",
"status": "available",
"used": true,
"name": "OrconMVS15_controller",
"ipAddress": "192.168.178.24",
"port": "6053",
"encryptionKey": "
@woetski123 Thans for the full logs, I will be honest, it doesn't provide any usefull additional information lol
next step for me is to find a way to simulate the behaviour of your device, I will check on it this weekend, after that it should be straight forward. I do not have a "light" esphome device ...
edit: to be honest, I don't understand the choice of the developper to use a light component ... but anyway soon or later Light must be implemented, so why not now
@woetski123 I published a version with support for state and brightness. It should be live tomorrow, in the meantime, you can install the test version : https://homey.app/fr-fr/app/nl.inversion.esphome/ESPhome/test/
!!! I noticed an annoying behaviour of the monochromatic component:
Two solutions here:
You can match brightness to many capability, I would suggest DIM for your usecase, and the device class FAN.
Have fun, and let me know if any issue.
ah no, the solution I proposed above doesn't work ... changing brightness will not turn on the state ... so need to handle both. Very annoying ...
Know behaviour, which other users reported as annoying and proposed ESPhome pull request => https://github.com/esphome/issues/issues/2833 But those pull requests have been ignored, apparently the behaviour expected is different for many users ...
I suggest to modify your device configuration to use fan speed component: https://esphome.io/components/fan/speed
Note: It will require to implement the support of this component in the ESPhome app for Homey ...
closing:
Thanks
@Baldhor, mate. new test update works beautiful, indeed what you say is true: "I can now regulate fan speed of my house, and indeed when switching the state it goes to 100% first." But that's no problem.
Enjoy your well deserved rest of the weekend!
Is your feature request related to a problem? Please describe. I've connected the ESPHOME device https://www.tindie.com/products/hjhickinson/orconwificontroller-for-orcon-mvs-15/ to Homey pro 2023 which the ESPHOME app. I see 5x sensors and 1x switch. I'm unfortunately missing just 1 entity to set the fan speed. I've contacted the seller, he said it should be: Type: "Light", Name: "mv_unit_speed_test".
When looking at the log the ESP home application makes in the GUI, i can see the following: "{ "id": 1428093848, "type": "Light", "name": "mv_unit_speed_test", "config": { "objectId": "mv_unit_speed_test", "key": 1428093848, "name": "mv_unit_speed_test", "uniqueId": "mvtest13lightmv_unit_speed_test", "supportedColorModesList": [ 3 ], "legacySupportsBrightness": true, "legacySupportsRgb": false, "legacySupportsWhiteValue": false, "legacySupportsColorTemperature": false, "minMireds": 0, "maxMireds": 0, "effectsList": [], "disabledByDefault": false, "icon": "", "entityCategory": 0 }"
But unfortunately I cannot select this in the native capability and i've not found out how to do this myself.
Describe the solution you'd like Please add the native capability. Mega thank you.
Describe alternatives you've considered N.A.
Additional context If you need more information, logs, do not hesitate to contact me.
Wouter Netherlands