Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lambda for dimmer #31

Open
stijnb1234 opened this issue Feb 27, 2024 · 3 comments
Open

Lambda for dimmer #31

stijnb1234 opened this issue Feb 27, 2024 · 3 comments

Comments

@stijnb1234
Copy link
Contributor

I have a DMX dimmer in my circuit with weird values:
Below 124 is off
124 - 150 is dimming from 0-100%
Above 150 is on

How can I do this with this component? Can I use the lambda, and how?

@andyboeh
Copy link
Owner

Sure: Create a template output and add your logic to the write_value function:

https://esphome.io/components/output/template.html

@stijnb1234
Copy link
Contributor Author

So far I understand. But what are the input values (which range?) and what are the output values?

@andyboeh
Copy link
Owner

The values at the output are in the range 0.0 to 1.0, it's a float output. The DMX component calculates the 0-254 values based on this float range. So you are dealing with two float ranges between 0 and 1 here and you need to map your values here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants