p

package module
v0.0.0-...-6a91424 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2021 License: MIT Imports: 9 Imported by: 0

README

home-assistant-to-big-query

Why ?

Thanks to this project, you will link your the data from your HomeAssistant to BigQuery

Prerequisite

Quick start

Deploy this project as a Google Cloud Function in your GCP Project. This function is triggered by the event pushed by home assistant. It needs 3 environment variables :

  • GCP_PROJECTID
  • BIGQUERY_DATASET
  • BIGQUERY_TABLE

Tutorial

A complete tutorial (in french) is available at https://blog.bodul.fr/2021/10/17/home-assistant-vers-pubsub-vers-bigquery-vers-datastudio/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Main

func Main(ctx context.Context, m PubSubMessage) error

Main consumes a Pub/Sub message.

Types

type HomeAssistantBigquery

type HomeAssistantBigquery struct {
	State       float64   `bigquery:"state"`
	LastChanged time.Time `bigquery:"occured_at"`
	EntityId    string    `bigquery:"entity_id"`
}

type HomeAssistantMessage

type HomeAssistantMessage struct {
	State       string `json:"state"`
	LastChanged string `json:"last_changed"`
	EntityId    string `json:"entity_id"`
}

type PubSubMessage

type PubSubMessage struct {
	Data []byte `json:"data"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL