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

Payload validation for 0x01FF packet #145

Closed
Onl1ne1373 opened this issue Jan 23, 2024 · 3 comments
Closed

Payload validation for 0x01FF packet #145

Onl1ne1373 opened this issue Jan 23, 2024 · 3 comments

Comments

@Onl1ne1373
Copy link

Onl1ne1373 commented Jan 23, 2024

The payload validation for 0x1FF in ramses_rf is:

Code._01FF: {  # unknown_01ff, TODO: definitely a real code, Itho Spider
        SZ_NAME: "message_01ff",
        I_: r"^0[01][0-9A-F]{50}$",
        RQ: r"^0[01][0-9A-F]{50}$",
        W_: r"^00[0-9A-F]{50}$",

But in ramses_cc the payload validation is:

vol.Required("payload"): cv.matches_regex(r"^[0-9A-F]{1,48}$")

So, sending 01FF packages in Home Assistant fails due to the maximum length.

@zxdavb
Copy link
Owner

zxdavb commented Jan 24, 2024

Can you provide more information?

  • why is its payload length 50 and not 48?
  • do you have any examples of such packets?

@Onl1ne1373
Copy link
Author

Onl1ne1373 commented Jan 26, 2024

When I send a packet with my HGI80 to my Itho Spider to set the target temperature I have to send the following:

service: ramses_cc.send_packet
data:
  device_id: "21:033620"
  verb: W
  code: 01FF
  payload: 0080802727D0000000143C80800000B40080800280FF80040000

Resulting in

2024-01-26T14:03:34.223366 095  W --- 18:010547 21:033620 --:------ 01FF 026 0080802727D0000000143C80800000B40080800280FF80040000

The payload is longer than the home assistant integration allows. I changed the python code to allow a longer payload by editing custom_components/ramses_cc/schemas.py, line 78, from 48 to 52. Rebooting HA and I can send it.
The ramses_rf code also defines the payload length as 52.

We got the packet by listening to a Spider Connect Gateway. And I now have the binding working between a HGI80 as gateway and the home icon on the Spider. So now I am testing the setpoint change on the Spider.

@zxdavb
Copy link
Owner

zxdavb commented Jan 26, 2024

Sorry, I am being stupid.

There is a typo in ramses_cc, it should be:

vol.Required("payload"): cv.matches_regex(r"^([0-9A-F][0-9A-F]){1,48}$"),

I have made this fix - it will be included within 0.31.4.

@zxdavb zxdavb closed this as completed Jan 26, 2024
zxdavb added a commit that referenced this issue Jan 26, 2024
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

No branches or pull requests

2 participants