To minimize the electricity that I inject to the net, I want to build a load that I can steer with the DAC from an ESP32. I developed the hardware but I have a problem to adjust the DAC output level of the ESP. No matter what I try, the compiler keeps throwing errors. Here is the code that I try to get compiled. Any help is very welcome:
output:
- platform: esp32_dac
pin: GPIO25
id: dac_output
inverted: false
globals:
- id: verbruikslevel
type: float
restore_value: no
initial_value: '0.0'
# Enable Home Assistant API
api:
encryption:
key: "WHfbz9wfDg+HYgyMTDEpNE/prIcerI8Ix7PT5x2r9no="
actions:
- action: verhoog_verbruik
then:
- lambda: |-
id(verbruikslevel) = id(verbruikslevel) + 0.1;
- output.set_level:
id: dac_output
level: |-
id(verbruikslevel)