DFRobots 2 Channel i2c 0-10v DAC is now working in ESPHome
Opened this issue · 5 comments
Just thought I would let you all know that Jesse kindly integrated the module into ESPHome. Its not part of the main branch yet but you can see the PR here: esphome/esphome#4495
You can pull it from the git using this at the start of your ESPHome config.yaml:
# Testing 2 Channel 0-10v I2C DAC GP8403
external_components:
- source: github://pr#4495
components: gp8403
refresh: 1min
i2c:
scan: true
frequency: 400000Hz
output:
- platform: gp8403
channel: 0
id: gp8403_0
address: 0x5F
- platform: gp8403
channel: 1
id: gp8403_1
address: 0x5F
light:
- platform: monochromatic
name: "LED 1 Test V2"
output: gp8403_0
gamma_correct: 1.2
- platform: monochromatic
name: "LED 2 Test V2"
output: gp8403_1
gamma_correct: 1.2
Link to the module: https://wiki.dfrobot.com/SKU_DFR0971_2_Channel_I2C_0_10V_DAC_Module
How do you set voltage in the dac?
I had a success with following:
fan:
- platform: speed
output: gp8403_0
name: "Heater"
restore_mode: ALWAYS_OFF
The example at github (below) did not work well - the voltage change was not linear to the slider.
light:
- platform: monochromatic
name: "Heater"
output: gp8403_0
gamma_correct: 1.2
Can you post full code please?? Also, how do you set 0-10v or 0-5v in the dac??
Thanks
I have updated the original post with the full code. I haven't checked if its been merged into the ESPHome branch yet so adding the external GitHub still might be needed.
FWIW the gp8403 component is in esphome upstream and you'll get a linear output voltage by setting gamma_correct: 0
.