Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add remote_receiver yaml block #8

Merged
merged 14 commits into from
Dec 13, 2023
Merged

Conversation

Habbie
Copy link
Contributor

@Habbie Habbie commented Dec 5, 2023

No description provided.

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 5, 2023

Maybe simply call it "remote.py" so that transmitter could be added in future?

As for the copyright, feel free to put your name/nickname there, otherwise remove it (as I didn't write it haha).

@Cossid
Copy link
Contributor

Cossid commented Dec 5, 2023

Maybe simply call it "remote.py" so that transmitter could be added in future?

It's a separate component/block for esphome, makes sense to leave them as separate files. I also don't think anything Tuya comes with transmit stuff in the config, that's all programmable stuff.

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 5, 2023

The modules aren't named by ESPHome components, but by parts of upk data.

@Habbie
Copy link
Contributor Author

Habbie commented Dec 5, 2023

The modules aren't named by ESPHome components, but by parts of upk data.

ok, ir then?

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 6, 2023

ir means infrared only, but reality tells us that RF is used here too. So remote seems appropriate to me.

EDIT: lint checks are failing now, please run black on the project code

@Habbie
Copy link
Contributor Author

Habbie commented Dec 6, 2023

renamed, blacked

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 7, 2023

Here's an interesting one:
https://tuya-cloudcutter.github.io/api/devices/tuya-generic-ir-rf-universal-remote-controller-v2.0.8.json

    "device_configuration": {
        "crc": 88,
        "infre": 7,
        "infrr": 8,
        "netnc": 0,
        "netyc": 1,
        "owm": 0,
        "rf_study_feq": 0,
        "rsthold": 3,
        "wfst_lv": 1,
        "wfst_pin": 9
    },

image

Apparently it supports both IR and RF, not sure how. Is this a receiver or a transmitter? No idea, but there are both infre and infrr keys.

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 7, 2023

Logs from a different (but similar) IR/RF bridge device:

[01-01 18:12:15 TUYA Notice][lr:0x595b5] pConfig = {reset_pin:26,wfst_pin:24,owm:1,reset_lv:0,rsthold:3,wfst_lv:1,netyc:1,infrr:8,netnc:0,infre:7,crc:32,}---config len:103
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:reset_pin:-----val:26----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:reset_lv:-----val:0----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:infre:-----val:7----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:infrr:-----val:8----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:wfst_pin:-----val:24----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:wfst_lv:-----val:1----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:rsthold:-----val:3----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:owm:-----val:1----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:netyc:-----val:1----len:1
[01-01 18:12:16 TUYA Notice][lr:0x59709] key:netnc:-----val:0----len:1
[01-01 18:12:16 TUYA Notice][lr:0x594c7] ir_send =7
[01-01 18:12:16 TUYA Notice][lr:0x594cf] ir_recv =8
[01-01 18:12:16 TUYA Notice][lr:0x594d7] owm =1
[01-01 18:12:16 TUYA Notice][lr:0x594df] led detect_sta =1
[01-01 18:12:16 TUYA Notice][lr:0x594e7] led_num =24
[01-01 18:12:16 TUYA Notice][lr:0x594ef] netn =0
[01-01 18:12:16 TUYA Notice][lr:0x594f7] nety =1
[01-01 18:12:16 TUYA Notice][lr:0x594ff] key detect_sta =0
[01-01 18:12:16 TUYA Notice][lr:0x59507] key_num =26
[01-01 18:12:16 TUYA Notice][lr:0x5950f] long_key_time =3

@kuba2k2
Copy link
Member

kuba2k2 commented Dec 7, 2023

Oh, nevermind, they use a CMT2300A chip for RF. These pins are purely for IR RX/TX.

@Cossid
Copy link
Contributor

Cossid commented Dec 7, 2023

Correct, infre and infrr are infrared emit and infrared receive. RF is a separate module and not in the config, but on pins P26 & P6 on https://tuya-cloudcutter.github.io/api/devices/tuya-generic-ir-rf-universal-remote-controller-v2.0.8.json

@Habbie
Copy link
Contributor Author

Habbie commented Dec 10, 2023

ok, shall I do all of:

  • generate receiver blocks for both ir and infrr
  • generate transmitter blocks for irfre

then?

@Cossid
Copy link
Contributor

Cossid commented Dec 10, 2023

ok, shall I do all of:

* generate receiver blocks for both `ir` and `infrr`

* generate transmitter blocks for `irfre`

then?

Yes, that sounds correct.

upk2esphome/parts/remote.py Outdated Show resolved Hide resolved
upk2esphome/result.py Outdated Show resolved Hide resolved
upk2esphome/parts/remote.py Outdated Show resolved Hide resolved
@kuba2k2
Copy link
Member

kuba2k2 commented Dec 13, 2023

@Habbie I've removed the copyright line for now, since there was my name and it was incorrect. If you want to add your name there, please comment or make a PR.

upk2esphome/result.py Outdated Show resolved Hide resolved
@Habbie
Copy link
Contributor Author

Habbie commented Dec 13, 2023

@Habbie I've removed the copyright line for now, since there was my name and it was incorrect. If you want to add your name there, please comment or make a PR.

ah yes, of course. I don't need my name there, git history is enough credit :)

@kuba2k2 kuba2k2 merged commit 6e01c4d into libretiny-eu:master Dec 13, 2023
1 check passed
@kuba2k2
Copy link
Member

kuba2k2 commented Dec 13, 2023

Oh, I just noticed that yr.found = True is missing, so it can throw a "Found no actual components" error for some devices.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants