Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indego binding #1

Merged
merged 11 commits into from
Aug 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions addons/binding/org.openhab.binding.boschindego/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry exported="true" kind="lib" path="lib/bosch-indego-controller-lib-0.8-jar-with-dependencies.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/main/java"/>
<classpathentry kind="output" path="target/classes"/>
</classpath>
1 change: 1 addition & 0 deletions addons/binding/org.openhab.binding.boschindego/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.DS_Store
33 changes: 33 additions & 0 deletions addons/binding/org.openhab.binding.boschindego/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.openhab.binding.boschindego</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ds.core.builder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<binding:binding id="boschindego"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:binding="http://eclipse.org/smarthome/schemas/binding/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/binding/v1.0.0 http://eclipse.org/smarthome/schemas/binding-1.0.0.xsd">

<name>BoschIndego Binding</name>
<description>This is the binding for Bosch Indego Connect lawn mowers.</description>
<author>Jonas Fleck</author>

</binding:binding>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# binding
binding.boschindego.name = <Your localized Binding name>
binding.boschindego.description = <Your localized Binding description>

# thing types
thing-type.boschindego.sample.label = <Your localized Thing label>
thing-type.boschindego.sample.description = <Your localized Thing description>

# channel types
channel-type.boschindego.sample-channel.label = <Your localized Channel label>
channel-type.boschindego.sample-channel.description = <Your localized Channel description>
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<thing:thing-descriptions bindingId="boschindego"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:thing="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0"
xsi:schemaLocation="http://eclipse.org/smarthome/schemas/thing-description/v1.0.0 http://eclipse.org/smarthome/schemas/thing-description-1.0.0.xsd">

<!-- Sample Thing Type -->
<thing-type id="indego">
<label>Bosch Indego</label>
<description>Indego which supports the connect feature.</description>
<channels>
<channel id="state" typeId="state"/>
<channel id="textualstate" typeId="textualstate"/>
<channel id="errorcode" typeId="errorcode"/>
<channel id="statecode" typeId="statecode"/>
<channel id="mowed" typeId="mowed"/>
<channel id="ready" typeId="ready"/>
</channels>
<config-description>
<parameter name="username" type="text" required="true">
<label>Username</label>
<description>Username for the Bosch Indego account.</description>
</parameter>
<parameter name="password" type="text" required="true">
<label>Password</label>
<description>Password for the Bosch Indego account.</description>
</parameter>
<parameter name="refresh" type="integer" min="60">
<label>Refresh interval</label>
<description>Specifies the refresh interval in seconds.</description>
<default>180</default>
</parameter>
</config-description>
</thing-type>

<!-- Sample Channel Type -->
<channel-type id="state">
<item-type>Number</item-type>
<label>Numeric state of the Indego</label>
<description>1 = mow, 2 = charging/docked, 3 = paused.</description>
</channel-type>
<channel-type id="errorcode">
<item-type>Number</item-type>
<label>Numeric state of the error</label>
<description>0 = no error</description>
</channel-type>
<channel-type id="statecode">
<item-type>Number</item-type>
<label>API-code of the Indego state</label>
<description></description>
</channel-type>
<channel-type id="textualstate">
<item-type>String</item-type>
<label>Textual state of the Indego</label>
<description></description>
<state readOnly="true" />
</channel-type>
<channel-type id="mowed">
<item-type>Number</item-type>
<label>Percent of cut grass</label>
<description></description>
</channel-type>
<channel-type id="ready">
<item-type>Number</item-type>
<label>Indicates if mower is ready 1 = ready, 0 = not ready</label>
<description></description>
</channel-type>

</thing:thing-descriptions>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: BoschIndego Binding
Bundle-SymbolicName: org.openhab.binding.boschindego;singleton:=true
Bundle-Vendor: openHAB
Bundle-Version: 2.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ClassPath: .,
lib/bosch-indego-controller-lib-0.8-jar-with-dependencies.jar
Import-Package:
org.eclipse.smarthome.config.core,
org.eclipse.smarthome.core.library.types,
org.eclipse.smarthome.core.thing,
org.eclipse.smarthome.core.thing.binding,
org.eclipse.smarthome.core.thing.binding.builder,
org.eclipse.smarthome.core.thing.type,
org.eclipse.smarthome.core.types,
org.openhab.binding.boschindego,
org.openhab.binding.boschindego.handler,
org.slf4j
Service-Component: OSGI-INF/*.xml
Export-Package: org.openhab.binding.boschindego,
org.openhab.binding.boschindego.handler
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

Copyright (c) 2014-2016 by the respective copyright holders.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html

-->
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" immediate="true" name="binding.boschindego">

<implementation class="org.openhab.binding.boschindego.internal.BoschIndegoHandlerFactory"/>

<service>
<provide interface="org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory"/>
</service>

</scr:component>
45 changes: 45 additions & 0 deletions addons/binding/org.openhab.binding.boschindego/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Bosch Indego Binding

This is the Binding for Bosch Indego Connect lawn mowers.

Thank´s to zazaz-de who found out how the API works. His [Java Library](https://github.com/zazaz-de/iot-device-bosch-indego-controller) made this Binding possible.

## Configuration of the thing


Currently the binding supports ***indego*** mowers as a thing type with this parameters:

| parameter | datatype | required |
|:-: |:-:| :-:|
| username | String | yes |
| password | String | yes |
| refresh | integer| no (default: 180, minimum: 60)|

The refresh interval is specified in seconds.

A possible entry in your thing file could be:

```
boschindego:indego:lawnmower [username="[email protected]", password="idontneedtocutthelawnagain", refresh=120]
```


## Channels

channel | item-type | description |
|:-: |:-:| :-:|
| state | Number | You can send commands to this channel to control the mower and read the simplified state from it (1=mow, 2=return to dock, 3=pause)|
| errorcode | Number | Errorcode of the mower (0=no error, readonly) |
| statecode | Number | Detailed state of the mower. I included English and German map-files to read the state easier (readonly)|
|textualstate| String| State as a text. (readonly)|
|ready | Number | Shows if the mower is ready to mow (1=ready, 0=not ready, readonly)|


For example you can use this sitemap entry to control the mower manually:

```
Switch item=indegostate mappings=[ 1="Mow", 2="Return",3="Pause" ]
```



15 changes: 15 additions & 0 deletions addons/binding/org.openhab.binding.boschindego/about.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<h3>Third Party Content</h3>
<ul>
<li><a href="https://github.com/zazaz-de/iot-device-bosch-indego-controller/">API for Bosch Indego Connect</a>: Controller application and API for Bosch Indego Connect, under Apache 2.0 license</li>
</ul>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
source.. = src/main/java/
output.. = target/classes
bin.includes = META-INF/,\
.,\
OSGI-INF/,\
ESH-INF/,\
lib/bosch-indego-controller-lib-0.8-jar-with-dependencies.jar

23 changes: 23 additions & 0 deletions addons/binding/org.openhab.binding.boschindego/deindego.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
0=Status lesen
257=Laden
258=Angedockt
259=Angedockt - Software update
260=Angedockt
261=Angedockt
262=Angedockt - Karte laden
263=Angedockt - Karte speichern
513=Mäht
514=Orientierung
515=Karte laden
516=Kartieren
517=Pause
518=Randschnitt
519=Mäher steht
769=Andocken
770=Andocken
771=Andocken - Akku schwach
772=Andocken - Kalender Zeitraum beendet
773=Andocken - Akku außerhalb des Temperaturbereichs
774=Andocken
775=Andocken - Fertig gemäht
776=Andocken - Orientierung
23 changes: 23 additions & 0 deletions addons/binding/org.openhab.binding.boschindego/enindego.map
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
0=Reading status
257=Charging
258=Docked
259=Docked - Software update
260=Docked
261=Docked
262=Docked - Loading map
263=Docked - Saving map
513=Mowing
514=Relocalising
515=Loading map
516=Learning lawn
517=Paused
518=Border cut
519=Idle in lawn
769=Returning to Dock
770=Returning to Dock
771=Returning to Dock - Battery low
772=Returning to dock - Calendar timeslot ended
773=Returning to dock - Battery temp range
774=Returning to dock
775=Returning to dock - Lawn complete
776=Returning to dock - Relocalising
Binary file not shown.
19 changes: 19 additions & 0 deletions addons/binding/org.openhab.binding.boschindego/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.openhab.binding</groupId>
<artifactId>pom</artifactId>
<version>2.0.0-SNAPSHOT</version>
</parent>

<groupId>org.openhab.binding</groupId>
<artifactId>org.openhab.binding.boschindego</artifactId>
<version>2.0.0-SNAPSHOT</version>

<name>BoschIndego Binding</name>
<packaging>eclipse-plugin</packaging>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/**
* Copyright (c) 2014-2015 openHAB UG (haftungsbeschraenkt) and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*/
package org.openhab.binding.boschindego;

import org.eclipse.smarthome.core.thing.ThingTypeUID;

/**
* The {@link BoschIndegoBinding} class defines common constants, which are
* used across the whole binding.
*
* @author Jonas Fleck - Initial contribution
*/
public class BoschIndegoBindingConstants {

public static final String BINDING_ID = "boschindego";

// List of all Thing Type UIDs
public final static ThingTypeUID THING_TYPE_INDEGO = new ThingTypeUID(BINDING_ID, "indego");

// List of all Channel ids
public final static String STATE = "state";
public final static String TEXTUAL_STATE = "textualstate";
public final static String MOWED = "mowed";
public final static String ERRORCODE = "errorcode";
public final static String STATECODE = "statecode";
public final static String READY = "ready";

}
Loading