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

unclear how to add ITEAD BN-SZ01 to the code as a separate device. #132

Closed
xoseperez opened this issue May 1, 2017 · 5 comments
Closed
Labels
enhancement New feature or request minor

Comments

@xoseperez
Copy link
Owner

Originally reported by: Axel Roest (Bitbucket: axello, GitHub: axello)


Hi,
I forked the Espurna repo to add the ITEAD_BNSZ01 LED light.
To do that I added extra lines in arduino.h, hardware.h and hardware.ino

However, when I compile it with

#!C

    #define RELAY_PROVIDER      RELAY_PROVIDER_LIGHT

it generates errors that lightState(status); and lightState(); are not defined.

These are also used in the AI_LIGHT configuration, but this module uses the my9291 dimmer module.
The ITEAD_BNSZ01 uses a BP2838G chip, but what I gather from the following blogpost and using espeasy, it should be dimmable using a simple pwm value on GPIO12.
itead-bn-sz01

My problem:
how to define GPIO12 as a dimmable output using espurna source code and constants.
See my fork for my try-outs
Apparently RELAY_PROVIDER_LIGHT is in some way hard-coded to a LIGHT_PROVIDER_MY9192 or LIGHT_PROVIDER_RGB, and there is no LIGHT_PROVIDER_DIMMER or similar which only dims one LED channel?

I have adapted it now to use

#!C

	LIGHT_PROVIDER_RGBW

and redefined

#!C

	#define RGBW_WHITE_PIN          12

This compiles.
But, I cannot understand how to connect a domoticz idx to this value; I don't understand the logic in the code to add idx channels.

fork at: https://bitbucket.org/axello/espurna_axel
branch: ITEAD_BNSZ01

@xoseperez
Copy link
Owner Author

There is no one-channel dimmer yet in ESPurna.
I don't have that particular device but it should be the same with any other LED device.

@xoseperez
Copy link
Owner Author

Removing milestone: 1.8.1 (automated comment)

@xoseperez
Copy link
Owner Author

Original comment by Axel Roest (Bitbucket: axello, GitHub: axello):


You say "it should be the same with any other LED device.", but the LIGHT_PROVIDER_MY9192 uses a special chip, and the LIGHT_PROVIDER_RGB apparently does some more magic to appear in the list to add Domotics #idx. Like the POW module does. If have tried the LIGHT_PROVIDER_RGBW option now. If that works, I can probably split of a LIGHT_PROVIDER_DIMMER option.
Could you give me a hint in which direction to pursue to add a domoticz #idx to a single bit PWM channel?

@xoseperez
Copy link
Owner Author

Support for BN-SZ01 released with 1.9.0 using the new LIGHT_PROVIDER_DIMMER

@xoseperez
Copy link
Owner Author

Removing milestone: 1.8.4 (automated comment)

@xoseperez xoseperez added minor 1.7.1 enhancement New feature or request labels Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor
Projects
None yet
Development

No branches or pull requests

1 participant