a-lost-shadow / gosund-sw2

ESP Home Integration for Gosund SW2 Dimmer
GNU General Public License v2.0
12 stars 9 forks source link

Adjusting the Min and Max brightness #2

Open grregis opened 4 years ago

grregis commented 4 years ago

Great job on this template for espHome. I was using Tasmota but I could never get the physical button working properly, this worked perfectly right away.

One thing I noticed with these dimmers was that they are much brighter than my old dumb dimmers: they don't get as dim as before and are much brighter too on max. Is there a way to adjust the output of the min and max values? I know on most dimmers that's possible in tasmota, and I looked through the files (I'm no expert) but couldn't find where it might be.

Any help is appreciated and thanks again for the awesome job!

a-lost-shadow commented 4 years ago

I started implementing this at the same time as esphome integration and then put it down due to wrist ergo issues. I'll see if I can pick it up in the near term. Adding the min/max values shouldn't be too difficult. The harder part is the yaml processing.

Were you hoping for being able to set the min/max once in the yaml file. Or something that could actively be changed at while running?

jschwalbe commented 4 years ago

I too would enjoy seeing a max setting within the yaml.

I recently installed two new switches and for some reason at the 'max' setting (brightness_pct of 100), the light actually turns off (or is incredibly dim), at ~99 it blinks really fast and ~95 is normal max brightness for the bulbs.

jschwalbe commented 4 years ago

Here's a solution I implemented in NodeRED which watches the brightness, if someone purposely/accidentally raises the brightness to the top, it'll send it back down to the appropriate level: [{"id":"996fc183.3b615","type":"tab","label":"TV Lights","disabled":false,"info":""},{"id":"29c6adb0.d594f2","type":"api-call-service","z":"996fc183.3b615","name":"Fix Brightness","server":"9344209b.b3b01","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.familyroom_light","data":"{\"brightness\": 240}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":560,"y":160,"wires":[[]]},{"id":"dffdbbe9.4258f8","type":"switch","z":"996fc183.3b615","name":"Brightness > 250","property":"data.event.new_state.attributes.brightness","propertyType":"msg","rules":[{"t":"gt","v":"200","vt":"str"},{"t":"lte","v":"200","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":160,"wires":[["29c6adb0.d594f2"],[]]},{"id":"2a2f87b8.ffa618","type":"trigger-state","z":"996fc183.3b615","name":"Fam Room Light","server":"9344209b.b3b01","exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityid":"light.familyroom_light","entityidfiltertype":"exact","debugenabled":false,"constraints":[],"outputs":2,"customoutputs":[],"outputinitially":true,"state_type":"str","x":130,"y":160,"wires":[["dffdbbe9.4258f8"],[]]},{"id":"9344209b.b3b01","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true}]