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

TRADFRI remote control - add fw support v24.4.5 #2140

Closed
wants to merge 0 commits into from

Conversation

stickpin
Copy link
Contributor

TRADFRI remote control - Add support for firmware v24.4.5

More details in this bug report: #2139

@codecov-commenter
Copy link

Codecov Report

Base: 83.70% // Head: 83.70% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (67e6ef7) compared to base (07f38fc).
Patch coverage: 100.00% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##              dev    #2140   +/-   ##
=======================================
  Coverage   83.70%   83.70%           
=======================================
  Files         258      258           
  Lines        8228     8232    +4     
=======================================
+ Hits         6887     6891    +4     
  Misses       1341     1341           
Impacted Files Coverage Δ
zhaquirks/ikea/fivebtnremotezha.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@coveralls
Copy link

coveralls commented Jan 27, 2023

Pull Request Test Coverage Report for Build 4027420412

  • 4 of 4 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.008%) to 83.71%

Totals Coverage Status
Change from base Build 4019454703: 0.008%
Covered Lines: 6891
Relevant Lines: 8232

💛 - Coveralls

@MattWestb
Copy link
Contributor

Thanks for the updated quirk i have the same done nut i have portable verifying that is working then the remote was not liking upgrading to the last OTA and after flashing it with the last good with group supported my ZHA with RCP firmware 4.1.4 and 4.2.0 dont like paring it so i must sniffing what is going wrong.

Device class naming i do not comments then its one question for the maintainers.

PS: is one risk that you need rebasing your PR then its one in the pipe for merger that is fixing some old DA and raking some unneeded things away.
#2123

@stickpin
Copy link
Contributor Author

stickpin commented Jan 27, 2023

Thanks for the updated quirk i have the same done nut i have portable verifying that is working then the remote was not liking upgrading to the last OTA and after flashing it with the last good with group supported my ZHA with RCP firmware 4.1.4 and 4.2.0 dont like paring it so i must sniffing what is going wrong.

Device class naming i do not comments then its one question for the maintainers.

PS: is one risk that you need rebasing your PR then its one in the pipe for merger that is fixing some old DA and raking some unneeded things away. #2123

No problem, I will rebase it once it's merged.

There is still a problem with the battery reporting.
Screenshot 2023-01-27 at 19 29 32
It looks like IKEA changed measurement from percentage 0-100 to 0-255. Meaning that we need a convertor in the quirk for this now as well. I am new to quirks, so I will see what is the best way to implement the converter.

@TheJulianJES
Copy link
Collaborator

TheJulianJES commented Jan 27, 2023

Yeah, check the PowerConfiguration1CRCluster you're using.

ZCL requires 0—200 for battery and. Is it possible that IKEA uses those correct values now? (Or where are you getting the 255?)

@stickpin
Copy link
Contributor Author

stickpin commented Jan 27, 2023

Yeah, check the PowerConfiguration1CRCluster you're using.

ZCL requires 0—200 for battery and. Is it possible that IKEA uses those correct values now? (Or where are you getting the 255?)

Yes, you are right. I've just changed to the new battery and checked the PowerConfiguration1CRCluster:
Screenshot 2023-01-27 at 19 37 49
Should we just divide the value by 2?

@TheJulianJES
Copy link
Collaborator

TheJulianJES commented Jan 27, 2023

0 to 200 should be what ZHA expects (and will divide that by 2 per ZCL spec).

So right now your quirk is overriding the PowerConfiguration cluster with the custom PowerConfiguration1CRCluster.
What happens if you also put PowerConfiguration.cluster_id in the replacement (instead of PowerConfiguration1CRCluster)?

EDIT: Actually, I may have confused this with Xiaomi gear(?)

@MattWestb
Copy link
Contributor

All IKEA controller is reporting 100% then full and ZCL it shall being reported 200 for being full so all IKEA quirks is id dubeling the reported valiue.
Its looks like some Z2M user have reported that the new firmware is ZCL and dont need the doubling but i have not verifying that.

@stickpin
Copy link
Contributor Author

@TheJulianJES, @MattWestb thanks a lot for the hint!
It worked!
Screenshot 2023-01-27 at 20 07 51
I've updated the quirk.

@TheJulianJES
Copy link
Collaborator

Its looks like some Z2M user have reported that the new firmware is ZCL

Also, the updated remote reports zcl_version = 8 (ZCL revision 8), so IKEA finally used a way newer EmberZNet release to build this firmware and even used this for their older products. (yay)
(Hoping IKEA also does this for every other 2.x.x products. STARKVIND and other 1.x firmware products already report zcl_version = 8)

Weirdly for me, the remote didn't get the new signature after re-pairing. It shouldn't require me to delete the remote first though. (I'll look at this later)

@MattWestb
Copy link
Contributor

I still fighting getting the old firmware on the Zigbee module also the very old ZLL 1.1.1 that i have "found".
In the end its looks Segger have changing there libs and silabs have updating then with the last SS5 updates and now its required having hardware reset for loading the CPU code and flashing MG1 device that was not needed before. So i must braking it more and souring cables then i cant hold 5 jumpers in place and start flashing with the other hand :-(((

Great that the quirk looks being in place so user can installing it and using there devices !!!

@MattWestb
Copy link
Contributor

Have getting the WSTK working after getting the PCB out and back with cables so can flashing it OK. The TRADFRI-remote-control-1111 is not starting OK (one very old TLL firmware and very likely is the bootloader to new for it).
The last TRADFRI-remote-control-2.3.080 was Ember Version: 6.3.1.1 and the update is Ember Version: 6.10.2.0 = many battery draining bugs and network problems.
The TRADFRI-motion-sensor-24.4.5 is also Ember Version: 6.10.2.0 so its all great only that IKEA can have one small step to 6.10.3 but i cant complaining.

I trying OTA updating from 2.3.80 and its taking some time if its working OK.

The Starkvind OTA file is in GBL format and is not having any metadata for the compiling.
But in the release note:

  • Release Version: 1.22.0 GA
    • 6th Sep 2022
      • STARKVIND Air Purifier (v1.1.001)
      • Upgrade to stack v6.10.2.

I think it can being one more problem with very old devices is having old bootloaders that making hard flashing 7.X firmware and 7.1 have dropping all Zigbee support for MG1 (first and second gen devices) devices but i being very happy with 6.10.X :-)))
I think the first gen need EBL files for the bootloader and second and 3 gen can using GBL files.
Also its possible updating the bootloader with OTA but Silbas is not recommending it then its not 100% sure its working OK and getting hardware bricking.

For third gen devices have not limit if have making all right.

@MattWestb
Copy link
Contributor

I have testing and doing automatons from all DAs and they is working !!!

If some line doing more DAs its possible for dim up and down release:

up relese

  endpoint_id: 1
  cluster_id: 8
  command: stop_with_on_off
  args: []
  params: {}


down relese

  endpoint_id: 1
  cluster_id: 8
  command: stop
  args:
    - 0
    - 0
  params:
    options_mask: 0
    options_override: 0

is always the same and is unique = can being used for dim up / down released after long press.

Long release for left / right hold is also possible but little tricky is sending:

Left release:

  endpoint_id: 1
  cluster_id: 5
  command: release
  args:
    - 4112
  params:
    param1: 4112


Right release:

  endpoint_id: 1
  cluster_id: 5
  command: release
  args:
    - 3548
  params:
    param1: 3548

And the parm1 / arg is the time the button was hold. The problem is that 0 is being used for toggle long press / release but can filtering 0 away and it shall working.
Getting release from right left its possible using the same logic as Open / Close button that is saving the last direction and using it for next release.

Great work done !!

Copy link
Contributor

@MattWestb MattWestb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also battery is working OK (10% after firmware up and downgrade many times ).

@MattWestb
Copy link
Contributor

The reseal from hold dim up and down is one PR for adding in current devices so i think its good putting in here 2.
https://github.com/zigpy/zha-device-handlers/pull/2123/files

Copy link
Contributor

@MattWestb MattWestb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not one must but its easy adding the dim up and down release after hold.

CLUSTER_ID: 8,
ENDPOINT_ID: 1,
PARAMS: {"move_mode": 0},
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    (LONG_RELEASE, DIM_UP): {
        COMMAND: COMMAND_STOP_ON_OFF,
        CLUSTER_ID: 8,
        ENDPOINT_ID: 1,
    },

CLUSTER_ID: 8,
ENDPOINT_ID: 1,
PARAMS: {"move_mode": 1},
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    (LONG_RELEASE, DIM_DOWN): {
        COMMAND: COMMAND_STOP,
        CLUSTER_ID: 8,
        ENDPOINT_ID: 1,
    },

@TheJulianJES
Copy link
Collaborator

Let's try and wait for #2123 first. Then, this can be rebased and hopefully just copy all device automation triggers.

stickpin added a commit to stickpin/zha-device-handlers that referenced this pull request Jan 30, 2023
@MattWestb
Copy link
Contributor

MattWestb commented Jan 31, 2023

@stickpin Can you reading the hw_version (id: 0x0003) attribute on basic cluster on your device ?
The firmware have getting CSA certificate but is written Hardware Version 2 and my is ver 1 and was not liking the OTA and was rolling it back (it shall not downloading it if the HW Ver is not OK if have setting it as moderate).
https://csa-iot.org/csa_product/tradfri-remote-control-11/

@stickpin
Copy link
Contributor Author

@MattWestb
Screenshot 2023-01-31 at 09 33 54

@MattWestb
Copy link
Contributor

Thanks then i think my remote have one older bootloader that making the OTA not being installed normal way.

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.

None yet

5 participants