RESTful or not? Rituals Perfume Genie

I’ve found the image and discover_image images, they are with in the mobile app, or at least the android one.

In the following link, you’ll find the android app extracted: app.zip

You can find the images in assets\www\img\backgrounds and assets\www\img\discover directories.

discover_url is indeed prefixed, but that took only a simple google to find it:

rituals.com/en-nl/the-ritual-of-hammam-cartridge-1103967.html

Did you install the package using pip?
The package name is rituals-api why do you use import rituals instead of import rituals-api?
I can’t import rituals-api because it has a hyphen in the package name. It works using:

rituals = __import__("rituals-api")

Hi guys
REST command didn’t work for me so I used a workaroudn with curl

shell_command:
    genie_on: "curl --insecure -H 'Content-Type: application/json' -X POST 'https://37.97.128.129/api/hub/update/attr?hub=**<HUB-HASH>**&json=%7B%22attr%22%3A%7B%22fanc%22%3A%221%22%7D%7D'"
    genie_off: "curl --insecure -H 'Content-Type: application/json' -X POST 'https://37.97.128.129/api/hub/update/attr?hub=**<HUB-HASH>**&json=%7B%22attr%22%3A%7B%22fanc%22%3A%220%22%7D%7D'"

It works directly with IP addr (hopefully fixed IP) because my hassio server couldn’t found a working DNS for rituals.sense-company.com.

I made an integration which is installable using HACS (add it as a custom repository). It is found on:

A warning though, this is my first HomeAssistant integration :innocent: . You provide the username and password (which are not stored), and then it allows to select the Genie you want to add. After that it should pop-up in your entities / devices. It should work with multiple Genies, but I only have one, so I haven’t tested that.

4 Likes

Thanks a lot, you saved me tons of troubles :slight_smile: This works perfectly :raised_hands:

Indeed, thank you very much for this component! It just works right out of the box! :slight_smile:
Excellent work for all of us Rituals-owners.

I’ve downloaded your integration using HACS and after rebooting Home Assistant it works perfectly. My Rituals Genie have stopped working with Home Assistant after some update but now it’s working again effortless. Thank you!

Hi.

At the beginning the integration was working just fine but now I get errors getting and changing the state to on or off. Everything else works (sensors).

Can you help?


[548110694048] 'NoneType' object has no attribute 'get'

12:36:14 PM – Home Assistant WebSocket API (ERROR) - message first occurred at 10:27:52 AM and shows up 4 times

Error fetching information from https://rituals.sense-company.com/api/account/hub/4d59090d44a4fbdfb1edd7f541fc996064ab798f3ff579aac1af39cb115f8aeb - Cannot connect to host rituals.sense-company.com:443 ssl:default [Name does not resolve]

12:36:14 PM – Rituals Genie (ERROR) - message first occurred at February 5, 2021, 8:51:15 PM and shows up 694 times

Error doing job: Task exception was never retrieved

12:36:01 PM – custom_components/rituals_genie/switch.py (ERROR) - message first occurred at February 5, 2021, 8:51:15 PM and shows up 682 times

Hi João,
seems to me there is something wrong with your DNS resolving. Can you try and resolve rituals.sense-company.com? Try it from the Home Assistant server if you can.

a integration in HA is comming in 2021.3 (next week):

Hi,
I am Milan @milanmeu, the developer of this core integration.
Thanks to everyone on this forum for the information about the API.
Here is a small overview of what to expect.

The core integration will only contain limited functionality in 2021.3 (4 March):

  • Switch entity to turn the fan on and off;
  • Room size and fan speed attributes.

I am working on the sensors for the core integration, these will be added in version 2021.4 (7 April).
I recommend the custom integration fred-oranje/rituals-genie if you want to use the sensors now.

I am happy to answer your questions about the core integration on this form.
Issues can be reported here for the core integration and here for the custom integration.

Have fun with the integration.


You can help translate this core integration:

  1. Join the backend translation team;
  2. Translate Rituals Perfume Genie to your language;
  3. Thanks :grinning:

More information on how to contribute translations can be found here.


It would be nice if someone could make an icon for the perfume diffuser so that we don’t have to use a fan blade. Contact me or open a PR if you made and uploaded an icon to Material Design Icons.

since yesterday evening rituals no longer works for me.
I still get the data via the URL api.
do you also have this problem?

Same here. There was an update of the app. Probably things changed in the API like last time…
I tried the custom component but wasn’t able to set it up because it doesn’t recognise my user name and password I also use for the Perfume Genie app…

Thanks for reporting this issue @niekniek89, @Rikkie80.

Rituals seems to have changed their SSL certificate. Python does not trust the issuer of the new SSL certificate by default. It is possible to trust the new publisher but this will require updating the library and integration. Aiohttp gives this error but this is not correct, read the updates.
I will edit this post when I have more information.


Update 3 Mar 19:05 CET

Python can talk to the API if I use certifi. Home Assistant core can’t talk to the API, even if we trust the certifi Root Certificates it does not work. I am confused?

Update 3 Mar 20:08 CET

Home Assistant 2021.3.0 released. The integration is now officially available. :partying_face:
Unfortunately, it doesn’t work. :slightly_frowning_face:

Update 3 Mar 21:00 CET

When I change the request headers it seems to work. The custom integration header and headers containing Home Assistant are blocked. The servers seem to be blocking Home Assistant requests.
I know this is easy to solve, but I first want to contact sense-company/Rituals about this.

Update 3 Mar 23:05 CET

I am in contact with sense company (the company that develops this rituals device). They are very helpful and answer quickly even after office hours. Home Assistant is blocked by the API because we are making too many requests. They are working on a solution so they can throttle requests if you exceed a limit.

Update 4 Mar 01:50 CET

There is an alert posted on alerts.home-assistant.io and it is also referenced in the docs.
New updates will be posted in issue 47321.

Hi Milan,

thanks for all the effort so far. Really curious on the core HA integation.

I understand why Python wouldnt trust the cert. I mean Let’s Encrypt? Come on…

since 2 hours ago the sensors are working again!
I have not changed anything myself.

I just received an email from Sense company that Home Assistant has been unblocked. I have briefly tested the integration and it seems to work again. More information in GitHub issue #47321.

Hi Milan,

Circling back here as per GitHub comment :slight_smile:

My wife got a Genie v2 for her birthday (obviously, the choice for this device had nothing to do with this HA integration :innocent:) and I just had a look in the app with her.

Perfume strength (speedc in the api) changes the speed of the fan. Do you know what room size does, is it useful to integrate it into home assistant?

I think that “perfume strength” in the app is somewhat misleading, as it indeed is modifying the fan speed only. That being said, I do believe that the “room size” setting is the actual ‘perfume strength’ as we would call it: the bigger the room the more perfume is needed, of course.

For the use case “little bit perfume in the morning, a bit more after dinner” being able to set both values would be beneficial, I presume. I know that Sense has been helpful before, they might be able to help you out here as well understanding the two settings?

I’ll install the sensor PR as custom_component tomorrow to test it and report back.

@milanmeu PR works correctly for my v2:

Would it be possible to control the genie without the cloud?
Only locally?