enocean

package module
v0.0.0-...-7699208 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2016 License: MIT Imports: 3 Imported by: 0

README

enocean

Tools for EnOcean protocol

References

Copyright 2015 Kazutaka Ogaki [email protected]

Licensed under the MIT License

Samples

mqttworker.go
go run mqttworker.go loop --host broker.hostname --sub 'prefix/enoceangateway/topic' --pub 'prefix/worker/enocean/publish'

sample outputs

INFO[0000] Broker URI: tcp://broker.hostname          
INFO[0000] Sub Topic: prefix/enoceangateway/topic                     
INFO[0000] Pub Topic: prefix/worker/enocean/publish     
INFO[0000] connecting...                                
INFO[0000] client connected                             
INFO[0038] topic:prefix/enoceangateway/topic msg:U

?"OB?=? 
{"RawData": "{165 0 0 0 false [4 0 79 66] [] [0 0 50 8] 61}", "TeachIn": false, "manufactuererId": "MANUFACTURER_RESERVED", "temperature": 32}
INFO[0038] published: %v, to topic: %v{"RawData": "{165 0 0 0 false [4 0 79 66] [] [0 0 50 8] 61}", "TeachIn": false, "manufactuererId": "MANUFACTURER_RESERVED", "temperature": 32}prefix/worker/enocean/publish 
^Csignal: interrupt

subscriber output

$ mosqutto_sub -t "#" -d
Client mosqsub/hostname received PUBLISH (d0, q0, r0, m0, 'prefix/worker/enocean/publish', ... (142 bytes))

{"RawData": "{165 0 0 0 false [4 0 79 66] [] [0 0 50 8] 61}", "TeachIn": false, "manufactuererId": "MANUFACTURER_RESERVED", "temperature": 32}

Documentation

Index

Constants

View Source
const (
	SyncByte         byte = 0x55
	ESPHeaderLength       = 6
	ESPCRCLength          = 1
	ESP3PacketType10      = 10
)
View Source
const (
	MANUFACTURER_RESERVED                  byte = 0x00
	PEHA                                   byte = 0x01
	THERMOKON                              byte = 0x02
	SERVODAN                               byte = 0x03
	ECHOFLEX_SOLUTIONS                     byte = 0x04
	OMNIO_AG                               byte = 0x05
	HARDMEIER_ELECTRONICS                  byte = 0x06
	REGULVAR_INC                           byte = 0x07
	AD_HOC_ELECTRONICS                     byte = 0x08
	DISTECH_CONTROLS                       byte = 0x09
	KIEBACK_AND_PETER                      byte = 0x0A
	ENOCEAN_GMBH                           byte = 0x0B
	PROBARE                                byte = 0x0C
	ELTAKO                                 byte = 0x0D
	LEVITON                                byte = 0x0E
	HONEYWELL                              byte = 0x0F
	SPARTAN_PERIPHERAL_DEVICES             byte = 0x10
	SIEMENS                                byte = 0x11
	T_MAC                                  byte = 0x12
	RELIABLE_CONTROLS_CORPORATION          byte = 0x13
	ELSNER_ELEKTRONIK_GMBH                 byte = 0x14
	DIEHL_CONTROLS                         byte = 0x15
	BSC_COMPUTER                           byte = 0x16
	S_AND_S_REGELTECHNIK_GMBH              byte = 0x17
	MASCO_CORPORATION                      byte = 0x18
	INTESIS_SOFTWARE_SL                    byte = 0x19
	VIESSMANN                              byte = 0x1A
	LUTUO_TECHNOLOGY                       byte = 0x1B
	SCHNEIDER_ELECTRIC                     byte = 0x1C
	SAUTER                                 byte = 0x1D
	BOOT_UP                                byte = 0x1E
	OSRAM_SYLVANIA                         byte = 0x1F
	UNOTECH                                byte = 0x20
	DELTA_CONTROLS_INC                     byte = 0x21
	UNITRONIC_AG                           byte = 0x22
	NANOSENSE                              byte = 0x23
	THE_S4_GROUP                           byte = 0x24
	MSR_SOLUTIONS                          byte = 0x25
	GE                                     byte = 0x26
	MAICO                                  byte = 0x27
	RUSKIN_COMPANY                         byte = 0x28
	MAGNUM_ENERGY_SOLUTIONS                byte = 0x29
	KMC_CONTROLS                           byte = 0x2A
	ECOLOGIX_CONTROLS                      byte = 0x2B
	TRIO_2_SYS                             byte = 0x2C
	AFRISO_EURO_INDEX                      byte = 0x2D
	NEC_ACCESSTECHNICA_LTD                 byte = 0x30
	ITEC_CORPORATION                       byte = 0x31
	SIMICX_CO_LTD                          byte = 0x32
	EUROTRONIC_TECHNOLOGY_GMBH             byte = 0x34
	ART_JAPAN_CO_LTD                       byte = 0x35
	TIANSU_AUTOMATION_CONTROL_SYSTE_CO_LTD byte = 0x36
	GRUPPO_GIORDANO_IDEA_SPA               byte = 0x38
	ALPHAEOS_AG                            byte = 0x39
	TAG_TECHNOLOGIES                       byte = 0x3A
	CLOUD_BUILDINGS_LTD                    byte = 0x3C
	GIGA_CONCEPT                           byte = 0x3E
	SENSORTEC                              byte = 0x3F
	JAEGER_DIREKT                          byte = 0x40
	AIR_SYSTEM_COMPONENTS_INC              byte = 0x41
	MULTI_USER_MANUFACTURER                int  = 0x7FF
)

constants for Manufacturers ID

Variables

This section is empty.

Functions

func CRC8

func CRC8(vec []byte) byte

func GetManufacturerName

func GetManufacturerName(id int) (error, string)

func ToJSON

func ToJSON(e ESPData) ([]byte, error)

Types

type ERP2

type ERP2 struct {
	Length byte
	Body   ERP2inESP3
}

type ERP2Payload

type ERP2Payload struct {
	PayloadType byte
	Identifier  []byte
	Data        []byte
	CRC8        byte
}

type ERP2inESP3

type ERP2inESP3 struct {
	ERP2Header       byte
	ERP2ExtendHeader []byte
	Payload          []byte
}

type ESPData

type ESPData struct {
	RORG           byte
	FUNC           byte
	TYPE           byte
	ManufacturerId int
	TeachIn        bool
	OriginatorId   []byte
	DestinationId  []byte
	PayloadData    []byte
	RSSI           byte // raw data (without minus sign)
}

func NewESPData

func NewESPData(src []byte) (error, int, ESPData)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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