├── LICENSE ├── README.md ├── dali ├── DALI_DAPC_VALUES.h ├── README.md ├── __init__.py ├── dali.cpp ├── dali.h └── output │ ├── __init__.py │ ├── dali_output.cpp │ └── dali_output.h └── schematic.PNG /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 OdinReiter 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESPHome_DALI-Interface 2 | A Module that allowes an ESP to send Data to DALI LED-Drivers over an simple DIY Interface. 3 | 4 | ## Information about DALI 5 | 6 | see: https://de.wikipedia.org/wiki/Digital_Addressable_Lighting_Interface 7 | 8 | ## Hardware interface 9 | 10 | used components: 11 | 12 | - U1: pc817 (Optocoupler) 13 | - T1: BD 137 (Transistor) 14 | - B1: B140C1500 (Rectifier) 15 | 16 | 17 | ![a Image](schematic.PNG) 18 | 19 | (its not the best one, because it wont complied with the DALI standard!) 20 | 21 | ## usage in ESPhome: 22 | 23 | first example: 24 | ```` 25 | light: 26 | - platform: monochromatic 27 | name: "name of light" 28 | output: light_out 29 | gamma_correct : 0 # no brightness correction 30 | default_transition_length: 0s # no transition (Faderate and fadetime will do that) 31 | output: 32 | - platform: dali 33 | id: light_out # id output for light 34 | DALI_Hub: hub # id of dali hub 35 | dali: 36 | id: hub # id of hub 37 | sending_pin: 5 # your pin 38 | ```` 39 | 40 | with two lights: 41 | ```` 42 | light: 43 | - platform: monochromatic 44 | name: "name of light 1" 45 | output: light_out_1 46 | ... 47 | - platform: monochromatic 48 | name: "name of light 2" 49 | output: light_out_2 50 | ... 51 | output: 52 | - platform: dali 53 | id: light_out_1 54 | DALI_Hub: hub 55 | - platform: dali 56 | id: light_out_2 57 | DALI_Hub: hub 58 | dali: 59 | id: hub 60 | sending_pin: 5 61 | ```` 62 | 63 | 64 | ## planned features (if needed) 65 | 66 | - sending Faderate and Fadetime 67 | - interface for getting current brightness value etc 68 | - reading values from the bus (with hardware update) 69 | 70 | ## Others 71 | 72 | thanks to ssieb and Azimath for getting started with the custom components on the official discord channel! 73 | 74 | - github page ssieb: https://github.com/ssieb 75 | - esphome Discord channel: https://discord.com/invite/KhAMKrd 76 | -------------------------------------------------------------------------------- /dali/DALI_DAPC_VALUES.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | const double _DALI_DIMMINGCURVE_PERCENT [] = { 3 | 0.1, 4 | 0.103, 5 | 0.106, 6 | 0.109, 7 | 0.112, 8 | 0.115, 9 | 0.118, 10 | 0.121, 11 | 0.124, 12 | 0.128, 13 | 0.131, 14 | 0.135, 15 | 0.139, 16 | 0.143, 17 | 0.147, 18 | 0.151, 19 | 0.155, 20 | 0.159, 21 | 0.163, 22 | 0.168, 23 | 0.173, 24 | 0.177, 25 | 0.182, 26 | 0.187, 27 | 0.193, 28 | 0.198, 29 | 0.203, 30 | 0.209, 31 | 0.215, 32 | 0.221, 33 | 0.227, 34 | 0.233, 35 | 0.24, 36 | 0.246, 37 | 0.253, 38 | 0.26, 39 | 0.267, 40 | 0.275, 41 | 0.282, 42 | 0.29, 43 | 0.298, 44 | 0.306, 45 | 0.315, 46 | 0.324, 47 | 0.332, 48 | 0.342, 49 | 0.351, 50 | 0.361, 51 | 0.371, 52 | 0.381, 53 | 0.392, 54 | 0.402, 55 | 0.414, 56 | 0.425, 57 | 0.437, 58 | 0.449, 59 | 0.461, 60 | 0.474, 61 | 0.487, 62 | 0.501, 63 | 0.515, 64 | 0.529, 65 | 0.543, 66 | 0.559, 67 | 0.574, 68 | 0.59, 69 | 0.606, 70 | 0.623, 71 | 0.64, 72 | 0.658, 73 | 0.676, 74 | 0.695, 75 | 0.714, 76 | 0.734, 77 | 0.754, 78 | 0.775, 79 | 0.796, 80 | 0.819, 81 | 0.841, 82 | 0.864, 83 | 0.888, 84 | 0.913, 85 | 0.938, 86 | 0.964, 87 | 0.991, 88 | 1.018, 89 | 1.047, 90 | 1.076, 91 | 1.105, 92 | 1.136, 93 | 1.167, 94 | 1.2, 95 | 1.233, 96 | 1.267, 97 | 1.302, 98 | 1.338, 99 | 1.375, 100 | 1.413, 101 | 1.452, 102 | 1.492, 103 | 1.534, 104 | 1.576, 105 | 1.62, 106 | 1.665, 107 | 1.711, 108 | 1.758, 109 | 1.807, 110 | 1.857, 111 | 1.908, 112 | 1.961, 113 | 2.015, 114 | 2.071, 115 | 2.128, 116 | 2.187, 117 | 2.248, 118 | 2.31, 119 | 2.374, 120 | 2.44, 121 | 2.507, 122 | 2.577, 123 | 2.648, 124 | 2.721, 125 | 2.797, 126 | 2.874, 127 | 2.954, 128 | 3.035, 129 | 3.119, 130 | 3.206, 131 | 3.294, 132 | 3.386, 133 | 3.479, 134 | 3.576, 135 | 3.675, 136 | 3.776, 137 | 3.881, 138 | 3.988, 139 | 4.099, 140 | 4.212, 141 | 4.329, 142 | 4.449, 143 | 4.572, 144 | 4.698, 145 | 4.828, 146 | 4.962, 147 | 5.099, 148 | 5.24, 149 | 5.385, 150 | 5.535, 151 | 5.688, 152 | 5.845, 153 | 6.007, 154 | 6.173, 155 | 6.344, 156 | 6.52, 157 | 6.7, 158 | 6.886, 159 | 7.076, 160 | 7.272, 161 | 7.473, 162 | 7.68, 163 | 7.893, 164 | 8.111, 165 | 8.336, 166 | 8.567, 167 | 8.804, 168 | 9.047, 169 | 9.298, 170 | 9.555, 171 | 9.82, 172 | 10.091, 173 | 10.371, 174 | 10.658, 175 | 10.953, 176 | 11.256, 177 | 11.568, 178 | 11.888, 179 | 12.217, 180 | 12.555, 181 | 12.902, 182 | 13.26, 183 | 13.627, 184 | 14.004, 185 | 14.391, 186 | 14.79, 187 | 15.199, 188 | 15.62, 189 | 16.052, 190 | 16.496, 191 | 16.953, 192 | 17.422, 193 | 17.905, 194 | 18.4, 195 | 18.909, 196 | 19.433, 197 | 19.971, 198 | 20.524, 199 | 21.092, 200 | 21.675, 201 | 22.275, 202 | 22.892, 203 | 23.526, 204 | 24.177, 205 | 24.846, 206 | 25.534, 207 | 26.241, 208 | 26.967, 209 | 27.713, 210 | 28.48, 211 | 29.269, 212 | 30.079, 213 | 30.911, 214 | 31.767, 215 | 32.646, 216 | 33.55, 217 | 34.479, 218 | 35.433, 219 | 36.414, 220 | 37.422, 221 | 38.457, 222 | 39.522, 223 | 40.616, 224 | 41.74, 225 | 42.895, 226 | 44.083, 227 | 45.303, 228 | 46.557, 229 | 47.846, 230 | 49.17, 231 | 50.531, 232 | 51.93, 233 | 53.367, 234 | 54.844, 235 | 56.362, 236 | 57.922, 237 | 59.526, 238 | 61.173, 239 | 62.866, 240 | 64.607, 241 | 66.395, 242 | 68.233, 243 | 70.121, 244 | 72.062, 245 | 74.057, 246 | 76.107, 247 | 78.213, 248 | 80.378, 249 | 82.603, 250 | 84.889, 251 | 87.239, 252 | 89.654, 253 | 92.135, 254 | 94.686, 255 | 97.307, 256 | 100}; -------------------------------------------------------------------------------- /dali/README.md: -------------------------------------------------------------------------------- 1 | ```yaml 2 | # example configuration: 3 | 4 | light: 5 | - platform: monochrome 6 | output: output_1 7 | 8 | dali: 9 | id: my_dali 10 | sending_pin: 1 11 | reading_pin: 2 12 | 13 | output: 14 | - platform: dali 15 | id: output_1 16 | dali_id: my_dali 17 | address: 5 18 | ``` -------------------------------------------------------------------------------- /dali/__init__.py: -------------------------------------------------------------------------------- 1 | import esphome.codegen as cg 2 | import esphome.config_validation as cv 3 | from esphome import pins # class Pins 4 | from esphome.const import CONF_ID, CONF_PIN # Const predefined names of esphome 5 | 6 | # custom input in yaml 7 | CONF_SENDING_PIN = 'sending_pin' 8 | CONF_READING_PIN = 'reading_pin' 9 | CONF_POS_WT = 'pos_waittime' 10 | CONF_NEG_WT = 'neg_waittime' 11 | # Config String for yaml for the output class 12 | CONF_DALI_HUB = "DALI_Hub" 13 | 14 | # define component namespace and class name for esphome 15 | DALI_ns = cg.esphome_ns.namespace('Dali_Hub_ns') 16 | DALI = DALI_ns.class_('Dali_Hub', cg.Component) 17 | 18 | # Config schema for the usage in the device yaml 19 | CONFIG_SCHEMA = cv.Schema({ 20 | cv.GenerateID(): cv.declare_id(DALI), # Declare ID of this component 21 | cv.Required(CONF_SENDING_PIN): pins.gpio_output_pin_schema, # Get Pin (predefined as output) 22 | cv.Optional(CONF_READING_PIN): pins.gpio_input_pin_schema, # Get Pin (predefined as output) 23 | cv.Optional(CONF_POS_WT): cv.int_range(min=0, max=1000), # Config Sending Pin positive Waittime 24 | cv.Optional(CONF_NEG_WT): cv.int_range(min=0, max=1000), # Config Sending Pin negative Waittime 25 | }).extend(cv.COMPONENT_SCHEMA) 26 | 27 | # code for connecting esphome to the cpp class 28 | # has to be async 29 | async def to_code(config): 30 | # Registration of the component 31 | var = cg.new_Pvariable(config[CONF_ID]) 32 | await cg.register_component(var, config) 33 | 34 | # set sending pin 35 | pin = await cg.gpio_pin_expression(config[CONF_SENDING_PIN]) # get config of yaml 36 | cg.add(var.set_sending_pin(pin)) # set pin in cpp (set_sending_pin is the function in cpp) 37 | # set reading pin 38 | if CONF_READING_PIN in config: 39 | pin2 = await cg.gpio_pin_expression(config[CONF_SENDING_PIN]) 40 | cg.add(var.set_reading_pin(pin2)) 41 | 42 | # set config for sending 43 | if CONF_POS_WT in config: 44 | cg.add(var.set_PosWaittime_us(config[CONF_POS_WT])) 45 | if CONF_NEG_WT in config: 46 | cg.add(var.set_NegWaittime_us(config[CONF_NEG_WT])) -------------------------------------------------------------------------------- /dali/dali.cpp: -------------------------------------------------------------------------------- 1 | #include "esphome/core/log.h" 2 | #include "dali.h" 3 | 4 | namespace esphome { 5 | namespace Dali_Hub_ns { 6 | 7 | static const char *TAG = "dali_hub.component"; 8 | 9 | void Dali_Hub::setup() { 10 | ESP_LOGD(TAG, "Hallooo"); 11 | } 12 | 13 | void Dali_Hub::loop() { 14 | 15 | } 16 | 17 | void Dali_Hub::testParent(){ 18 | ESP_LOGD(TAG, "Hallooo from output!"); 19 | } 20 | void Dali_Hub::testParent(float brightness){ 21 | ESP_LOGD(TAG, "Test! Brightness: %f", brightness); 22 | } 23 | 24 | 25 | 26 | void Dali_Hub::SendBrightness(int address, float brightness){ 27 | int DAPC = calcDAPC_(brightness*100); 28 | sendForwardFrame_(address - 1, DAPC); 29 | } 30 | 31 | void Dali_Hub::dump_config(){ 32 | ESP_LOGCONFIG(TAG, "Empty component"); 33 | LOG_PIN("_sending_pin : ", this->sending_pin_); 34 | } 35 | 36 | 37 | // --- --- --- --- --- 38 | // Sending functions 39 | void Dali_Hub::sendForwardFrame_(int address, int data) 40 | { 41 | bool iBit; 42 | //--- Startbit 43 | sendStartBit_(); 44 | //--- Addresse 45 | for (int i = 7; i >= 0; i--) 46 | { 47 | iBit = bitRead_(address, i); 48 | sendBit_(iBit); 49 | } 50 | 51 | //--- Data 52 | for (int i = 7; i >= 0; i--) 53 | { 54 | iBit = bitRead_(data, i); 55 | sendBit_(iBit); 56 | } 57 | //--- Stopbits 58 | sendStopBit_(); // send stop bit 59 | waitTime_us_(10000); // wait additional time 60 | } 61 | 62 | // implementation of bitRead (cause i dont find the arduino version) 63 | bool Dali_Hub::bitRead_(int value, unsigned int i) 64 | { 65 | 66 | int shift = value >> i; 67 | int erg = shift & 0x01; 68 | 69 | if(erg > 0) 70 | return true; 71 | return false; 72 | } 73 | 74 | // --- --- --- --- --- 75 | // Sending functions 76 | // --- --- --- --- --- 77 | 78 | void Dali_Hub::sendStartBit_() { 79 | sendBit_(true); 80 | } 81 | 82 | void Dali_Hub::sendStopBit_() { 83 | sendNegSlope_(); 84 | waitTime_us_(2000); 85 | } 86 | 87 | // Do Manchester Bit 88 | void Dali_Hub::sendBit_(bool sendBit) { 89 | if (sendBit == true) 90 | { 91 | sendPosSlope_(); 92 | sendNegSlope_(); 93 | } 94 | else 95 | { 96 | sendNegSlope_(); 97 | sendPosSlope_(); 98 | } 99 | } 100 | // send positiv half Slope 101 | void Dali_Hub::sendPosSlope_() { 102 | sending_pin_->digital_write(true); 103 | waitTime_us_(waitTime_PosSlope_us_); 104 | } 105 | // send negativ half Slope 106 | void Dali_Hub::sendNegSlope_() { 107 | sending_pin_->digital_write(false); 108 | waitTime_us_(waitTime_NegSlope_us_); 109 | } 110 | // --- --- --- --- --- 111 | // Waittime for DALI Sending stuff (Blocking other tasks for timing) 112 | void Dali_Hub::waitTime_us_(unsigned int waittime_us) 113 | { 114 | int i = 0; 115 | unsigned long now_time = micros(); 116 | while (micros() < now_time + waittime_us) 117 | { 118 | i++; // do dumb stuff 119 | } 120 | } 121 | 122 | 123 | 124 | //--- -------------------------------------------------------------------------------------------- 125 | //--- 126 | int Dali_Hub::calcDAPC_(double percent) 127 | { 128 | //--- 129 | double c = 0; 130 | for (int i = 0; i < 255; i++) 131 | { 132 | //--- calc differenz 133 | c = _DALI_DIMMINGCURVE_PERCENT[i] - percent; 134 | if (c >= 0) 135 | { 136 | return i; 137 | } 138 | } 139 | return 254; 140 | } 141 | //--- -------------------------------------------------------------------------------------------- 142 | //--- 143 | double Dali_Hub::calcPercent_(int DAPC) 144 | { 145 | //--- 146 | return _DALI_DIMMINGCURVE_PERCENT[DAPC]; 147 | } 148 | 149 | 150 | 151 | } // namespace dali_hub 152 | } // namespace esphome -------------------------------------------------------------------------------- /dali/dali.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "esphome/core/component.h" 3 | #include "esphome/core/gpio.h" 4 | #include "esphome/core/hal.h" 5 | 6 | #include "DALI_DAPC_VALUES.h" 7 | 8 | namespace esphome { 9 | namespace Dali_Hub_ns { 10 | 11 | class Dali_Hub : public Component { 12 | 13 | public: 14 | void setup() override; 15 | void loop() override; 16 | void dump_config() override; 17 | //--- Setup functions 18 | void set_sending_pin(GPIOPin *sending_pin) { this->sending_pin_ = sending_pin; } 19 | void set_reading_pin(GPIOPin *reading_pin) { this->reading_pin_ = reading_pin; } 20 | 21 | void set_PosWaittime_us(int posWaittime) { this->waitTime_PosSlope_us_ = posWaittime; } 22 | void set_NegWaittime_us(int negWaittime) { this->waitTime_NegSlope_us_ = negWaittime; } 23 | //--- Interface function for the output class 24 | void testParent(); 25 | void testParent(float brightness); 26 | void sendCommand(int address, int data); 27 | void sendFadingParam(int address, int faderate, int fadetime); 28 | void SendBrightness(int address, float brightness); 29 | 30 | protected: 31 | //--- Defined GPIO Pins 32 | GPIOPin *sending_pin_; 33 | GPIOPin *reading_pin_; 34 | 35 | 36 | bool sendBit = 0; // testing 37 | long last = 0; // testing 38 | 39 | int waitTime_PosSlope_us_ = 416; 40 | int waitTime_NegSlope_us_ = 416; 41 | 42 | 43 | int calcDAPC_(double percent); 44 | double calcPercent_(int DAPC); 45 | 46 | // Sending Frame 47 | void sendForwardFrame_(int address, int data); 48 | bool bitRead_(int value, unsigned int i); 49 | 50 | // Sending functions 51 | void sendStartBit_(); 52 | void sendStopBit_(); 53 | void sendBit_(bool sendBit); 54 | void sendPosSlope_(); 55 | void sendNegSlope_(); 56 | 57 | void waitTime_us_(unsigned int waittime_us); 58 | }; 59 | 60 | 61 | } // namespace Dali_Hub 62 | } // namespace esphome -------------------------------------------------------------------------------- /dali/output/__init__.py: -------------------------------------------------------------------------------- 1 | import esphome.codegen as cg 2 | import esphome.config_validation as cv 3 | from esphome.components import output 4 | from esphome.const import CONF_ID 5 | 6 | # --- import namespace from dali_hub (doesnt work) 7 | from .. import DALI_ns, DALI, CONF_DALI_HUB 8 | 9 | #DEPENDENCIES = ["dali_hub"] 10 | 11 | # Names for inputs 12 | CONF_ADDRESS = 'address' 13 | CONF_GROUP = 'group' 14 | CONF_FADERATE = 'faderate' 15 | CONF_FADETIME = 'faderate' 16 | 17 | # Setup namesspace for class 18 | #dali_output_ns = cg.esphome_ns.namespace('Dali_Output_ns') 19 | DALI_Output = DALI_ns.class_('Dali_Output', output.FloatOutput, cg.Component) 20 | 21 | # Setup Config Schema for yaml 22 | CONFIG_SCHEMA = output.FLOAT_OUTPUT_SCHEMA.extend({ 23 | cv.Required(CONF_ID): cv.declare_id(DALI_Output), 24 | cv.GenerateID(CONF_DALI_HUB): cv.use_id(DALI), 25 | cv.Optional(CONF_ADDRESS): cv.int_range(min=0, max=63), 26 | cv.Optional(CONF_GROUP): cv.int_range(min=0, max=15), 27 | cv.Optional(CONF_FADERATE): cv.int_range(min=0, max=15), 28 | cv.Optional(CONF_FADETIME): cv.int_range(min=0, max=15), 29 | }).extend(cv.COMPONENT_SCHEMA) 30 | 31 | 32 | 33 | async def to_code(config): 34 | var = cg.new_Pvariable(config[CONF_ID]) 35 | await output.register_output(var, config) 36 | await cg.register_component(var, config) 37 | 38 | # Set Parent 39 | parent = await cg.get_variable(config[CONF_DALI_HUB]) 40 | cg.add(var.set_parent(parent)) 41 | 42 | # Address & group 43 | if CONF_ADDRESS in config: 44 | cg.add(var.set_Address(config[CONF_ADDRESS])) 45 | if CONF_GROUP in config: 46 | cg.add(var.set_Group(config[CONF_GROUP])) 47 | # Faderate & fadetime 48 | if CONF_FADERATE in config: 49 | cg.add(var.set_FadeRate(config[CONF_FADERATE])) 50 | if CONF_FADETIME in config: 51 | cg.add(var.set_FadeTime(config[CONF_FADETIME])) 52 | -------------------------------------------------------------------------------- /dali/output/dali_output.cpp: -------------------------------------------------------------------------------- 1 | #include "esphome/core/log.h" 2 | #include "dali_output.h" 3 | 4 | namespace esphome { 5 | namespace Dali_Hub_ns { 6 | 7 | static const char *TAG = "dali_output.output"; 8 | 9 | void Dali_Output::setup(){ 10 | 11 | } 12 | 13 | void Dali_Output::loop() { 14 | 15 | if(updateOutput_ == true){ 16 | if(millis() > lasttime_ms_ + updatetime_ms_){ 17 | ESP_LOGD(TAG, "Sending Brightness: %f", state_); 18 | updateOutput_ = false; 19 | this->parent_->SendBrightness(DALI_ADDRESS_, state_); 20 | } 21 | } 22 | } 23 | 24 | 25 | void Dali_Output::dump_config() { 26 | ESP_LOGCONFIG(TAG, "Empty custom float output"); 27 | } 28 | 29 | //--- Handle for light component 30 | void Dali_Output::write_state(float state){ 31 | //ESP_LOGD(TAG, "state: %f", state); 32 | state_ = state; 33 | updateOutput_ = true; 34 | lasttime_ms_ = millis(); 35 | } 36 | 37 | 38 | 39 | 40 | } //namespace Dali_Hub_ns 41 | } //namespace esphome 42 | 43 | -------------------------------------------------------------------------------- /dali/output/dali_output.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "esphome/core/component.h" 4 | #include "esphome/components/output/float_output.h" 5 | #include "../dali.h" 6 | 7 | 8 | namespace esphome { 9 | namespace Dali_Hub_ns { 10 | 11 | class Dali_Output : public output::FloatOutput, public Component { 12 | public: 13 | void setup() override; 14 | void loop() override; 15 | void write_state(float state) override; 16 | void dump_config() override; 17 | 18 | void set_parent(Dali_Hub *parent) { parent_ = parent; } 19 | 20 | void set_Address(int address) { DALI_ADDRESS_ = (address << 1) + 1; } 21 | void set_Group(int group) { DALI_GROUP_ = (group * 2) + 1 + 0x80; } 22 | void set_FadeTime(int FadeTime) { DALI_FadeTime_ = FadeTime; } 23 | void set_FadeRate(int FadeRate) { DALI_FadeRate_ = FadeRate; } 24 | 25 | protected: 26 | //--- Parent 27 | Dali_Hub *parent_; 28 | 29 | //--- inputs 30 | int DALI_ADDRESS_ = 0xFF; 31 | int DALI_GROUP_ = 0x00; 32 | 33 | int DALI_FadeTime_ = 1; 34 | int DALI_FadeRate_ = 2; 35 | 36 | //--- internal stuff 37 | float state_ = 0; 38 | bool updateOutput_ = false; 39 | 40 | long lasttime_ms_ = 0; 41 | long updatetime_ms_ = 15; 42 | }; 43 | 44 | 45 | } //namespace Dali_Hub_ns 46 | } //namespace esphome -------------------------------------------------------------------------------- /schematic.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OdinReiter/ESPHome_DALI-Interface/af866300d21e57a38b6d84cd6ba4a3368cf1e1d7/schematic.PNG --------------------------------------------------------------------------------