Rituals Perfume Genie not working after Update to 2021.7.2

Hi there,

after Update to HA 2021.7.2 from 2021.6.5 the integragtion of Rituals Perfume Genie stopped working correctly. The switch entity (and some other sensors) have the state unavailable and therefore cannot be used. In the logs I have the following errors:

ValueError: invalid literal for int() with base 10: ''
2021-07-16 08:29:23 ERROR (MainThread) [homeassistant.components.switch] Error while setting up rituals_perfume_genie platform for switch
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 258, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 383, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 588, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 666, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 456, in _async_write_ha_state
    extra_state_attributes = self.extra_state_attributes
  File "/usr/src/homeassistant/homeassistant/components/rituals_perfume_genie/switch.py", line 50, in extra_state_attributes
    "fan_speed": self._diffuser.perfume_amount,
  File "/usr/local/lib/python3.9/site-packages/pyrituals/__init__.py", line 63, in perfume_amount
    return int(self.hub_data["attributes"]["speedc"])
ValueError: invalid literal for int() with base 10: ''
2021-07-16 08:29:53 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 134, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 265, in _async_refresh
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 325, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 419, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 453, in _async_write_ha_state
    state = self._stringify_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 425, in _stringify_state
    state = self.state
  File "/usr/src/homeassistant/homeassistant/components/number/__init__.py", line 113, in state
    return self.value
  File "/usr/src/homeassistant/homeassistant/components/rituals_perfume_genie/number.py", line 53, in value
    return self._diffuser.perfume_amount
  File "/usr/local/lib/python3.9/site-packages/pyrituals/__init__.py", line 63, in perfume_amount
    return int(self.hub_data["attributes"]["speedc"])
ValueError: invalid literal for int() with base 10: ''

I tried to delete and reinstall the integration without luck.

I wonder if it has something to do with this breaking change:

Rituals Perfume Genie

The switch extra state attributes fan_speed and room_size will be removed in the next release. As of this release, both attributes are available as entities, making it possible to change the value with Home Assistant.

(@milanmeu - #51993) (rituals_perfume_genie docs)

Has anybody else issues with this integration or any idea how to fix it?

Any help or hint is very appreciated!

1 Like

I have got the same problem.

Got the same issue after upgrading to latest core version.

I reported this issue:

1 Like

I’m sorry I didn’t see this topic earlier. The issue has been resolved in PR #54080, but the change will take effect in 2021.9. For now, a Home Assistant restart can fix the problem.

If integration still logs errors or doesn’t work, please open a new issue on GitHub. Thanks for reporting this.

Home Assistant is blocked by the API see issue #54618, so the integration is currently not working. The integration is working again. See comment from Sense Company in GitHub issue.

bumping this. i cant get my rituals to connect anymore from few days ago, anyone else??

Logger: homeassistant.config_entries

Config entry '[email protected]' for rituals_perfume_genie integration not ready yet: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://rituals.sense-company.com/api/account/hubs/eyJpdiI6Ilh3213d54435f435f345fXC9RPT0iLCJ2YWx1ZSI6IlVCa1ZRWFRPRGExalF43f53f453f45ya0NhQlF5bERXbT3f53f534f3YzhkNDZhYzU1NWUxMmJlODk3YzE4NT3f453f54gzcxMjVh3f4543f5mVh345f435f35434f453f53fU4NzczNTBjMzFjZCJ9'); Retrying in background

Unable to find referenced entities switch.rituals or it is/they are currently not available

Have not change anything and works in rituas mobile app!

and btw swedeish ppl 20% rabbat pÄ refill nui och handlar man för 450kr fÄr man gÄvoset !!

I have the same I see now. waiting for an update I think.

thanks! Then i know its no only for me :slight_smile:

Same here
 :frowning:

Same here. I deleted the integration and now cannot re-installed it as it always give error “failed to connect” with good password or even with bad password!
Seems something changed at login part to rituals.

Went to ‘https://rituals.sense-company.com’, logged in but received “SERVER ERROR 500”

latest version is working well again.