Skip to content

kristianwh/sectoralarm

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sector alarm

Get the current status of your home alarm if you have the Norwegian provider Sector Alarm. The two calls are getting the current status and retreiving the log. Very slightly modified version of https://github.com/the-louie/sectoralarm, to work in Norway.

Configuration

You need to supply your login email (username), password and the site-id of the site you want to retrieve information about. Rename the file config_example.py to config.py.

Example configuration

email = 'mylogin@email.com'
password = 'secretpassword'
siteid = '12345678'

Calls

event_log()

Retrieves the last 30 events in the event log and returns a list with dict. It does some guesswork to convert the dates to sane ones.

[
	{
		"timestamp": "2016-02-15 23:17:00",
		"event": "Tilkoblet",
		"user": "Person A"
	}, {
		"timestamp": "2016-02-15 20:38:00",
		"event": "Strömfel (återställt)"
	}, {
		"timestamp": "2016-02-15 20:16:00",
		"event": "Strömfel"
	}, {
		"timestamp": "2016-02-15 17:09:00",
		"event": "Frakoblet",
		"user": "Person B"
	}, {
		"timestamp": "2016-02-15 08:31:00",
		"event": "Tilkoblet",
		"user": "Person B"
	}, {
		"timestamp": "2016-02-15 05:40:00",
		"event": "Frakoblet",
		"user": "Person C"
	}, {
		"timestamp": "2016-02-14 23:23:00",
		"event": "Tikoblet",
		"user": "Person A"
	}, {
		"timestamp": "2016-02-14 19:24:00",
		"event": "Frakoblet",
		"user": "Person C"
	}
]

status()

Retrieves the current status, timestamp and name of the person who changed the status.

{
	"event": "Tillkopplat",
	"user": "Person A",
	"timestamp": "2016-02-14 23:17:00"
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%