Open red3 opened 6 months ago
challenge accepted
hey @toughvj , just add some details here: I've started looking into the javascript files within the Gree+ app and found a few methods might helpful, comments are added by me by analyzing the contexts, so they can be inaccurate):
setLig:function(t) {
var e=0,n=0;
switch(t.value){
case 0:
e=0,n=1;break; // off
case 1:
e=1,n=1;break; // on
case 2:
e=1,n=0;break; // auto
default:break
}
this.setState(["ableSend",!0]),
this.sendData({Lig:e,LigSen:n})
}
LigStatus:function(){
return console.log("LigStatus=======",[0,0,2,1][2*this.Lig+this.LigSen]),
[0,0,2,1][2*this.Lig+this.LigSen]
// 3 for on;
// 2 for off;
// 1 for auto
}
seed like we need an input_selector to represent the light status or maybe just another input_bool to represent built-in auto light on/off
We should replace light input boolean and auto_light with input_selctor with options:
I need some time to take a look at this
@red please try attached file. To enable light sensor add light_sensor: to config.yaml with input_boolean entity id. Please let me know if it works. climate.txt
Thanks for your work, I will try this later this week.
@toughvj I tried and it did not turn the inner light sensor on, maybe we should try to use command Lig:1,LigSen:0
like I previous said to let it work.
Another thinking: can we turn off both the lights and the light sensor when the ac is turned off, cause if the light sensor remains on when the ac is off, and it is daytime, the lights will turn on automaticly, which can be annoying.
@red3 I need log from HA and configuration.yaml to see what is wrong.
I didn't turn on logs on my previous test, I'm currently away from home and I will collect the logs next time. From what I observed on the HA dashboard ui: when I turned the light on first, and then turned the light sensor on, the gree+ app was displayed as AUTOMATICALLY which was expected, wish this would be helpful.
Strange thing. If the gree+ application shows light as automatically, it means that both parameters have been set correctly in the device. Maybe there should be another parameter there?
Can U send me back javascript files from gree+ app?
As I said the gree+ app only display automatically when I turn on lights before turn on light sensor, I guess we should use both Lig:1 and LigSen:0 to represent turn on the built in light sensor. I will send you the JavaScript file tomorrow.
try attached file but remove light_sensor entity id from configuration. Then try switch light on, this would send {'Lig':1, 'LigSen':0} This is for testing only. climate.txt
hey @toughvj this version works well:
when I turn light on, gree+ app shows Automaticly
when I turn light off, gree+ app shows Off
Also, attached file is javascript file from gree+ app, you can search setLig:function
for detailed information
gree.txt
ok, and light sensor works well?
Do you mean whether the built-in light sensor functionality is working correctly? yeah it's working well
this is some kind of starting point. Need some time to get this working.
@red3 please try attached file. from this version auto_light, auto_xfan and light_sensor must be provided with input_boolean entity id. Please give any feedback if it fit's your needs. climate.txt
this version works fine, thanks for your excellent work. @toughvj
@RobHofmann this can be closed, solved in #188
My ac has the built-in auto light feature, which automatically turn the panel light on or off based on the light Illuminance environment.
Can we expand the current auto light feature to support the built-in one?
Additionally, the command of the built-in auto light feature is
LigSen
, and it’s value would be0
means on and1
means off (quite weird it uses 0 to represent on state and I double checked)