0 medlemmar och 2 gäster tittar på detta ämne.
[font=courier]uart: - id: uart_display tx_pin: number: GPIO19 inverted: true rx_pin: number: GPIO18 inverted: true baud_rate: 2400 parity: EVEN stop_bits: 1 data_bits: 8 debug: direction: RX dummy_receiver: true after: delimiter: "\r\n" sequence: - uart.write: id: uart_vp data: !lambda return bytes ; - lambda: |- ESP_LOGD("custom", "Controller:"); UARTDebug::log_string(direction, bytes); - id: uart_vp tx_pin: number: GPIO23 inverted: true rx_pin: number: GPIO22 inverted: true baud_rate: 2400 parity: EVEN stop_bits: 1 data_bits: 8 debug: direction: RX dummy_receiver: true after: delimiter: "\r\n" sequence: - uart.write: id: uart_display data: !lambda return bytes ; - lambda: |- ESP_LOGD("custom", "Controller:"); UARTDebug::log_string(direction, bytes);[/font]
Tjena! Fantastisk tråd. Skulle också vilja få in min ecologic V3 I home Assistant! Finns det ett schema över hur jag ska koppla in mig på kabeln med hjälp av esp32 och 2 max3232 har kollat på https://github.com/mercix/CTC2ESP men vet inte hur jag ska koppla allt😁 /Calle
uart: - id: uart_display tx_pin: number: GPIO19 inverted: true rx_pin: number: GPIO18 inverted: true baud_rate: 2400 parity: EVEN stop_bits: 1 data_bits: 8 debug: direction: RX dummy_receiver: true after: delimiter: "\r\n" sequence: - uart.write: id: uart_vp data: !lambda return bytes ; #data: [0x41, 0xf7, 0xfe, 0xf7, 0xfa, 0xfe, 0xff, 0xff, 0xc2] - lambda: |- ESP_LOGD("custom", "from disp"); UARTDebug::log_int(direction, bytes, ','); // Log the message as int. UARTDebug::log_hex(direction, bytes, ','); // Log the message in hex. UARTDebug::log_binary(direction, bytes, ','); // Log the message in hex. ESP_LOGD("custom", "Bytes size: %d", bytes.size()); // Log how many bytes in the message. if (direction == UART_DIRECTION_RX) // Check message direction (Change to TX if required) { if (bytes.size() == 10) // Check number of bytes { id(bin1).publish_state((bytes[1] >> 6) & 1); // Publish results to a sensor. id(bin2).publish_state((bytes[1] >> 4) & 1); // Publish results to a sensor. id(bin3).publish_state((bytes[1] >> 7) & 1); // Publish results to a sensor. id(bin4).publish_state((bytes[5] >> 0) & 1); // Publish results to a sensor. } } - id: uart_vp tx_pin: number: GPIO15 inverted: true rx_pin: number: GPIO22 inverted: true baud_rate: 2400 parity: EVEN stop_bits: 1 data_bits: 8 debug: direction: RX dummy_receiver: true after: delimiter: "\r\n" sequence: - uart.write: id: uart_display data: !lambda return bytes ; - lambda: |- //ESP_LOGD("custom", "from vp"); //UARTDebug::log_int(direction, bytes, ','); // Log the message as int. //UARTDebug::log_hex(direction, bytes, ','); // Log the message in hex. //ESP_LOGD("custom", "Bytes size: %d", bytes.size()); // Log how many bytes in the message. if (direction == UART_DIRECTION_RX) // Check message direction (Change to TX if required) { if (bytes.size() == 22) // Check number of bytes { id(sensor1).publish_state(bytes[1]); // Publish results to a sensor. id(sensor2).publish_state(bytes[2]-40); // Publish results to a sensor. id(sensor3).publish_state(bytes[3]+(bytes[4]/100)); // Publish results to a sensor. id(sensor4).publish_state(bytes[5]); // Publish results to a sensor. //id(sensor5).publish_state(bytes[6]); // Publish results to a sensor. //id(sensor6).publish_state(bytes[7]); // Publish results to a sensor. //id(sensor7).publish_state(bytes[8]); // na //id(sensor8).publish_state(bytes[9]); // na id(sensor9).publish_state(bytes[10]); // Publish results to a sensor. //id(sensor10).publish_state(bytes[11]); // na //id(sensor11).publish_state(bytes[12]); // na id(sensor12).publish_state(bytes[13]); // strömuttag i A //id(sensor13).publish_state(bytes[14]); // na id(sensor14).publish_state(bytes[15]-40); // Publish results to a sensor. id(sensor15).publish_state(bytes[16]); // Publish results to a sensor. } }sensor: - platform: template name: "framlednings temp" unit_of_measurement: "°C" id: "sensor1" - platform: template name: "ute temp" unit_of_measurement: "°C" id: "sensor2" - platform: template name: "inne temp" unit_of_measurement: "°C" id: "sensor3" - platform: template name: "vp retur temp" unit_of_measurement: "°C" id: "sensor4" - platform: template name: "hetgas temp" unit_of_measurement: "°C" id: "sensor9" - platform: template name: "strömuttag" unit_of_measurement: "A" id: "sensor12" - platform: template name: "ute temp i VP" unit_of_measurement: "°C" id: "sensor14" - platform: template name: "temp VP utgående" unit_of_measurement: "°C" id: "sensor15" - platform: template name: "fläkt låg" unit_of_measurement: "on/off" id: "bin1" - platform: template name: "fläkt hög" unit_of_measurement: "on/off" id: "bin2" - platform: template name: "kompressor" unit_of_measurement: "on/off" id: "bin3" - platform: template name: "radiotorpump" unit_of_measurement: "on/off" id: "bin4"
Fantastiskt spännande det här. Ska testa koden till esp32 och se om jag få ihop det till ecoair 120 (utan eco el/ecologic osv)
Kommunikationen med CTC's utedelar är en strömslinga som liknar ITU-T Rec. V.31 bis (alltså samma slags slinga som användes för kommunikation med gamla fjärrskrift/telexmaskiner). Se gamla trådar, t ex https://www.varmepumpsforum.com/vpforum/index.php?topic=18500.msg414681#msg414681 och https://www.varmepumpsforum.com/vpforum/index.php?topic=34771.0