2021-11-06 17:21:06 ERROR (SyncWorker_0) [homeassistant.loader] The custom integration 'snoo' does not have a version key in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details
I was able to get this working yesterday and just wanted to share how to do it. Once you place the snoo folder into the custom_components folder, edit the manifest.json file by adding āversionā: ā1.0.0ā, to it:
Then restart home assistant and go to Settings ā Devices and Services ā Add Integration and search for āHappiest Baby.ā If it doesnāt show up, try refreshing the page. Once you have it added, it will prompt for a username and password but the two fields will appear blank. Username goes first, password goes second.
Cannot login with a fresh install.
Added instance as suggested and get to the login page, but no success in logging in.
Any suggestions or is there additional requirements other than the custom integration folder?
Thanks
This error originated from a custom integration.
Logger: custom_components.snoo.config_flow
Source: custom_components/snoo/config_flow.py:22
Integration: Happiest Baby Snoo Smart Bassinet (documentation)
First occurred: 22:50:24 (7 occurrences)
Last logged: 23:07:17
Unexpected exception
Traceback (most recent call last):
File "/config/custom_components/snoo/config_flow.py", line 52, in async_step_user
info = await validate_input(self.hass, user_input)
File "/config/custom_components/snoo/config_flow.py", line 36, in validate_input
result = await hass.async_add_executor_job(
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/snoo/config_flow.py", line 22, in fetch_token
client.auth["password"] = password
File "/usr/local/lib/python3.10/configparser.py", line 1263, in __setitem__
return self._parser.set(self._name, key, value)
File "/usr/local/lib/python3.10/configparser.py", line 1205, in set
super().set(section, option, value)
File "/usr/local/lib/python3.10/configparser.py", line 895, in set
value = self._interpolation.before_set(self, section, option,
File "/usr/local/lib/python3.10/configparser.py", line 402, in before_set
raise ValueError("invalid interpolation syntax in %r at "
ValueError: invalid interpolation syntax in '6MaN5dxxxxxxcjSW8%dk' at position 17
It only gives me 3 entities though and no control functionality despite using the pubnub api which does have control functionality. Curious if anyone has more working currently?
The pubnub api itself seems to, but the integration doesnāt utilise everything. It needs some work and iām eager to do it, but have little experience with python.
Thanks, do I have to install your pysnoo any way to make it work? I tried just doing your integration through Hacs but get an error when trying to add my snoo as a device. āConfig flow could not be loadedā
This was working for me a few times but it seems the integration needs to be reloaded after a little bit in order to pick up state changes with the snoo. Any idea what that could be?
Iām trying to use mine every day with the baby to log itās usage and notifications, and it requires a reload before each use. So itās defintely timing out somehwere.
Probably this:
Logger: pysnoo2.oauth2_session
Source: runner.py:188
First occurred: April 6, 2024 at 7:54:42 PM
(1314524 occurrences)
Last logged: 1:00:47 PM
Yeah, logs show that the token expires 3 hours after login. I donāt see a way to refresh the token manually without reloading the integration. Not sure if @w00tadude has a way to do that via pysnoo2.
I think that the nature of Snoo usage means that the integration support is spottyāenterprising dev parents try to get the thing running and then (reasonably) abandon the project once their kid outgrows the Snoo. Iāve been poking around the various options and thought Iād share the current state of affairs, in the hopes that it will save future users some time.
@droansās scripts (shared in this issue in the sanghviharshit repo)
Pros:
Only option that allows you to control the Snoo, as far as I know.
Reliable
Cons:
Most involved installation (but really not so bad). In short, you have to retrieve your serial number (though I think you could just get it from the app instead), install Pyscript, drop in the script, manually replace the email/passwords, and add some template entities.
Only fetches Snoo status at set intervals (default is every 5m, which is fine.)
As just posted here, the token expires after a few hours. You can get around this by writing an automation to call homeassistant.reload_config_entry every 2 hours, but itās a bit of a pain and causes a break in the state of the entities.
Can only read, not control the Snoo.
Dev @thedan is kindly merging PRs from me and @w00tadude but is, I think, otherwise not actively developing or using the Snoo.
Broken, as far as I can tell. Hasnāt had a commit in years.
So at the moment, I would say go with the @droans scripts. I would supplement it with these template sensors, which will allow you to track the length of the current sleep session and look back at the session history.
template:
- binary_sensor:
- name: "Snoo active"
unique_id: snoo_active
state: "{{ states('sensor.snoo_status') not in ['ONLINE', 'TIMEOUT'] }}"
availability: "{{ states('sensor.snoo_status') not in ['unknown', 'unavailable', 'none'] }}"
- sensor:
- name: "Time in current Snoo session (h)"
unique_id: hours_in_snoo_session
state: >-
{% set secs = 0 if states('binary_sensor.snoo_active')=='off' else now().timestamp() - states.binary_sensor.snoo_active.last_changed.timestamp() %}
{{ secs / 60 / 60 }}
unit_of_measurement: h
device_class: duration
state_class: measurement
availability: "{{ states('sensor.snoo_status') not in ['unknown', 'unavailable', 'none'] }}"