-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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 support for ZHA zigbee IR remotes as controller #1178
base: master
Are you sure you want to change the base?
Conversation
As Zigbee IR remotes are becoming more common and popular, support for them would certainly be welcome. |
Could you provide a sample json file? |
I just tried this PR and couldn't get it to work. But I have been using very similar code to this that does work from a fork I found. davidrpfarinha@c839bde Just today I finished making one for an Actron AC and it works great. I used SmartIR-Zigbee-Tools to help generate it. It works using ZHA and a Moes UFO R11 and I've also confirmed it works with the USB powered version Tuya Zigbee TS1201.
|
Thanks for your patch @anmar ! I'm looking forward to it hitting mainline. Do you have any sample IR blasters that you tested your this against? (I realize ZHA & HA should be most of the dirty work, but curious in getting data on a working setup) |
name: Office AC | ||
unique_id: office_ac | ||
device_code: 9000 | ||
controller_data: '{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be an entity_id or something for ease of use--and single source of truth?
I'm also not 100% sure if cluster_id etc. can change dynamically. This would remove the need to keep updating this part of the config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can't be an entity ID, as that's not how ZHA sends zigbee commands. It could be the IEEE address for the IR remote. Though if we don't include cluster data in the config, it won't work for any other remote that uses a different cluster/command numbers. Currently you need a quirk file to get the TuYa ZS06 working in ZHA, so the clusters used are probably going to change for other devices.
Edit: forgot to mention, clusted_id is set in code for the cluster definition see the quirk file. So for the same device it will only change if ZHA changes cluster definitions in code.
As part of the PR? or externally for testing? I didn't include it as I assumed files for ZHA controllers wouldn't be accepted as it's current policy with the MQTT ones. |
Changing this to zha in lowercase should do the trick. |
I have bunch of TuYa ZS06. They require a quirk file for ZHA. Then it's a matter of getting the codes with the "IRLearn" command + reading the "last_learned_ir_code" attribute in the ZosungIRControl cluster. I have tested it with a few climate entities (Samsung, Fujitsu, Fujitsu-General, Daikin) and all seem to work. Though I don't have a full command file for any of them yet as getting all the commands with the existing UI home assistant is a pain. I'll try to finish one of them tomorrow so I can post a full example. |
Changing it to lowercase did the trick. Although uppercase in my mind makes more sense given that it is an acronym.
I have a full json file for a Daikin AC that I'm using. It includes swing on and off and all the fan speeds and modes. |
Is it uploaded anywhere, so I can test it? |
I've not added it anywhere. But I'll upload it here for you to test. |
Thanks! Though not working with mine. Different IR protocol on my daikin units (mine use the 160 bit one, while your file is for the 216bit remotes). |
|
I tried with my TS1201 (ZHA blaster on battery), it works. But I had to put ZHA in uppercase in line 18 of controller.py otherwise smartir wouldn't work (granted that was my first time using the integration so I may I have made a mistake along the way). |
Not exactly related, but isn't TS1201 not supported in ZHA? I've just gotten mine and I just get a single "Switch" entity, and I couldn't find quirks that would provide a Remote entity for the device. If you somehow figured out how to get a Remote entity for this blaster, I would really appreciate if you shared your findings. |
zigpy/zha-device-handlers#1687 (comment) |
Also, if what you want is to create some simple "IR entity", create an entry. Simple button or boolean switch if you want to somewhat track on/off state. Exemple : alias: New Automation
The data (ieee, endpoint, etc) for the IR blaster are easily found looking at the zigbee device. In case you're saving it to a script, simply : alias: Power ON
And then call it from an automation. |
Just noticed that you folks using the zha as the controller. |
I simply took the files that anmar modified right there. And since nobody asked, I'm using it daily without problem. |
No description provided.