Skip to content

Experimental support for new Types, States and Item kinds in openhab project.

Notifications You must be signed in to change notification settings

ConnectorIO/openhab-schedule

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openHAB Schedule Type

This repository contains example code making it possible to define things Schedule type within openHAB framework. Notice type of the Channel (below "Weekly schedule") and event in console with formatted text and non-core type.

Bill of materials:

  1. api - the TypeAndStateParser interface interfered from openHAB Core TypeParser utility class.

  2. core - replacement of openHAB core which allows handling of new types. It swaps original TypeParser to DefaultTypeParser with version backed by TypeParserDelegate. additionally it solves troubles with ItemEventFactory cause it rely on hardcoded types.

  3. schedule - binding utilizing (and providing) custom types:

  • ListType - a variable length container structure
  • PairType- tuple of two types, a pair
  • TimeType - basic time of the day structure representing a LocalTime
  • ScheduleType - list of 7 lists with time-command pairs representing 7 days and commands to be executed at given this time.

The schedule module brings couple of more elements:

  1. ScheduleItem
  2. ScheduleItemFactory
  3. ScheduleTypeAndStateParser

Above are necessary to actually provide necessary inputs for framework. There is not yet DTO and mapping, yet it does not blow up entire system.

This code was mostly developed in late 2018 without a major discussion behind. It was working with Eclipse SmartHome and been ported now (January 2020) to also work with openhab-core.

Installation

Build this code and then install api module in runtime.

install file:/home/splatch/projects/openhab-schedule/api/target/api-0.10.0-SNAPSHOT.jar

Then determine openhab core bundle id:

openhab> la -s|grep org.openhab.core
133 x Active   x  80 x 2.5.0                  x org.openhab.core

and replace it with provisioned core,

update 133 file:/home/splatch/projects/openhab-schedule/core/target/core-0.10.0-SNAPSHOT.jar

Finally install schedule type and sample binding:

install file:/home/splatch/projects/openhab-schedule/schedule/target/schedule-0.10.0-SNAPSHOT.jar

Disclaimer

This is an experiment, not intended for production use. Code which was copied is brought for research purposes.

License

The license of the code is a mixture of - Eclipse Public License v2 and "don't try it at home". You do it at your own risk.

Authors

Łukasz Dywicki / ConnectorIO

About

Experimental support for new Types, States and Item kinds in openhab project.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages