Advertisement
Dieton

channleChnager.yaml

May 14th, 2024 (edited)
182
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 4.89 KB | Software | 0 0
  1. If your trying to get a remote_transmitter and or remote_receiver device to work and its not working try this
  2.  
  3. 1. hear is all the data:
  4. [0][I][remote.pronto:234]: Received Pronto: data=
  5. [0][I][remote.pronto:236]: 0000 006D 0002 0000 015B 0056 0016 0181 06C3
  6. [0][I][remote.jvc:049]: Received JVC: data=0x00FF
  7. [0][I][remote.lg:054]: Received LG: data=0x00FF6897, nbits=32
  8. [0][I][remote.nec:098]: Received NEC: address=0xFF00, command=0xE916 command_repeats=1
  9. [0][I][remote.pioneer:149]: Received Pioneer: rc_code_X=0x0016
  10. [0][I][remote.pronto:234]: Received Pronto: data=
  11. [0][I][remote.pronto:236]: 0000 006D 0022 0000 015C 00AB 0017 0015 0017 0015 0016 0015 0016 0015 0017 0014 0017 0015 0016 0015 0016 0015 0017 003F 0017 003F 0017 003F 0016 0040 0017 0040 0016 0040 0016 0040 0017 003F 0016 0015 0017 0040 0017 0040 0017 0015
  12. [0][I][remote.pronto:236]: 0018 003F 0016 0015 0016 0015 0017 0015 0017 0040 0016 0015 0017 0014 0016 0040 0016 0015 0016 0040 0017 003F 0017 0040 0016 0181 06C3
  13. [0][W][component:237]: Component remote_receiver took a long time for an operation (65 ms).
  14. [0][W][component:238]: Components should block for at most 30 ms.
  15.  
  16. 2. Take this part of the data
  17. [0][I][remote.pronto:236]: 0000 006D 0022 0000 015C 00AB 0017 0015 0017 0015 0016 0015 0016 0015 0017 0014 0017 0015 0016 0015 0016 0015 0017 003F 0017 003F 0017 003F 0016 0040 0017 0040 0016 0040 0016 0040 0017 003F 0016 0015 0017 0040 0017 0040 0017 0015
  18. [0][I][remote.pronto:236]: 0018 003F 0016 0015 0016 0015 0017 0015 0017 0040 0016 0015 0017 0014 0016 0040 0016 0015 0016 0040 0017 003F 0017 0040 0016 0181 06C3
  19.  
  20. 3. REMOVE THIS!!! 06C3
  21.  
  22. 4. Combine it like this
  23. data: "0000 006D 0022 0000 015C 00AB 0017 0015 0017 0015 0016 0015 0016 0015 0017 0014 0017 0015 0016 0015 0016 0015 0017 003F 0017 003F 0017 003F 0016 0040 0017 0040 0016 0040 0016 0040 0017 003F 0016 0015 0017 0040 0017 0040 0017 0015 0018 003F 0016 0015 0016 0015 0017 0015 0017 0040 0016 0015 0017 0014 0016 0040 0016 0015 0016 0040 0017 003F 0017 0040 0016 0181"
  24.  
  25.  
  26.  
  27. light:
  28.   - platform: monochromatic
  29.     name: "Test Light"
  30.     output: lightBrightRead
  31. output:
  32.   - platform: ledc
  33.     id: debugLED
  34.     pin: 2
  35.   - platform: template
  36.     id: lightBrightRead
  37.     type: float
  38.     write_action:
  39.       - output.set_level:
  40.           id: debugLED
  41.           level: !lambda return state;
  42.       - lambda: id(channel) = state * 100;
  43.       - script.execute: send_channel
  44. switch:
  45.   - platform: gpio
  46.     pin: 0
  47.     id: gpio_enter
  48.   - platform: gpio
  49.     pin: 14
  50.     id: gpio_0
  51.   - platform: gpio
  52.     pin: 15
  53.     id: gpio_1
  54.   - platform: gpio
  55.     pin: 17
  56.     id: gpio_2
  57.   - platform: gpio
  58.     pin: 18
  59.     id: gpio_3
  60.   - platform: gpio
  61.     pin: 19
  62.     id: gpio_4
  63.   - platform: gpio
  64.     pin: 21
  65.     id: gpio_5
  66.   - platform: gpio
  67.     pin: 22
  68.     id: gpio_6
  69.   - platform: gpio
  70.     pin: 23
  71.     id: gpio_7
  72.   - platform: gpio
  73.     pin: 25
  74.     id: gpio_8
  75.   - platform: gpio
  76.     pin: 26
  77.     id: gpio_9
  78. globals:
  79.   - id: my_global_int
  80.     type: int
  81.     restore_value: no
  82.     initial_value: '0'
  83.   - id: channel
  84.     type: int
  85.     restore_value: no
  86.   - id: buttons
  87.     type: 'std::array<switch_::Switch*, 10>'
  88.     restore_value: no
  89.     initial_value: '{ gpio_0, gpio_1, gpio_2, gpio_3, gpio_4, gpio_5, gpio_6, gpio_7, gpio_8, gpio_9 }'
  90.  
  91. script:
  92.   - id: send_channel
  93.     then:
  94.       - if:
  95.           condition:
  96.             lambda: return (id(channel) > 9);
  97.           then:
  98.             - lambda: id(buttons)[channel / 10]->turn_on();
  99.             - delay: 500ms
  100.             - lambda: id(buttons)[channel / 10]->turn_off();
  101.       - delay: 1s
  102.       - lambda: id(buttons)[channel % 10]->turn_on();
  103.       - delay: 500ms
  104.       - lambda: id(buttons)[channel % 10]->turn_off();
  105.       - delay: 1s
  106.       - switch.turn_on: gpio_enter
  107.       - delay: 500ms
  108.       - switch.turn_off: gpio_enter
  109.  
  110. script:
  111.   - id: send_channel
  112.     then:
  113.       - if:
  114.           condition:
  115.             lambda: return (id(channel) > 9);
  116.             Debug.Log("Raw Value" + id(channel)); or print("something") or console.write("something")
  117.             Debug.Log("ones convertion" + id(channel) / 10);
  118.             Debug.Log("tens convertion" + id(channel) % 10);
  119.           then:
  120.             - lambda: id(buttons)[id(channel) / 10]->turn_on();
  121.               Debug.Log("ones button press" + id(channel) % 10);
  122.             - delay: 2s
  123.              Debug.Log("ones delay");
  124.             - lambda: id(buttons)[id(channel) / 10]->turn_off();
  125.               Debug.Log("ones button relece" + id(channel) / 10);
  126.       - delay: 2s
  127.       - lambda: id(buttons)[id(channel) % 10]->turn_on();
  128.         Debug.Log("tens button press" + id(channel) % 10);
  129.       - delay: 2s
  130.       - lambda: id(buttons)[id(channel) % 10]->turn_off();
  131.         Debug.Log("tens button relese + id(channel) % 10);
  132.      - delay: 2s
  133.      - switch.turn_on: gpio_enter
  134.      - delay: 2s
  135.      - switch.turn_off: gpio_enter
  136.      - delay: 2s
Tags: ESPhome
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement