Hello,
I have searched a lot and tried different things but couldn’t manage to do it.
I want to expose a switch to Home Assistant from ESPhome to turn on and off the TM1637.
I can do this by soldering a transistor to 5V and GPIO, then exposing this to Home Assistant. But this is too much trouble. Is there a way to do this using only software?
I have tried below config but apparently library doesn’t support this:
I’d set up a global variable that you set in your turn_off_action that you check in your lambda for display and know if you should output a value or just a blank string.
Thanks a lot for the above. I hope I can get an answer to my question:
Got my TM1637 up and running but I would like to dim the display intensity according to the local time. During the day the display intensity should be 7, during the evening and night the intensity should be 1.
Is this even possible? I hope that someone or maybe @laxarus or @pcon can help me out !
How I would do it is to create a template binary_sensor in HA that consults the current time and compares it against two input_datetime fields to have a binary_sensor.dim_display. Then import that into ESPHome.
After you have that in your device, you can create a lambda for intensity to return the right value based on the on/off state of your binary_sensor.dim_display.
Alternatively, you could have HA generate a template sensor that just returns the intensity you want based on time of day, sun position, etc and just pipe that directly into your intensity lambda.
You can expose the intensity to HA by using global variables and create an automation in HA to adjust the intensity.
I use this to achieve a similar effect.
Something like this:
Is it also posible to add this switch as an light in HA with a dimmable function? I’m asking this because it would be nice to get the clock “Klok” into HomeKit as a light from where I could dim it.