goat-hill / bitclock

An e-ink desk companion
https://bitclock.io
MIT License
64 stars 6 forks source link

Support MQTT or Home Assistant #8

Open runty opened 3 months ago

runty commented 3 months ago

This would also make it easy to import into other home platforms

babldev commented 3 months ago

also requested by @glenrobertson

babldev commented 3 months ago

I hear Home Assistant has some time series features as well so maybe that will also help with https://github.com/goat-hill/bitclock/issues/3

runty commented 3 months ago

yes, automatically with graphing, many ways to show data, etc

dogshapedangel commented 2 months ago

This would be an extremely powerful addition. +1

dogshapedangel commented 2 months ago

It might be worth taking a look at the Aranet4's HA implementation as it actually uses Bluetooth (I think BLE specifically), granted this is only the HA half of that.

https://github.com/home-assistant/core/tree/dev/homeassistant/components/aranet https://www.home-assistant.io/integrations/aranet/

It would be ideal to have this data accessible via both Wi-Fi and Bluetooth but I can understand if pursuing one option first would be simpler.

dogshapedangel commented 1 month ago

@runty @glenrobertson If you are OK with forgoing display support in the interim, I have crafted an ESPHome config that allows you to run Bitclock with ESPHome firmware, sending data straight to Home Assistant.

https://github.com/manedfolf/bitclock/blob/esphome/bitclock-esphome/bitclock-esphome.yaml

It does not support the included display at this time since ESPHome doesn't have component support for the 2.71in Pervasive Displays E2271KS0C1 e-ink display. It would be possible to craft a custom component/driver for ESPHome, but that is admittedly not something I readily know how to do. It would still be very cool to be able to do custom screens directly within ESPHome. Granted, all of that is well outside of the scope of this project/repo so I have no expectation of support on this unless it piques the developer's interest.

Screenshot 2024-10-19 at 10 31 55 PM
babldev commented 1 month ago

@manedfolf nice work!

Pretty amazing you can do that with just a few lines in a YAML file

babldev commented 1 month ago

@manedfolf One thing to note is if you use direct sensor readings I assume you'll lose the "fudge factors" to correct temp + humidity.

https://github.com/goat-hill/bitclock/blob/d957f6439a1271d6ce122384d106790ee0d6c1c6/bitclock-fw/main/tasks/sht4x.c#L148-L164

https://github.com/goat-hill/bitclock/blob/d957f6439a1271d6ce122384d106790ee0d6c1c6/bitclock-fw/main/tasks/sht4x.c#L178-L192

dogshapedangel commented 1 month ago

@babldev I can’t speak to the actual code behind it, but I believe the library does include configuration options for some kind of compensations

https://esphome.io/components/sensor/sht4x.html

glenrobertson commented 1 day ago

@dogshapedangel I like the esphome solution you have! Before I discovered that, I put together these changes that will report data over MQTT in the homeassistant discovery message format: https://github.com/goat-hill/bitclock/pull/13

It would just need some changes to the web UI as well to accept an MQTT url.