Skip to content

Commit

Permalink
[luftdateninfo][sensorcommunity] Rename binding to Sensor.Community (o…
Browse files Browse the repository at this point in the history
…penhab#15012)

* [luftdateninfo][sensorcommunity] Rename binding to match the new name Sensor.Community

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
Signed-off-by: Jørgen Austvik <jaustvik@acm.org>
  • Loading branch information
holgerfriedrich authored and austvik committed Mar 27, 2024
1 parent 993faa6 commit 08f9144
Show file tree
Hide file tree
Showing 50 changed files with 240 additions and 239 deletions.
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
/bundles/org.openhab.binding.livisismarthome/ @Novanic
/bundles/org.openhab.binding.logreader/ @paulianttila
/bundles/org.openhab.binding.loxone/ @ppieczul
/bundles/org.openhab.binding.luftdateninfo/ @weymann
/bundles/org.openhab.binding.lutron/ @actong @bobadair
/bundles/org.openhab.binding.luxom/ @jesperskriasoft
/bundles/org.openhab.binding.luxtronikheatpump/ @sgiehl
Expand Down Expand Up @@ -301,6 +300,7 @@
/bundles/org.openhab.binding.seneye/ @nikotanghe
/bundles/org.openhab.binding.sensebox/ @hakan42
/bundles/org.openhab.binding.sensibo/ @seime
/bundles/org.openhab.binding.sensorcommunity/ @weymann
/bundles/org.openhab.binding.serial/ @MikeJMajor
/bundles/org.openhab.binding.serialbutton/ @kaikreuzer
/bundles/org.openhab.binding.shelly/ @markus7017
Expand Down
10 changes: 5 additions & 5 deletions bom/openhab-addons/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -901,11 +901,6 @@
<artifactId>org.openhab.binding.loxone</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.luftdateninfo</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.lutron</artifactId>
Expand Down Expand Up @@ -1496,6 +1491,11 @@
<artifactId>org.openhab.binding.sensibo</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.sensorcommunity</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.openhab.addons.bundles</groupId>
<artifactId>org.openhab.binding.serial</artifactId>
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# LuftdatenInfo Binding
# SensorCommunity Binding

Binding for the Sensor Community [luftdaten.info](https://luftdaten.info/). The community provides instructions to build sensors on your own and they can be integrated into the database.
Binding for the [Sensor.Community](https://sensor.community/).
The community provides instructions to build sensors on your own and they can be integrated into the database.
With this binding you can integrate your sensor, a sensor nearby or even any sensors you want into openHAB.

## Supported Things
Expand Down Expand Up @@ -30,18 +31,18 @@ Choose either a local IP address of your personal owned sensor _or_ a sensor id

Please check in your browser if you can access your sensor with your local IP address.

![Luftdaten.info Logo](doc/local-sensor.png)
![Sensor.Community Logo](doc/local-sensor.png)

### External Sensor

Perform the following steps to get the appropriate Sensor ID

- Go to to [luftdaten.info map](https://deutschland.maps.sensor.community/)
- Go to to [Sensor.Community map](https://deutschland.maps.sensor.community/)
- Choose your desired value in bottom list - now only the Sensors are displayed which are supporting this
- Click on your / any Sensor and the ID is displayed in the top right corner. Note: Sensor ID is just the number without beginning hash #
- Enter this Sensor ID into the thing configuration

![Luftdaten.info Logo](doc/LuftdatenInfo-Map.png)
![Sensor.Community Logo](doc/SensorCommunity-Map.png)

## Channels

Expand Down Expand Up @@ -73,38 +74,38 @@ Perform the following steps to get the appropriate Sensor ID

### Things

luftdaten.things
sensorcommunity.things

```java
Thing luftdateninfo:particulate:pm_sensor "PM Sensor" [ ipAddress=192.168.178.50 ]
Thing luftdateninfo:conditions:cond_sensor "Condition Sensor" [ sensorid=28843 ]
Thing luftdateninfo:noise:noise_sensor "Noise Sensor" [ sensorid=39745 ]
Thing sensorcommunity:particulate:pm_sensor "PM Sensor" [ ipAddress=192.168.178.50 ]
Thing sensorcommunity:conditions:cond_sensor "Condition Sensor" [ sensorid=28843 ]
Thing sensorcommunity:noise:noise_sensor "Noise Sensor" [ sensorid=39745 ]
```

### Items

luftdaten.items
sensorcommunity.items

```java
Number:Density PM_25 "PM2.5" { channel="luftdateninfo:particulate:pm_sensor:pm25" }
Number:Density PM_100 "PM10" { channel="luftdateninfo:particulate:pm_sensor:pm100" }
Number:Density PM_25 "PM2.5" { channel="sensorcommunity:particulate:pm_sensor:pm25" }
Number:Density PM_100 "PM10" { channel="sensorcommunity:particulate:pm_sensor:pm100" }

Number:Temperature LDI_Temperature "Temperature" { channel="luftdateninfo:conditions:cond_sensor:temperature" }
Number:Dimensionless LDI_Humidity "Humidity" { channel="luftdateninfo:conditions:cond_sensor:humidity" }
Number:Pressure LDI_Pressure "Atmospheric Pressure" { channel="luftdateninfo:conditions:cond_sensor:pressure" }
Number:Pressure LDI_PressureSea "Pressure sea level" { channel="luftdateninfo:conditions:cond_sensor:pressure-sea" }
Number:Temperature LDI_Temperature "Temperature" { channel="sensorcommunity:conditions:cond_sensor:temperature" }
Number:Dimensionless LDI_Humidity "Humidity" { channel="sensorcommunity:conditions:cond_sensor:humidity" }
Number:Pressure LDI_Pressure "Atmospheric Pressure" { channel="sensorcommunity:conditions:cond_sensor:pressure" }
Number:Pressure LDI_PressureSea "Pressure sea level" { channel="sensorcommunity:conditions:cond_sensor:pressure-sea" }

Number:Dimensionless LDI_NoiseEQ "Noise EQ" { channel="luftdateninfo:noise:noise_sensor:noise-eq" }
Number:Dimensionless LDI_NoiseMin "Noise min" { channel="luftdateninfo:noise:noise_sensor:noise-min" }
Number:Dimensionless LDI_NoiseMax "Noise max" { channel="luftdateninfo:noise:noise_sensor:noise-max" }
Number:Dimensionless LDI_NoiseEQ "Noise EQ" { channel="sensorcommunity:noise:noise_sensor:noise-eq" }
Number:Dimensionless LDI_NoiseMin "Noise min" { channel="sensorcommunity:noise:noise_sensor:noise-min" }
Number:Dimensionless LDI_NoiseMax "Noise max" { channel="sensorcommunity:noise:noise_sensor:noise-max" }
```

### Sitemap

LuftdatenInfo.sitemap
SensorCommunity.sitemap

```perl
sitemap LuftdatenInfo label="LuftdatenInfo" {
sitemap SensorCommunity label="SensorCommunity" {
Text item=PM_25 label="Particulate Matter 2.5 [%.1f %unit%]"
Text item=PM_100 label="Particulate Matter 10 [%.1f %unit%]"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<version>4.0.0-SNAPSHOT</version>
</parent>

<artifactId>org.openhab.binding.luftdateninfo</artifactId>
<artifactId>org.openhab.binding.sensorcommunity</artifactId>

<name>openHAB Add-ons :: Bundles :: LuftdatenInfo Binding</name>
<name>openHAB Add-ons :: Bundles :: Sensor.Community Binding</name>

</project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<features name="org.openhab.binding.luftdateninfo-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<features name="org.openhab.binding.sensorcommunity-${project.version}" xmlns="http://karaf.apache.org/xmlns/features/v1.4.0">
<repository>mvn:org.openhab.core.features.karaf/org.openhab.core.features.karaf.openhab-core/${ohc.version}/xml/features</repository>

<feature name="openhab-binding-luftdateninfo" description="LuftdatenInfo Binding" version="${project.version}">
<feature name="openhab-binding-sensorcommunity" description="Sensor.Community Binding" version="${project.version}">
<feature>openhab-runtime-base</feature>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.luftdateninfo/${project.version}</bundle>
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.sensorcommunity/${project.version}</bundle>
</feature>
</features>
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.luftdateninfo.internal;
package org.openhab.binding.sensorcommunity.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.core.thing.ThingTypeUID;

/**
* The {@link LuftdatenInfoBindingConstants} class defines common constants, which are
* The {@link SensorCommunityBindingConstants} class defines common constants, which are
* used across the whole binding.
*
* @author Bernd Weymann - Initial contribution
*/
@NonNullByDefault
public class LuftdatenInfoBindingConstants {
public class SensorCommunityBindingConstants {

private static final String BINDING_ID = "luftdateninfo";
private static final String BINDING_ID = "sensorcommunity";

// List of all Thing Type UIDs
public static final ThingTypeUID THING_TYPE_PARTICULATE = new ThingTypeUID(BINDING_ID, "particulate");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.luftdateninfo.internal;
package org.openhab.binding.sensorcommunity.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.openhab.binding.luftdateninfo.internal.utils.Constants;
import org.openhab.binding.sensorcommunity.internal.utils.Constants;

/**
* The {@link LuftdatenInfoConfiguration} class contains fields mapping thing configuration parameters.
* The {@link SensorCommunityConfiguration} class contains fields mapping thing configuration parameters.
*
* @author Bernd Weymann - Initial contribution
*/
@NonNullByDefault
public class LuftdatenInfoConfiguration {
public class SensorCommunityConfiguration {

public int sensorid = Constants.UNDEF;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
*
* SPDX-License-Identifier: EPL-2.0
*/
package org.openhab.binding.luftdateninfo.internal;
package org.openhab.binding.sensorcommunity.internal;

import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.luftdateninfo.internal.handler.ConditionHandler;
import org.openhab.binding.luftdateninfo.internal.handler.HTTPHandler;
import org.openhab.binding.luftdateninfo.internal.handler.NoiseHandler;
import org.openhab.binding.luftdateninfo.internal.handler.PMHandler;
import org.openhab.binding.sensorcommunity.internal.handler.ConditionHandler;
import org.openhab.binding.sensorcommunity.internal.handler.HTTPHandler;
import org.openhab.binding.sensorcommunity.internal.handler.NoiseHandler;
import org.openhab.binding.sensorcommunity.internal.handler.PMHandler;
import org.openhab.core.io.net.http.HttpClientFactory;
import org.openhab.core.thing.Thing;
import org.openhab.core.thing.ThingTypeUID;
Expand All @@ -31,35 +31,35 @@
import org.slf4j.LoggerFactory;

/**
* The {@link LuftdatenInfoHandlerFactory} is responsible for creating things and thing
* The {@link SensorCommunityHandlerFactory} is responsible for creating things and thing
* handlers.
*
* @author Bernd Weymann - Initial contribution
*/
@NonNullByDefault
@Component(configurationPid = "binding.luftdateninfo", service = ThingHandlerFactory.class)
public class LuftdatenInfoHandlerFactory extends BaseThingHandlerFactory {
protected final Logger logger = LoggerFactory.getLogger(LuftdatenInfoHandlerFactory.class);
@Component(configurationPid = "binding.sensorcommunity", service = ThingHandlerFactory.class)
public class SensorCommunityHandlerFactory extends BaseThingHandlerFactory {
protected final Logger logger = LoggerFactory.getLogger(SensorCommunityHandlerFactory.class);

@Activate
public LuftdatenInfoHandlerFactory(final @Reference HttpClientFactory httpClientFactory) {
public SensorCommunityHandlerFactory(final @Reference HttpClientFactory httpClientFactory) {
HTTPHandler.init(httpClientFactory.getCommonHttpClient());
}

@Override
public boolean supportsThingType(ThingTypeUID thingTypeUID) {
return (thingTypeUID.equals(LuftdatenInfoBindingConstants.THING_TYPE_PARTICULATE)
|| thingTypeUID.equals(LuftdatenInfoBindingConstants.THING_TYPE_CONDITIONS)
|| thingTypeUID.equals(LuftdatenInfoBindingConstants.THING_TYPE_NOISE));
return (thingTypeUID.equals(SensorCommunityBindingConstants.THING_TYPE_PARTICULATE)
|| thingTypeUID.equals(SensorCommunityBindingConstants.THING_TYPE_CONDITIONS)
|| thingTypeUID.equals(SensorCommunityBindingConstants.THING_TYPE_NOISE));
}

@Override
protected @Nullable ThingHandler createHandler(Thing thing) {
if (thing.getThingTypeUID().equals(LuftdatenInfoBindingConstants.THING_TYPE_PARTICULATE)) {
if (thing.getThingTypeUID().equals(SensorCommunityBindingConstants.THING_TYPE_PARTICULATE)) {
return new PMHandler(thing);
} else if (thing.getThingTypeUID().equals(LuftdatenInfoBindingConstants.THING_TYPE_CONDITIONS)) {
} else if (thing.getThingTypeUID().equals(SensorCommunityBindingConstants.THING_TYPE_CONDITIONS)) {
return new ConditionHandler(thing);
} else if (thing.getThingTypeUID().equals(LuftdatenInfoBindingConstants.THING_TYPE_NOISE)) {
} else if (thing.getThingTypeUID().equals(SensorCommunityBindingConstants.THING_TYPE_NOISE)) {
return new NoiseHandler(thing);
}
logger.info("Handler for {} not found", thing.getThingTypeUID());
Expand Down
Loading

0 comments on commit 08f9144

Please sign in to comment.