Advertisement
adorobis

optolink esphome

Nov 19th, 2023 (edited)
1,369
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 14.20 KB | None | 0 0
  1. substitutions:
  2.   device_name: viessmann
  3.   device_description: "Viessmann Optolink"
  4.   update_interval_global: 60s
  5.   update_interval_short: 15s
  6.   update_interval_long: 600s
  7.  
  8. esphome:
  9.   name: '${device_name}'
  10.   friendly_name: Viessmann
  11.   platform: ESP32
  12.   board: esp32dev
  13.  
  14. # Enable logging
  15. logger:
  16.   hardware_uart: UART0
  17.   baud_rate: 0
  18.   level: debug
  19.  
  20. # Enable Home Assistant API
  21. api:
  22. ota:
  23. wifi:
  24.   ssid: "***"
  25.   password: "***"
  26.  
  27.   manual_ip:
  28.     static_ip: 10.144.1.243
  29.     gateway: 10.144.1.1
  30.     subnet: 255.255.255.0
  31.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  32.   ap:
  33.     ssid: "Viessmann Fallback Hotspot"
  34.     password: "***"
  35.  
  36. captive_portal:
  37.  
  38. external_components:
  39.   - source: github://pr#4453
  40.     components: [ optolink ]
  41.  
  42. optolink:
  43.   protocol: KW
  44. #  device_info: Device Info
  45. #  state: Component state
  46.   rx_pin: 16
  47.   tx_pin: 17
  48.  
  49. button:
  50.   - platform: restart
  51.     name: "Restart"
  52.  
  53. text_sensor:
  54.   - platform: version
  55.     hide_timestamp: true
  56.     name: "ESPHome Version"
  57.  
  58.   - platform: wifi_info
  59.     ip_address:
  60.       name: "IP Address"
  61.       icon: mdi:wifi
  62.     ssid:
  63.       name: "Connected SSID"
  64.       icon: mdi:wifi-strength-2
  65.  
  66.  
  67.   - platform: optolink
  68.     type: DEVICE_INFO
  69.     name: Device Info
  70.     update_interval: 969s
  71.   - platform: optolink
  72.     type: STATE_INFO
  73.     name: Component state
  74.     update_interval: 459s
  75.    
  76.   - platform: optolink
  77.     name: Current Operating Mode A1
  78.     address: 0x2500
  79.     bytes: 2
  80.     update_interval: 128s
  81.     type: MAP
  82.     filters:
  83.       - map:
  84.        - "2 -> off"           # when in standby or dhw modes
  85.         - "258 -> reduced"     # when in reduced (night) or forcedReduced modes or in Eco preset
  86.         - "514 -> comfort"     # when in day heating or in Comfort preset
  87.         - "770 -> normal"      # when in forcedNormal type
  88.   - platform: optolink
  89.     name: Current Operating Mode M2
  90.     address: 0x3500
  91.     bytes: 2
  92.     update_interval: 130s
  93.     type: MAP
  94.     filters:
  95.       - map:
  96.        - "2 -> off"
  97.         - "258 -> reduced"
  98.         - "514 -> comfort"
  99.         - "770 -> normal"
  100.  
  101.  # errors : 0:7507, 1:7510, 2:7519, 3:7522, 4:752B, 5:7534, 6:753D, 7:7546, 8:754F, 9:7558
  102.   - platform: optolink
  103.     name: Error code 1
  104.     address: 0x7507
  105.     bytes: 1
  106.     update_interval: 591s
  107.     icon: mdi:note-text-outline
  108.     type: MAP
  109.     filters:
  110.       - map:
  111.        - "0 -> regular operation"
  112.         - "15 -> 0 F : Przeprowadzić konserwację. Po konserwacji ustawić kodowanie 24:0"
  113.        - "16 -> 1 0 : Zwarcie czujnika temperatury zewnętrznej"
  114.        - "231 -> E 7 : Usterka palnika"
  115.        - "232 -> E 8 : Usterka palnika"
  116.        - "238 -> E E : Blokada palnika"
  117.  - platform: optolink
  118.    name: Error code 2
  119.    address: 0x7510
  120.    bytes: 1
  121.    update_interval: 589s
  122.    icon: mdi:note-text-outline
  123.    type: MAP
  124.    filters:
  125.      - map:
  126.        - "0 -> regular operation"
  127.        - "15 -> 0 F : Przeprowadzić konserwację. Po konserwacji ustawić kodowanie 24:0"
  128.        - "16 -> 1 0 : Zwarcie czujnika temperatury zewnętrznej"
  129.        - "231 -> E 7 : Usterka palnika"
  130.        - "232 -> E 8 : Usterka palnika"
  131.        - "238 -> E E : Blokada palnika"
  132. #  - platform: optolink
  133. #    name: Error code 3
  134. #    address: 0x7519
  135. #    bytes: 1
  136. #    update_interval: 587s
  137. #    icon: mdi:note-text-outline
  138. #    filters:
  139. #      - map:
  140. #        - "0 -> regular operation"
  141. #        - "15 -> 0 F : Przeprowadzić konserwację. Po konserwacji ustawić kodowanie 24:0"
  142. #        - "16 -> 1 0 : Zwarcie czujnika temperatury zewnętrznej"
  143. #        - "231 -> E 7 : Usterka palnika"
  144. #        - "232 -> E 8 : Usterka palnika"
  145. #        - "238 -> E E : Blokada palnika"
  146.      
  147. binary_sensor:
  148.  - platform: optolink
  149.    name: Burner
  150.    address: 0x55D3
  151.    update_interval: 52s
  152.    device_class: heat
  153.    
  154.  - platform: optolink
  155.    name: DHW Charging
  156.    address: 0x650A
  157.    update_interval: 50s
  158.    device_class: heat
  159.  
  160. #  - platform: optolink
  161. #    name: Storage Charging Pump
  162. #    address: 0x6513
  163. #    update_interval: 52s
  164. #    device_class: power
  165.    
  166.  - platform: optolink
  167.    name: Circulation Pump
  168.    address: 0x6515
  169.    update_interval: 54s
  170.    device_class: power
  171.  
  172.  - platform: optolink
  173.    name: Heating circuit pump A1M1
  174.    address: 0x2906
  175.    update_interval: 56s
  176.    device_class: power
  177.  
  178.  - platform: optolink
  179.    name: Heating circuit pump M2
  180.    address: 0x3906
  181.    update_interval: 64s
  182.    device_class: power
  183.  
  184.  - platform: optolink
  185.    name: Frost protection
  186.    address: 0x27A4
  187.    update_interval: 593s
  188.    device_class: cold
  189.  
  190. number:
  191. #  - platform: optolink
  192. #    name: Time limit party and operating mode switching
  193. #    address: 0x27F2
  194. #    bytes: 1
  195. #    min_value: 0
  196. #    max_value: 100
  197. #    step: 1
  198. #    type: box
  199. #    update_interval: 595s
  200.  
  201.  - platform: optolink
  202.    name: Room Temperature Setpoint
  203.    unit_of_measurement: °C
  204.    address: 0x2306
  205.    bytes: 1
  206.    min_value: 18
  207.    max_value: 27
  208.    step: 1
  209.    icon: "mdi:home-thermometer"
  210.    device_class: temperature
  211.    update_interval: 315s
  212.  
  213.  - platform: optolink
  214.    name: Reduced Room Temperature Setpoint
  215.    unit_of_measurement: °C
  216.    address: 0x2307
  217.    bytes: 1
  218.    min_value: 10
  219.    max_value: 20
  220.    step: 1
  221.    icon: "mdi:home-thermometer"
  222.    device_class: temperature
  223.    update_interval: 597s
  224.  
  225.  - platform: optolink
  226.    name: Party Temperature Setpoint
  227.    unit_of_measurement: °C
  228.    address: 0x2308
  229.    bytes: 1
  230.    min_value: 18
  231.    max_value: 27
  232.    step: 1
  233.    icon: "mdi:home-thermometer"
  234.    device_class: temperature
  235.    update_interval: 599s
  236.  
  237.  - platform: optolink
  238.    name: Floor Temperature Setpoint
  239.    unit_of_measurement: °C
  240.    address: 0x3306
  241.    bytes: 1
  242.    min_value: 18
  243.    max_value: 27
  244.    step: 1
  245.    icon: "mdi:home-thermometer"
  246.    device_class: temperature
  247.    update_interval: 280s
  248.  
  249.  - platform: optolink
  250.    name: Reduced Floor Temperature Setpoint
  251.    unit_of_measurement: °C
  252.    address: 0x3307
  253.    bytes: 1
  254.    min_value: 10
  255.    max_value: 20
  256.    step: 1
  257.    icon: "mdi:home-thermometer"
  258.    device_class: temperature
  259.    update_interval: 591s
  260.  
  261.  - platform: optolink
  262.    name: Party Floor Temperature Setpoint
  263.    unit_of_measurement: °C
  264.    address: 0x3308
  265.    bytes: 1
  266.    min_value: 18
  267.    max_value: 27
  268.    step: 1
  269.    icon: "mdi:home-thermometer"
  270.    device_class: temperature
  271.    update_interval: 593s
  272.  
  273.  - platform: optolink
  274.    name: Heating curve level
  275.    address: 0x27D4
  276.    bytes: 1
  277.    min_value: 0
  278.    max_value: 10
  279.    step: 1
  280.    mode: box
  281.    update_interval: 601s
  282.  
  283.  - platform: optolink
  284.    name: Heating curve slope
  285.    address: 0x27D3
  286.    bytes: 1
  287.    min_value: 0
  288.    max_value: 3
  289.    step: 0.1
  290.    mode: box
  291.    div_ratio: 10
  292.    update_interval: 603s
  293.    
  294.  - platform: optolink
  295.    name: Floor Heating curve level
  296.    address: 0x37D4
  297.    bytes: 1
  298.    min_value: 0
  299.    max_value: 10
  300.    step: 1
  301.    mode: box
  302.    update_interval: ${update_interval_long}
  303.  
  304.  - platform: optolink
  305.    name: Floor Heating curve slope
  306.    address: 0x37D3
  307.    bytes: 1
  308.    min_value: 0
  309.    max_value: 3
  310.    step: 0.1
  311.    mode: box
  312.    div_ratio: 10
  313.    update_interval: 607s
  314.  
  315.  - platform: optolink
  316.    name: DHW Temperature Setpoint
  317.    unit_of_measurement: °C
  318.    address: 0x6300
  319.    bytes: 1
  320.    min_value: 30
  321.    max_value: 60
  322.    step: 1
  323.    icon: "mdi:water-boiler"
  324.    device_class: temperature
  325.    update_interval: 605s
  326.  
  327. sensor:
  328.  - platform: wifi_signal
  329.    name: "WiFi Signal"
  330.    id: '${device_name}_wifi_signal'
  331.    update_interval: ${update_interval_global}
  332.  
  333.  - platform: optolink
  334.    type: QUEUE_SIZE
  335.    name: Optolink Queue Size
  336.    icon: mdi:queue-first-in-last-out
  337.    entity_category: diagnostic
  338.    update_interval: 5s
  339.  
  340.  - platform: optolink
  341.    name: Target flow temperature A1M1
  342.    address: 0x2544
  343.    bytes: 2
  344.    unit_of_measurement: °C
  345.    device_class: temperature
  346.    div_ratio: 10
  347.    accuracy_decimals: 1
  348.    update_interval: 330s
  349.    state_class: measurement
  350.    force_update: true
  351.  
  352.  - platform: optolink
  353.    name: Target flow temperature M2
  354.    address: 0x3544
  355.    bytes: 2
  356.    unit_of_measurement: °C
  357.    device_class: temperature
  358.    div_ratio: 10
  359.    accuracy_decimals: 1
  360.    update_interval: 332s
  361.    state_class: measurement
  362.    force_update: true
  363.  
  364. #  - platform: optolink
  365. #    name: Return temperature
  366. #    address: 0x0816
  367. #    bytes: 2
  368. #    div_ratio: 1
  369. #    filters:
  370. #      multiply: 0.1
  371. #    accuracy_decimals: 1
  372. #    unit_of_measurement: °C
  373. #    device_class: temperature
  374. #    update_interval: 62s
  375. #    state_class: measurement
  376. #    force_update: true
  377.  
  378.  - platform: optolink
  379.    name: Flow temperature M2
  380.    address: 0x3900
  381.    bytes: 2
  382.    div_ratio: 1
  383.    filters:
  384.      multiply: 0.1
  385.    accuracy_decimals: 1
  386.    unit_of_measurement: °C
  387.    device_class: temperature
  388.    update_interval: 48s
  389.    state_class: measurement
  390.    force_update: true
  391.  
  392. #  - platform: optolink
  393. #    name: Exhaust temperature
  394. #    address: 0x0808
  395. #    bytes: 2
  396. #    div_ratio: 1
  397. #    filters:
  398. #      multiply: 0.1
  399. #    accuracy_decimals: 1
  400. #    unit_of_measurement: °C
  401. #    device_class: temperature
  402. #    update_interval: 68s
  403. #    state_class: measurement
  404. #    force_update: true
  405.  
  406.  - platform: optolink
  407.    name: Storage temperature
  408.    address: 0x0812
  409.    bytes: 2
  410.    div_ratio: 1
  411.    filters:
  412.      multiply: 0.1
  413.    accuracy_decimals: 1
  414.    unit_of_measurement: °C
  415.    device_class: temperature
  416.    update_interval: 175s
  417.    state_class: measurement
  418.    force_update: true
  419.  
  420.  - platform: optolink
  421.    name: Outside Temperature
  422.    address: 0x0800
  423.    #address: 0x5527
  424.    bytes: 2
  425.    unit_of_measurement: °C
  426.    device_class: temperature
  427.    div_ratio: 10
  428.    accuracy_decimals: 1
  429.    update_interval: 611s
  430.    state_class: measurement
  431.    force_update: true
  432.  
  433.  - platform: optolink
  434.    name: Boiler Temperature
  435.    address: 0x0802
  436.    bytes: 2
  437.    div_ratio: 10
  438.    accuracy_decimals: 1
  439.    unit_of_measurement: °C
  440.    device_class: temperature
  441.    update_interval: 28s
  442.    state_class: measurement
  443.    force_update: true
  444.  
  445.  - platform: optolink
  446.    name: Room temperature
  447.    address: 0x0896
  448.    bytes: 2
  449.    div_ratio: 1
  450.    unit_of_measurement: °C
  451.    device_class: temperature
  452.    accuracy_decimals: 1
  453.    filters:
  454.      multiply: 0.1
  455.    update_interval: 607s
  456.    state_class: measurement
  457.    force_update: true
  458.  
  459.  - platform: optolink
  460.    name: Operating Hours
  461.    address: 0x08A7
  462.    bytes: 4
  463.    device_class: duration
  464.    unit_of_measurement: h
  465.    state_class: total_increasing
  466.    icon: mdi:counter
  467.    update_interval: 909s
  468.    filters:
  469.      - lambda: return x / 3600;
  470.    accuracy_decimals: 1
  471.    force_update: true
  472.  
  473.  - platform: optolink
  474.    name: Burner Starts
  475.    address: 0x088A
  476.    bytes: 4
  477.    update_interval: 911s
  478.    state_class: total_increasing
  479.    icon: mdi:counter
  480.    force_update: true
  481.  
  482.  - platform: optolink
  483.    name: Burner Performance
  484.    address: 0xA38F
  485.    bytes: 1
  486.    filters:
  487.      multiply: 0.5
  488.    update_interval: ${update_interval_short}
  489.    unit_of_measurement: "%"
  490.     state_class: measurement
  491.     icon: mdi:percent
  492.     force_update: true
  493.  
  494. select:
  495.   - platform: optolink
  496.     name: Operation mode
  497.     address: 0x2323
  498.     bytes: 1
  499.     map:
  500.      - "0 -> standby"
  501.       - "1 -> dhw"
  502.       - "2 -> dhwAndHeating"
  503.       - "3 -> forcedReduced"
  504.       - "4 -> forcedNormal"
  505.     update_interval: 68s
  506.    
  507.   - platform: optolink
  508.     name: Operation mode M2
  509.     address: 0x3323
  510.     bytes: 1
  511.     map:
  512.      - "0 -> standby"
  513.       - "1 -> dhw"
  514.       - "2 -> dhwAndHeating"
  515.       - "3 -> forcedReduced"
  516.       - "4 -> forcedNormal"
  517.     update_interval: 123s
  518.  
  519.   - platform: template
  520.     name: "Preset"
  521.     id: preset
  522.     update_interval: 10s
  523.     options:
  524.      - "off"
  525.       - "eco"
  526.       - "comfort"
  527.     set_action:
  528.       - lambda: |-
  529.           if (x == "off") {
  530.             id(economy_mode).turn_off();
  531.             id(party_mode).turn_off();
  532.           } else if (x == "eco"){
  533.             id(economy_mode).turn_on();
  534.             id(party_mode).turn_off();
  535.           } else if (x == "comfort"){
  536.             id(economy_mode).turn_off();
  537.             id(party_mode).turn_on();
  538.           }
  539.     lambda: !lambda |-
  540.       if (not(id(economy_mode).state) and not(id(party_mode).state)) {
  541.         return (std::string) "off";
  542.       } else if (id(economy_mode).state) {
  543.           return (std::string) "eco";
  544.       } else if (id(party_mode).state) {
  545.           return (std::string) "comfort";
  546.       } else {
  547.         return (std::string) "off";
  548.       }
  549.      
  550.   - platform: template
  551.     name: "Preset M2"
  552.     id: preset_m2
  553.     update_interval: 10s
  554.     options:
  555.      - "off"
  556.       - "eco"
  557.       - "comfort"
  558.     set_action:
  559.       - lambda: |-
  560.           if (x == "off") {
  561.             id(economy_mode_m2).turn_off();
  562.             id(party_mode_m2).turn_off();
  563.           } else if (x == "eco"){
  564.             id(economy_mode_m2).turn_on();
  565.             id(party_mode_m2).turn_off();
  566.           } else if (x == "comfort"){
  567.             id(economy_mode_m2).turn_off();
  568.             id(party_mode_m2).turn_on();
  569.           }
  570.     lambda: !lambda |-
  571.       if (not(id(economy_mode_m2).state) and not(id(party_mode_m2).state)) {
  572.         return (std::string) "off";
  573.       } else if (id(economy_mode_m2).state) {
  574.           return (std::string) "eco";
  575.       } else if (id(party_mode_m2).state) {
  576.           return (std::string) "comfort";
  577.       } else {
  578.         return (std::string) "off";
  579.       }
  580.      
  581. switch:
  582.   - platform: optolink
  583.     name: Economy mode
  584.     id: economy_mode
  585.     address: 0x2302
  586.     icon: mdi:sprout-outline
  587.     update_interval: 123s
  588.  
  589.   - platform: optolink
  590.     name: Party mode
  591.     id: party_mode
  592.     address: 0x2303
  593.     icon: mdi:glass-cocktail
  594.     update_interval: 72s
  595.  
  596.   - platform: optolink
  597.     name: Economy mode M2
  598.     id: economy_mode_m2
  599.     address: 0x3302
  600.     icon: mdi:sprout-outline
  601.     update_interval: 303s
  602.  
  603.   - platform: optolink
  604.     name: Party mode M2
  605.     id: party_mode_m2
  606.     address: 0x3303
  607.     icon: mdi:glass-cocktail
  608.     update_interval: 307s
  609.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement