Page 1 of 1
Collecting data from the Rituals "perfume genie"
Posted: Thursday 17 January 2019 8:30
by Lebo2d9
Hi in my post
https://www.domoticz.com/forum/viewtopi ... 56&t=26527 I posted some code that I had found
I reworked the python code and now I'm able to readout the status
. This is the code I have so for
Code: Select all
#! /usr/bin/python
import requests
import json
#from urllib.parse import urlencode
name = "rituals-api"
BASE_URL = 'https://rituals.sense-company.com'
# __init__
email = "email"
password = "password"
userData = None
hubs = {}
# login
url = '{}/ocapi/login'.format(BASE_URL)
data = {'email': email, 'password': password}
headers = {'Content-Type': 'application/json'}
r = requests.post(url, json=data, headers=headers)
if r.status_code == 200:
userData = r.json()
print '######Login data###### :' + '\n', userData
else:
print('Something went wrong with logging in: {}'.format(r.text()))
#hub info
url = '{}/api/account/hubs/{}'.format(BASE_URL, userData['account_hash'])
print "######hub info URL###### :" + '\n' , url
r = requests.get(url)
print "######hub info###### :" +'\n' , r.json()
if r.status_code == 200:
for hub in r.json():
hubName = str(hub['hub']['attributes']['roomnamec']).replace(' ','_').lower()
hubs[hubName] = hub['hub']
else:
print('Something went wrong with retrieving hub info: {}'.format(r.text()))
This is the output of the script
- Spoiler: show
- ######Login data###### :
{u'first_name': u'first', u'last_name': u'Last', u'account_id': account_id, u'birthday': u'date', u'logged_id': 1, u'message': u'Successfully logged in', u'account_hash': u'removed', u'email': u'[email protected]'}
######hub info URL###### :
https://rituals.sense-company.com/api/a ... count_hash
######hub info###### :
[{u'hub': {u'hublot': u'LOT118-10-D243F-10316', u'status': 1, u'hash': u'3829a268494d6f287d05624b177cee2c4b4742bbd0b684de72fadfcc2dcaa57d', u'current_time': u'2019-01-17T07:20', u'ping_update': u'25', u'attributes': {u'roomnamec': u'Geurrie', u'fanc': u'0', u'resetc': u'', u'roomc': u'1', u'speedc': u'1'}, u'title': None, u'sensors': {u'ipc': u'1547321280', u'battc': {u'created_at': u'2017-03-10 16:14:37', u'sensor_id': 2, u'description': u'', u'title': u'Full', u'default': 0, u'max_value': u'700', u'image': u'', u'min_value': u'641', u'updated_at': u'2018-10-11 07:10:43', u'interval': u'1', u'discover_image': u'', u'id': 8, u'icon': u'battery-full.png'}, u'rpsc': {u'created_at': u'2018-01-23 12:05:45', u'sensor_id': 12, u'description': u'', u'title': u'Fan on', u'default': 0, u'max_value': u'10000', u'image': u'', u'min_value': u'11', u'updated_at': u'2018-01-23 12:05:45', u'interval': u'', u'discover_image': u'', u'id': 48, u'icon': u''}, u'errorc': u'', u'fillc': {u'created_at': u'2017-10-16 07:50:23', u'sensor_id': 3, u'description': u'', u'title': u'90-100%', u'default': 0, u'max_value': u'1000', u'image': u'', u'min_value': u'0', u'updated_at': u'2017-10-16 07:57:37', u'interval': u'', u'discover_image': u'', u'id': 38, u'icon': u'icon-fill.png'}, u'resetc': u'Software/System restart', u'rfidc': {u'created_at': u'2017-03-13 15:55:52', u'sensor_id': 4, u'description': u'For centuries, the Japanese have celebrated the annual flowering of the Cherry Blossom, or Sakura. This marks an awakening of nature and symbolises that beauty is momentary and life must be enjoyed. Inspired by this tradition, The Ritual of Sakura collection blends the sweetness of Cherry Blossom with nourishing Organic Rice Milk, to make each day feel like a new beginning.', u'title': u'Ritual of Sakura', u'default': 0, u'max_value': u'053616b0', u'image': u'background-sakura.png', u'min_value': u'053616b0', u'updated_at': u'2017-09-25 08:02:36', u'interval': u'1', u'discover_image': u'discover-sakura.jpg', u'id': 15, u'icon': u'icon-sakura.png'}, u'chipidc': u'3388355', u'versionc': u'1.2.8', u'onlinec': {u'created_at': u'2017-09-07 08:23:42', u'sensor_id': 16, u'description': u'', u'title': u'Offline', u'default': 1, u'max_value': u'0', u'image': u'', u'min_value': u'0', u'updated_at': u'2017-09-07 08:23:42', u'interval': u'', u'discover_image': u'', u'id': 32, u'icon': u''}, u'wific': {u'created_at': u'2017-03-10 16:17:30', u'sensor_id': 1, u'description': u'', u'title': u'High', u'default': 0, u'max_value': u'-0.00', u'image': u'', u'min_value': u'-54.99', u'updated_at': u'2017-06-21 13:30:27', u'interval': u'1', u'discover_image': u'', u'id': 10, u'icon': u'icon-signal.png'}}, u'settings': []}}]
Now i need to create the dummy devices an update the info.
And i need to find out how i can control the genie also;
If there are programers who can or will help me, feel free
Kind regard Koen deschepper
Re: Collecting data from the Rituals "perfume genie"
Posted: Tuesday 28 May 2019 10:40
by fabstar81
did you come any further?
i hoped the genie would be a little smarter and use IFTTT or something at least. there are some alternatives available on the internet and ali...
Re: Collecting data from the Rituals "perfume genie"
Posted: Friday 29 October 2021 18:32
by Brutus
Someone integrated this into Domoticz?
Would like to accomplish this.
Greetings
Re: Collecting data from the Rituals "perfume genie"
Posted: Thursday 07 April 2022 8:58
by Xavier82
Any one got an update about this?
I would really like to get this working.
In the default Rituals Genie app I miss the possibility to create more on-off schedules (max is 14 days).
I would like to have a schedule which sets the Genie to "on" multiple times a day (example: 1 hour on and 1 hour of, 1 hour on, 1 hour off, etc). I can setup this in Domoticz.
I hope somebody can help?
Re: Collecting data from the Rituals "perfume genie"
Posted: Tuesday 10 May 2022 22:29
by smitec
This one is a great starting point to make a plugin or create a script
https://github.com/milanmeu/pyrituals
see the example at the bottom of the page, which is working fine.
Re: Collecting data from the Rituals "perfume genie"
Posted: Friday 10 June 2022 15:25
by Xavier82
Thanks for the starting point.
I had found this also, but I miss program skills to translate this to a Domoticz python application.
I hope somebody can help with this.
Re: Collecting data from the Rituals "perfume genie"
Posted: Tuesday 22 November 2022 16:02
by smitec