Code Monkey home page Code Monkey logo

ha-emfitqs's Introduction

Emfit QS Sleep Tracker Component for Home Assistant

This component provides real-time data polled directly from Emfit QS Sleep Tracker devices. Useful for automations based on bed presence and sleep detection (via heart rate bpm levels).

Sensor Card

NOTE: This component has only been tested with Emfit QS firmware version 120.2.2.1.

Supported Features

  • Bed Presence binary sensor
  • Time in Bed (seconds)
  • Heart Rate BPM sensor
  • Respiratory Rate sensor
  • Activity Level sensor

IMPORTANT: Your Emfit QS device must be accessible by Home Assistant on your local area network.

Installation

HACS Installation

hacs_badge This repository is part of the default HACS store. Search for the "Emfit QS Sleep Tracker" component in HACS and install it from there.

Manual Installation

Copy the custom_components/ha-emfitqs directory into your /config/custom_components directory.

Component Configuration

Add the following to your configuration.yaml file:

sensor:
  - platform: emfitqs
    host: 192.168.1.x # Replace with your Emfit QS device IP Address.
    scan_interval: 10
    resources:
      - heart_rate
      - respiratory_rate
      - activity_level
      - seconds_in_bed

binary_sensor:
  - platform: emfitqs
    host: 192.168.1.x # Replace with your Emfit QS device IP Address.
    scan_interval: 10
    monitored_conditions:
      - bed_presence

Sensor Resources & Monitored Conditions

Name Type Description
bed_presence binary_sensor Bed presence
heart_rate sensor Heart rate (BPM)
respiratory_rate sensor Respiratory rate (BPM)
activity_level sensor Activity level
seconds_in_bed sensor Number of seconds in bed

NOTE: In Home Assistant, the component sensor names include the device serial number, for example binary_sensor.emfitqs_012345_bed_presence and sensor.emfitqs_012345_heart_rate where "012345" is the device serial numer. This allows you to add multiple entries in your config file.

ha-emfitqs's People

Contributors

jxlarrea avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ha-emfitqs's Issues

Unique ID

How would I go about adding a unique ID for the various entities from my Emit QS? I'd like to do so in order to be able to assign the entities to different areas. Without a unique ID, it won't let me do much of anything.

Have you seen the EMFIT API?

Hey there!

Hope you are keeping well. Thankyou for your work on this component, it has been working perfectly!

I just came across this : https://github.com/samuelmr/emfit-qs and was wondering if you had seen it? I've had some success using postman to login using get https://qs-api.emfit.com/api/v1/login?username=[]&password=[] to get my token then get https://qs-api.emfit.com/api/v1/presence/device_id/latest? returns a lot of information about the latest sleep scores and trends etc. It would be amazing to be able to pull in things like the sleep score and HRV readings. I'm only a novice with these things, considering using node red to help me get some of the data into Hassio. Any chance you would be interested in adding/using this in the component?

Binary sensor stopped working recently

The debug output seems to still be the same

homeassistant_1  | 2022-01-27 23:11:56 DEBUG (SyncWorker_5) [custom_components.emfitqs.sensor] Data = {'ser': '001122', 'ts': '1643346685', 'ts_r': '6456615', 'pres': '0', 'hr': '0', 'hr_dm': '0', 'rr': '0.0', 'rr_dm': '0', 'act': '0', 'act_dm': '0', 'fw': 't120 v2.2.1', 'end': '1'}

however, the binary sensors no longer show up in home assistant.

Error ocurred: KeyError('ser')

First off, thanks for your work on this integration! I find that sometimes the integration starts up fine, and other times I get the error below in the logs and the emfit sensors do not show up. It seems random whether this will work or not during any given restart. My emfit device is not changing IPs or anything like that. I can't find any reason why sometimes this works just fine and other times I get this error.

Error ocurred: KeyError('ser')
8:48:21 AM โ€“ (ERROR) emfitqs (custom integration)

Error ocurred: ConnectionError(MaxRetryError("HTTPConnectionPool(host='10.10.10.225', port=80): Max retries exceeded with url: /dvmstatus.htm (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f9608ad40>: Failed to establish a new connection: [Errno 113] Host is unreachable'))"))
8:48:21 AM โ€“ (ERROR) emfitqs (custom integration)

The emfit device seems available on my network at the IP referenced whether it works or not, I believe it has something to do with that first "KeyError('ser')".

Have you seen this before?

Integration not loading, mutliple errors

Hey there,

Thanks for your work on this integration! I just got my emfit and have been really looking forward to getting it integrated into hassio. I just gave your custom component a go, but seem to be having trouble.

I'm running Home Assistant 2021.1.4 using the docker script on an old ubuntu laptop.

Got a bunch of errors in the log:

Logger: homeassistant.components.binary_sensor Source: components/binary_sensor/__init__.py:172 Integration: Binary Sensor (documentation, issues) First occurred: 14:47:10 (1 occurrences) Last logged: 14:47:10 BinarySensorDevice is deprecated, modify EmfitQSBinarySensor to extend BinarySensorEntity

Logger: homeassistant.setup Source: setup.py:138 First occurred: 14:47:10 (1 occurrences) Last logged: 14:47:10 Setup failed for emfitqs: No setup function defined

Logger: custom_components.emfitqs.binary_sensor Source: custom_components/emfitqs/binary_sensor.py:81 Integration: emfitqs (documentation) First occurred: 14:47:14 (1 occurrences) Last logged: 14:47:14 Error ocurred: ConnectionError(MaxRetryError("HTTPConnectionPool(host='192.168.1.3', port=80): Max retries exceeded with url: /dvmstatus.htm (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fdeceacbf70>: Failed to establish a new connection: [Errno 113] Host is unreachable'))"))

Logger: custom_components.emfitqs.binary_sensor Source: custom_components/emfitqs/binary_sensor.py:51 Integration: emfitqs (documentation) First occurred: 14:47:14 (1 occurrences) Last logged: 14:47:14 Error ocurred: KeyError('ser')

Any ideas/suggestions would be greatly appreciated!! Would be great to get this going!

Not working anymore?

I have HA core-2021.12.8, supervisor-2021.12.2 and Home Assistant OS 7.1.

After installing via HACS, i then input the required info in the configuration.yaml.

I however get the following error messages during a configuration check:

Integration error: emfitqs - Integration 'emfitqs' not found.
Platform error sensor.emfitqs - Integration 'emfitqs' not found.
Platform error binary_sensor.emfitqs - Integration 'emfitqs' not found.

Looks like its installed correctly in HACS, Any ideas? Maybe a HA update broke this integration?

Can't add to HA

I'm getting an error when adding via HACS to HA

image

If I try add directly, it says to add via config. If I add via config, it errors like above.

My config is:

emfitqs:

sensor:
  - platform: emfitqs
    host: 192.168.86.193 # Replace with your Emfit QS device IP Address.
    scan_interval: 10
    resources:
      - heart_rate
      - respiratory_rate
      - activity_level
      - seconds_in_bed

binary_sensor:
  - platform: emfitqs
    host: 192.168.86.193 # Replace with your Emfit QS device IP Address.
    scan_interval: 10
    monitored_conditions:
      - bed_presence

Versions of things:

Core: 2024.1.3
Supervisor: 2023.12.1
Operating System: 11.4
Frontend: 20240104.0

Not working with latest HA 2022.2.1

Stopped working with latest HA.
Get the following error message when checking configuration:

Platform error binary_sensor.emfitqs - cannot import name 'BinarySensorDevice' from 'homeassistant.components.binary_sensor' (/usr/src/homeassistant/homeassistant/components/binary_sensor/init.py)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.