Skip to content
This repository was archived by the owner on Jan 1, 2024. It is now read-only.

Commit 9b06888

Browse files
committed
Initial push
1 parent d443fc0 commit 9b06888

File tree

8 files changed

+301
-31
lines changed

8 files changed

+301
-31
lines changed

Dockerfile

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
FROM lsiobase/alpine
2+
MAINTAINER saarg
3+
4+
# set version label
5+
ARG BUILD_DATE
6+
ARG VERSION
7+
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
8+
9+
# Environment settings
10+
ENV HOME="/config"
11+
12+
# copy local files
13+
COPY root/ /
14+
15+
# install build dependencies
16+
RUN \
17+
apk add --no-cache --virtual=build-dependencies \
18+
autoconf \
19+
automake \
20+
boost-dev \
21+
cmake \
22+
coreutils \
23+
curl-dev \
24+
eudev-dev \
25+
g++ \
26+
gcc \
27+
git \
28+
libcurl \
29+
libusb-compat-dev \
30+
libusb-dev \
31+
make \
32+
openssl-dev \
33+
pkgconf \
34+
sqlite-dev \
35+
tar \
36+
zlib-dev && \
37+
38+
# build OpenZWave
39+
git clone https://github.com/OpenZWave/open-zwave.git /tmp/open-zwave && \
40+
ln -s /tmp/open-zwave /tmp/open-zwave-read-only && \
41+
cd /tmp/open-zwave && \
42+
make && \
43+
44+
# build domoticz
45+
git clone https://github.com/domoticz/domoticz.git /tmp/domoticz && \
46+
cd /tmp/domoticz && \
47+
cmake -USE_STATIC_OPENZWAVE -DCMAKE_BUILD_TYPE=Release . && \
48+
make && \
49+
make install && \
50+
51+
# cleanup build dependencies
52+
apk del --purge \
53+
build-dependencies && \
54+
55+
# install runtime dependencies
56+
apk add --no-cache \
57+
libcrypto1.0 \
58+
libcurl \
59+
libssl1.0 \
60+
libstdc++ \
61+
libusb \
62+
libusb-compat \
63+
zlib && \
64+
65+
# add abc to dialout and cron group trying to fix different GID for dialout group
66+
usermod -a -G 16 abc && \
67+
usermod -a -G 20 abc && \
68+
69+
# cleanup /tmp
70+
rm -rf \
71+
/tmp/*
72+
73+
# ports and volumes
74+
EXPOSE 8080 6144 1443
75+
76+
VOLUME /config

READMETEMPLATE.md

Lines changed: 36 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[linuxserverurl]: https://linuxserver.io
22
[forumurl]: https://forum.linuxserver.io
3-
[ircurl]: https://www.linuxserver.io/irc/
4-
[podcasturl]: https://www.linuxserver.io/podcast/
3+
[ircurl]: https://www.linuxserver.io/index.php/irc/
4+
[podcasturl]: https://www.linuxserver.io/index.php/category/podcast/
55

66
[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl]
77

@@ -10,40 +10,53 @@ The [LinuxServer.io][linuxserverurl] team brings you another container release f
1010
* [IRC][ircurl] on freenode at `#linuxserver.io`
1111
* [Podcast][podcasturl] covers everything to do with getting the most from your Linux Server plus a focus on all things Docker and containerisation!
1212

13-
# <image-name>
13+
# linuxserver/domoticz
1414

15-
Provide a short, concise description of the application. No more than two SHORT paragraphs. Link to sources where possible and include an image illustrating your point if necessary. Point users to the original applications website, as that's the best place to get support - not here.
15+
[Domoticz](https://www.domoticz.com/) is a Home Automation System that lets you monitor and configure various devices like: Lights, Switches, various sensors/meters like Temperature, Rain, Wind, UV, Electra, Gas, Water and much more. Notifications/Alerts can be sent to any mobile device
1616

17-
Our Plex container has immaculate docs so follow that if in doubt for layout.
18-
19-
`IMPORTANT, replace all instances of <image-name> with the correct dockerhub repo (ie linuxserver/plex) and <container-name> information (ie, plex)`
17+
[![domoticz](https://github.com/domoticz/domoticz/raw/master/www/images/logo.png)][domoticzurl]
18+
[domoticzurl]: https://www.domoticz.com
2019

2120
## Usage
2221

2322
```
2423
docker create \
25-
--name=<container-name> \
24+
--name=domoticz \
25+
--net=bridge \
2626
-v <path to data>:/config \
2727
-e PGID=<gid> -e PUID=<uid> \
28-
-p 1234:1234 \
29-
<image-name>
28+
-p 8080:8080 \
29+
-p 1443:1443 \
30+
-p 6144:6144 \
31+
--device=/dev/ttyUSB0 \
32+
linuxserver/domoticz
3033
```
3134

32-
## Parameters
33-
34-
`The parameters are split into two halves, separated by a colon, the left hand side representing the host and the right the container side.
35-
For example with a port -p external:internal - what this shows is the port mapping from internal to external of the container.
36-
So -p 8080:80 would expose port 80 from inside the container to be accessible from the host's IP on port 8080
37-
http://192.168.x.x:8080 would show you what's running INSIDE the container on port 80.`
38-
3935

36+
**Parameters**
4037

4138
* `-p 1234` - the port(s)
4239
* `-v /config` - explain what lives here
4340
* `-e PGID` for GroupID - see below for explanation
4441
* `-e PUID` for UserID - see below for explanation
42+
* `--device=/dev/ttyUSB0` - for passing through USB devices
43+
* `-e TZ` - for timezone information *eg Europe/London, etc*
44+
45+
It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it domoticz /bin/bash`.
46+
47+
### Passing Through USB Devices
48+
49+
To get full use of Domoticz, you probably have a USB device you want to pass through. To figure out which device to pass through, you have to connect the device and look in dmesg for the device node created. Issue the command 'dmesg | tail' after you connected your device and you should see something like below.
50+
51+
```
52+
usb 1-1.2: new full-speed USB device number 7 using ehci-pci
53+
ftdi_sio 1-1.2:1.0: FTDI USB Serial Device converter detected
54+
usb 1-1.2: Detected FT232RL
55+
usb 1-1.2: FTDI USB Serial Device converter now attached to ttyUSB0
56+
```
57+
58+
As you can see above, the device node created is ttyUSB0. It does not say where, but it's almost always in /dev/. The correct tag for passing through this USB device is '--device=/dev/ttyUSB0'
4559

46-
It is based on alpine linux with s6 overlay, for shell access whilst the container is running do `docker exec -it <container-name> /bin/bash`.
4760

4861
### User / Group Identifiers
4962

@@ -58,22 +71,14 @@ In this instance `PUID=1001` and `PGID=1001`. To find yours use `id user` as bel
5871

5972
## Setting up the application
6073

61-
Insert a basic user guide here to get a n00b up and running with the software inside the container. DELETE ME
62-
74+
To configure Domoticz, go to the IP of your docker host on the port you configured (default 8080), and add your hardware in Setup > Hardware.
75+
The user manual is available at [www.domoticz.com](https://www.domoticz.com)
6376

6477
## Info
6578

66-
* Shell access whilst the container is running: `docker exec -it <container-name> /bin/bash`
67-
* To monitor the logs of the container in realtime: `docker logs -f <container-name>`
68-
69-
* container version number
70-
71-
`docker inspect -f '{{ index .Config.Labels "build_version" }}' <container-name>`
72-
73-
* image version number
74-
75-
`docker inspect -f '{{ index .Config.Labels "build_version" }}' <image-name>`
79+
* Shell access whilst the container is running: `docker exec -it domoticz /bin/bash`
80+
* To monitor the logs of the container in realtime: `docker logs -f domoticz`
7681

7782
## Versions
7883

79-
+ **dd.MM.yy:** This is the standard Version type now.
84+
+ **10.10.2016:** Initial release.

root/etc/cont-init.d/30-config

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# copy default scripts from install
4+
[[ ! -e /config/scripts ]] && \
5+
cp -R /opt/domoticz/scripts /config/
6+
7+
# copy default ssl certificate
8+
[[ ! -e /config/server_cert.pem ]] && \
9+
cp /opt/domoticz/server_cert.pem /config/server_cert.pem
10+
11+
# set permissions for /config
12+
chown -R abc:abc \
13+
/config
14+
chmod -R 764 \
15+
/config

root/etc/services.d/domoticz/run

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/with-contenv bash
2+
exec \
3+
s6-setuidgid abc /opt/domoticz/domoticz \
4+
-sslwww 1443 \
5+
-sslcert /config/server_cert.pem \
6+
-userdata /config/ \
7+
-dbase /config/domoticz.db \
8+
-syslog

root/usr/include/telldus-core.h

Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
//
2+
// Copyright (C) 2012 Telldus Technologies AB. All rights reserved.
3+
//
4+
// Copyright: See COPYING file that comes with this distribution
5+
//
6+
//
7+
#ifndef TELLDUS_CORE_CLIENT_TELLDUS_CORE_H_
8+
#define TELLDUS_CORE_CLIENT_TELLDUS_CORE_H_
9+
10+
// The following ifdef block is the standard way of creating macros
11+
// which make exporting from a DLL simpler. All files within this DLL
12+
// are compiled with the TELLDUSCORE_EXPORTS symbol defined on the command line.
13+
// This symbol should not be defined on any project that uses this DLL.
14+
// This way any other project whose source files include this file see
15+
// TELLSTICK_API functions as being imported from a DLL, whereas this DLL
16+
// sees symbols defined with this macro as being exported.
17+
18+
#ifdef _WINDOWS
19+
#if defined(TELLDUSCORE_EXPORTS)
20+
#if defined(_CL64)
21+
#define TELLSTICK_API
22+
#else
23+
#define TELLSTICK_API __declspec(dllexport)
24+
#endif
25+
#else
26+
#define TELLSTICK_API __declspec(dllimport)
27+
#endif
28+
#define WINAPI __stdcall
29+
#else
30+
#define WINAPI
31+
#define TELLSTICK_API __attribute__ ((visibility("default")))
32+
#endif
33+
34+
typedef void (WINAPI *TDDeviceEvent)(int deviceId, int method, const char *data, int callbackId, void *context);
35+
typedef void (WINAPI *TDDeviceChangeEvent)(int deviceId, int changeEvent, int changeType, int callbackId, void *context);
36+
typedef void (WINAPI *TDRawDeviceEvent)(const char *data, int controllerId, int callbackId, void *context);
37+
typedef void (WINAPI *TDSensorEvent)(const char *protocol, const char *model, int id, int dataType, const char *value, int timestamp, int callbackId, void *context);
38+
typedef void (WINAPI *TDControllerEvent)(int controllerId, int changeEvent, int changeType, const char *newValue, int callbackId, void *context);
39+
40+
#ifndef __cplusplus
41+
#define bool char
42+
#endif
43+
44+
#ifdef __cplusplus
45+
extern "C" {
46+
#endif
47+
TELLSTICK_API void WINAPI tdInit(void);
48+
TELLSTICK_API int WINAPI tdRegisterDeviceEvent( TDDeviceEvent eventFunction, void *context );
49+
TELLSTICK_API int WINAPI tdRegisterDeviceChangeEvent( TDDeviceChangeEvent eventFunction, void *context);
50+
TELLSTICK_API int WINAPI tdRegisterRawDeviceEvent( TDRawDeviceEvent eventFunction, void *context );
51+
TELLSTICK_API int WINAPI tdRegisterSensorEvent( TDSensorEvent eventFunction, void *context );
52+
TELLSTICK_API int WINAPI tdRegisterControllerEvent( TDControllerEvent eventFunction, void *context);
53+
TELLSTICK_API int WINAPI tdUnregisterCallback( int callbackId );
54+
TELLSTICK_API void WINAPI tdClose(void);
55+
TELLSTICK_API void WINAPI tdReleaseString(char *thestring);
56+
57+
TELLSTICK_API int WINAPI tdTurnOn(int intDeviceId);
58+
TELLSTICK_API int WINAPI tdTurnOff(int intDeviceId);
59+
TELLSTICK_API int WINAPI tdBell(int intDeviceId);
60+
TELLSTICK_API int WINAPI tdDim(int intDeviceId, unsigned char level);
61+
TELLSTICK_API int WINAPI tdExecute(int intDeviceId);
62+
TELLSTICK_API int WINAPI tdUp(int intDeviceId);
63+
TELLSTICK_API int WINAPI tdDown(int intDeviceId);
64+
TELLSTICK_API int WINAPI tdStop(int intDeviceId);
65+
TELLSTICK_API int WINAPI tdLearn(int intDeviceId);
66+
TELLSTICK_API int WINAPI tdMethods(int id, int methodsSupported);
67+
TELLSTICK_API int WINAPI tdLastSentCommand( int intDeviceId, int methodsSupported );
68+
TELLSTICK_API char *WINAPI tdLastSentValue( int intDeviceId );
69+
70+
TELLSTICK_API int WINAPI tdGetNumberOfDevices();
71+
TELLSTICK_API int WINAPI tdGetDeviceId(int intDeviceIndex);
72+
TELLSTICK_API int WINAPI tdGetDeviceType(int intDeviceId);
73+
74+
TELLSTICK_API char * WINAPI tdGetErrorString(int intErrorNo);
75+
76+
TELLSTICK_API char * WINAPI tdGetName(int intDeviceId);
77+
TELLSTICK_API bool WINAPI tdSetName(int intDeviceId, const char* chNewName);
78+
TELLSTICK_API char * WINAPI tdGetProtocol(int intDeviceId);
79+
TELLSTICK_API bool WINAPI tdSetProtocol(int intDeviceId, const char* strProtocol);
80+
TELLSTICK_API char * WINAPI tdGetModel(int intDeviceId);
81+
TELLSTICK_API bool WINAPI tdSetModel(int intDeviceId, const char *intModel);
82+
83+
TELLSTICK_API char * WINAPI tdGetDeviceParameter(int intDeviceId, const char *strName, const char *defaultValue);
84+
TELLSTICK_API bool WINAPI tdSetDeviceParameter(int intDeviceId, const char *strName, const char* strValue);
85+
86+
TELLSTICK_API int WINAPI tdAddDevice();
87+
TELLSTICK_API bool WINAPI tdRemoveDevice(int intDeviceId);
88+
89+
TELLSTICK_API int WINAPI tdSendRawCommand(const char *command, int reserved);
90+
91+
TELLSTICK_API void WINAPI tdConnectTellStickController(int vid, int pid, const char *serial);
92+
TELLSTICK_API void WINAPI tdDisconnectTellStickController(int vid, int pid, const char *serial);
93+
94+
TELLSTICK_API int WINAPI tdSensor(char *protocol, int protocolLen, char *model, int modelLen, int *id, int *dataTypes);
95+
TELLSTICK_API int WINAPI tdSensorValue(const char *protocol, const char *model, int id, int dataType, char *value, int len, int *timestamp);
96+
97+
TELLSTICK_API int WINAPI tdController(int *controllerId, int *controllerType, char *name, int nameLen, int *available);
98+
TELLSTICK_API int WINAPI tdControllerValue(int controllerId, const char *name, char *value, int valueLen);
99+
TELLSTICK_API int WINAPI tdSetControllerValue(int controllerId, const char *name, const char *value);
100+
TELLSTICK_API int WINAPI tdRemoveController(int controllerId);
101+
102+
#ifdef __cplusplus
103+
}
104+
#endif
105+
106+
// Device methods
107+
#define TELLSTICK_TURNON 1
108+
#define TELLSTICK_TURNOFF 2
109+
#define TELLSTICK_BELL 4
110+
#define TELLSTICK_TOGGLE 8
111+
#define TELLSTICK_DIM 16
112+
#define TELLSTICK_LEARN 32
113+
#define TELLSTICK_EXECUTE 64
114+
#define TELLSTICK_UP 128
115+
#define TELLSTICK_DOWN 256
116+
#define TELLSTICK_STOP 512
117+
118+
// Sensor value types
119+
#define TELLSTICK_TEMPERATURE 1
120+
#define TELLSTICK_HUMIDITY 2
121+
#define TELLSTICK_RAINRATE 4
122+
#define TELLSTICK_RAINTOTAL 8
123+
#define TELLSTICK_WINDDIRECTION 16
124+
#define TELLSTICK_WINDAVERAGE 32
125+
#define TELLSTICK_WINDGUST 64
126+
127+
// Error codes
128+
#define TELLSTICK_SUCCESS 0
129+
#define TELLSTICK_ERROR_NOT_FOUND -1
130+
#define TELLSTICK_ERROR_PERMISSION_DENIED -2
131+
#define TELLSTICK_ERROR_DEVICE_NOT_FOUND -3
132+
#define TELLSTICK_ERROR_METHOD_NOT_SUPPORTED -4
133+
#define TELLSTICK_ERROR_COMMUNICATION -5
134+
#define TELLSTICK_ERROR_CONNECTING_SERVICE -6
135+
#define TELLSTICK_ERROR_UNKNOWN_RESPONSE -7
136+
#define TELLSTICK_ERROR_SYNTAX -8
137+
#define TELLSTICK_ERROR_BROKEN_PIPE -9
138+
#define TELLSTICK_ERROR_COMMUNICATING_SERVICE -10
139+
#define TELLSTICK_ERROR_CONFIG_SYNTAX -11
140+
#define TELLSTICK_ERROR_UNKNOWN -99
141+
142+
// Device typedef
143+
#define TELLSTICK_TYPE_DEVICE 1
144+
#define TELLSTICK_TYPE_GROUP 2
145+
#define TELLSTICK_TYPE_SCENE 3
146+
147+
// Controller typedef
148+
#define TELLSTICK_CONTROLLER_TELLSTICK 1
149+
#define TELLSTICK_CONTROLLER_TELLSTICK_DUO 2
150+
#define TELLSTICK_CONTROLLER_TELLSTICK_NET 3
151+
152+
// Device changes
153+
#define TELLSTICK_DEVICE_ADDED 1
154+
#define TELLSTICK_DEVICE_CHANGED 2
155+
#define TELLSTICK_DEVICE_REMOVED 3
156+
#define TELLSTICK_DEVICE_STATE_CHANGED 4
157+
158+
// Change types
159+
#define TELLSTICK_CHANGE_NAME 1
160+
#define TELLSTICK_CHANGE_PROTOCOL 2
161+
#define TELLSTICK_CHANGE_MODEL 3
162+
#define TELLSTICK_CHANGE_METHOD 4
163+
#define TELLSTICK_CHANGE_AVAILABLE 5
164+
#define TELLSTICK_CHANGE_FIRMWARE 6
165+
166+
#endif // TELLDUS_CORE_CLIENT_TELLDUS_CORE_H_

root/usr/lib/libtelldus-core.so

176 KB
Binary file not shown.

root/usr/lib/libtelldus-core.so.2

176 KB
Binary file not shown.

root/usr/lib/libtelldus-core.so.2.1.2

176 KB
Binary file not shown.

0 commit comments

Comments
 (0)