Integration with Home Assistant

Feature A

Here’s the sales pitch: Home Assistant is an open source program which brings together all your smart and IoT devices and allows to track, record, automate basically anything.
Example:
Plug your dishwasher into a cheap power measuring plug and then add an electricity usage threshold sensor in home assistant. This way you can detect if the dish washer is running or if it finished. You can then send a notification to your smart phone telling you it’s done.

You could also have it add a +1 to your “Run the dish washer daily” goal on Beeminder :wink:

Feature B

Home Assistant also has powerful dashboard where you can combine all your devices, sensors, arbitrary RSS feeds, etc. into a nice to look at dashboard that you can interact with. Some people even put up a tablet on the wall showing this dash board 24/7 so they have an overview of their house, energy consumption, the weather forecast, etc.
Imagine having Beeminder goals as part of that dashboard! Things like that are actually really common. For instance, Home Assistant integrates with a lot of routers showing which devices are currently in the network. Or as mentioned previously: It, by default, shows the weather forecast for your location as part of the dashboard. You can also easily integrate an RSS feed and use jinja2 for turning that into markdown which in turn is rendered nicely in the dashboard.

I’d love to see both a) and b) done :wink:

3 Likes

a) I was thinking to set up a goal for airing my apartment and sending the open status of a window to Beeminder.

b) As far as I know you can display user defined images from the internet. Displaying your Beeminder graph should be possible.

Well you can write custom addons and integrations and those can of course provide their own custom rendering in the dashboard.
I am indeed hoping that enough people say this sounds cool so that @dreev puts it on the “integrations to add” list.

I like it!

I made this which just pulls in your beeminder stats as sensors: GitHub - wstewarttennes/hass-beeminder: Beeminder Integration for Home Assistant

5 Likes

IDK if anyone will want this but just wanted to add some updates here of what I built in case it’s useful to someone – I’ve updated this integration so you can use your home assistant voice pipeline to add data points and ask about data points. You can say things like “Add 20 pushups to beeminder” and if you have a goal named pushups it will create a data point for today of 20. You can also ask it if you’re going to derail on something or more general questions about your goals. Note that I’m using Extended OpenAI Conversation, so not sure how it fits into other setups. I’m using this config:

- spec:
    name: add_beeminder_data
    description: Immediately add data to a Beeminder goal without asking for confirmation. Just do it and confirm completion.
    parameters:
      type: object
      properties:
        goal:
          type: string
          description: The Beeminder goal name like pushups, coding, weight
        value:
          type: number
          description: The numeric value to add
      required:
      - goal
      - value
  function:
    type: script
    sequence:
    - service: script.add_beeminder_datapoint
      data:
        goal: "{{ goal }}"
        value: "{{ value }}"
        comment: "Added via voice AI"
- spec:
    name: get_beeminder_status
    description: Get information about Beeminder goals status, which ones are derailing, safe, etc. Use this when user asks about their Beeminder goals status.
    parameters:
      type: object
      properties:
        status_type:
          type: string
          description: Type of status to check
          enum:
            - derailing_today
            - derailing_soon
            - safe
            - all
          default: all
  function:
    type: script
    sequence:
    - service: script.get_beeminder_status
      data:
        status_type: "{{ status_type | default('all') }}"
      response_variable: result
    - stop: "{{ result.beeminder_status }}"
3 Likes

Oh that’s interesting.

I’ll check out your integration, I’ve been using beeminder with home assistant via a curl script for a long time - it automatically tracks how much time I’ve spent walking on the treadmill.

shell_command:
beeminder: curl --retry 200   --retry-all-errors --retry-connrefused  -X POST -d ‘auth_token=token_goes_here&value={{ value }}&comment={{ comment }}’ https://www.beeminder.com/api/v1/users/jolly/goals/{{ goal }}/datapoints.json
or
beeminderd: curl --retry 200   --retry-all-errors --retry-connrefused  -X POST -d ‘auth_token=token_goes_here&value={{ value }}&daystamp={{ daystamp }}&comment={{ comment }}’ https://www.beeminder.com/api/v1/users/jolly/goals/{{ goal }}/datapoints.json
1 Like

FYI, I love home assistant, but having all that data as sensor attributes is going to slam the database. (I tried the integration for a bit)