Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use this library for the Home Assistant project #4

Open
DCSBL opened this issue Mar 22, 2022 · 13 comments
Open

Use this library for the Home Assistant project #4

DCSBL opened this issue Mar 22, 2022 · 13 comments

Comments

@DCSBL
Copy link

DCSBL commented Mar 22, 2022

I think it is easy to implement things like 'battery' and 'device_tracker' for VanMoof into Home Assistant with this library. https://www.home-assistant.io

I have some experience with developing an integration in HA. Maybe we can pull this off, what do you think?

@MPeek1995
Copy link

I would be in huge favor for this! I've been thinking about making a pi somewhere close to where i park my bike and then with the help of this code and mqtt send this to my HA instance. However im not sure if the pi will just connect once the bike is within reach and start sending as only 1 app can be connected and i would like to use my moofer app as well. Or could it be possible to make the data being pulled from the Vanmoof servers ? that would be the optimal solution

@speedy-c
Copy link

speedy-c commented Sep 4, 2022

any progress perhaps? i'm able to connect my vanmoof with an esp-board and esphome and get some data, but I haven't got a clou to use it for Home Assistant

@MPeek1995
Copy link

What data where you able to extract? With an mqtt component or directly through esphome we can fetch the data to ha and create some sensors

@speedy-c
Copy link

speedy-c commented Sep 4, 2022

[12:25:24][I][ble_client:170]: Service UUID: 0x1800
[12:25:24][I][ble_client:171]: start_handle: 0x1 end_handle: 0xb
[12:25:24][I][ble_client:383]: characteristic 0x2A00, handle 0x3, properties 0xa
[12:25:24][I][ble_client:383]: characteristic 0x2A01, handle 0x5, properties 0xa
[12:25:24][I][ble_client:383]: characteristic 0x2A04, handle 0x7, properties 0x2
[12:25:24][I][ble_client:383]: characteristic 0x2AA6, handle 0x9, properties 0x2
[12:25:24][I][ble_client:383]: characteristic 0x2AC9, handle 0xb, properties 0x2
[12:25:24][I][ble_client:170]: Service UUID: 0x1801
[12:25:24][I][ble_client:170]: Service UUID: 6ACC5500-E631-4069-944D-B8CA7598AD50
[12:25:24][I][ble_client:171]: start_handle: 0xd end_handle: 0x1a
[12:25:24][I][ble_client:383]: characteristic 6ACC5501-E631-4069-944D-B8CA7598AD50, handle 0xf, properties 0x2
[12:25:24][I][ble_client:383]: characteristic 6ACC5502-E631-4069-944D-B8CA7598AD50, handle 0x11, properties 0x8
[12:25:24][I][ble_client:383]: characteristic 6ACC5561-E631-4069-944D-B8CA7598AD50, handle 0x89, properties 0x52
[12:25:24][I][ble_client:383]: characteristic 6ACC5562-E631-4069-944D-B8CA7598AD50, handle 0x8c, properties 0x5a
[12:25:24][I][ble_client:383]: characteristic 6ACC5563-E631-4069-944D-B8CA7598AD50, handle 0x8f, properties 0x52
[12:25:24][I][ble_client:383]: characteristic 6ACC5564-E631-4069-944D-B8CA7598AD50, handle 0x92, properties 0x5a
`

@speedy-c
Copy link

Can the data be used for calculating battery status etc?

@speedy-c
Copy link

update: i gave up the idea of using an esp-board and bought an old pi and I managed to periodically read the battery status in home assistant with this addition https://github.com/thomasbaetge/Vanmoof-MQTT

@alinalihassan
Copy link

I'm also interested in that! I am currently trying to figure out if the connection is stable enough to get the data consistently out of the bike. The 1.8.1 sleep feature seems to break that idea without manually turning on the bike or just using the bike in general.

@speedy-c
Copy link

True, to fix that I also added a automation to switch on/off the power supply to wake up the bike. As long as it is plugged in, I can now automatically check and charge during the night

@djfanatix
Copy link

Any update on this? Did anyone got it working?

@djfanatix
Copy link

[12:25:24][I][ble_client:170]: Service UUID: 0x1800 [12:25:24][I][ble_client:171]: start_handle: 0x1 end_handle: 0xb [12:25:24][I][ble_client:383]: characteristic 0x2A00, handle 0x3, properties 0xa [12:25:24][I][ble_client:383]: characteristic 0x2A01, handle 0x5, properties 0xa [12:25:24][I][ble_client:383]: characteristic 0x2A04, handle 0x7, properties 0x2 [12:25:24][I][ble_client:383]: characteristic 0x2AA6, handle 0x9, properties 0x2 [12:25:24][I][ble_client:383]: characteristic 0x2AC9, handle 0xb, properties 0x2 [12:25:24][I][ble_client:170]: Service UUID: 0x1801 [12:25:24][I][ble_client:170]: Service UUID: 6ACC5500-E631-4069-944D-B8CA7598AD50 [12:25:24][I][ble_client:171]: start_handle: 0xd end_handle: 0x1a [12:25:24][I][ble_client:383]: characteristic 6ACC5501-E631-4069-944D-B8CA7598AD50, handle 0xf, properties 0x2 [12:25:24][I][ble_client:383]: characteristic 6ACC5502-E631-4069-944D-B8CA7598AD50, handle 0x11, properties 0x8 [12:25:24][I][ble_client:383]: characteristic 6ACC5561-E631-4069-944D-B8CA7598AD50, handle 0x89, properties 0x52 [12:25:24][I][ble_client:383]: characteristic 6ACC5562-E631-4069-944D-B8CA7598AD50, handle 0x8c, properties 0x5a [12:25:24][I][ble_client:383]: characteristic 6ACC5563-E631-4069-944D-B8CA7598AD50, handle 0x8f, properties 0x52 [12:25:24][I][ble_client:383]: characteristic 6ACC5564-E631-4069-944D-B8CA7598AD50, handle 0x92, properties 0x5a `

What code did you use in esphome?, i can't connect.

You need to decrypt the data later on

@speedy-c
Copy link

I used an esp-wroom-32 board to scan for Bluetooth devices and read the MAC adress of the bike than used an BLE client sensor to read the data.

@strehlma
Copy link

@speedy-c Can you provide any details on this?

@speedy-c
Copy link

I didn't save the original yaml but I use https://esphome.io/components/sensor/ble_client.html which resulted in the follow logfile. Hope this helps.

[17:43:16][C][ble_sensor:019]: BLE Sensor 'VanMoof battery level'
[17:43:16][C][ble_sensor:019]: State Class: ''
[17:43:16][C][ble_sensor:019]: Unit of Measurement: '%'
[17:43:16][C][ble_sensor:019]: Accuracy Decimals: 0
[17:43:16][C][ble_sensor:019]: Icon: 'mdi:battery'
[17:43:16][C][ble_sensor:020]: MAC address : ----
[17:43:16][C][ble_sensor:021]: Service UUID : 0x180F
[17:43:16][C][ble_sensor:022]: Characteristic UUID: 0x2A19
[17:43:16][C][ble_sensor:023]: Descriptor UUID : 00000000-0000-0000-0000-000000000000
[17:43:16][C][ble_sensor:024]: Notifications : NO
[17:43:16][C][ble_sensor:025]: Update Interval: 60.0s

[17:32:10][D][esp32_ble_tracker:723]: Found device ----- RSSI=-77
[17:32:10][D][esp32_ble_tracker:744]: Address Type: RANDOM
[17:32:10][D][esp32_ble_tracker:746]: Name: 'ES3------'

[17:49:01][I][ble_client:085]: Attempting BLE connection to -----
[17:49:01][I][ble_sensor:033]: [VanMoof battery level] Connected successfully!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants