Register for the iXsystems Community to get an ad-free experience and exclusive discounts in our eBay Store.

[HOWTO] Domoticz and open-zwave in a FreeNAS 11 jail!

Status
Not open for further replies.

captainkent

Newbie
Joined
Nov 12, 2016
Messages
10
Hi guys,

I've recently gotten into home automation, and wanted to run a domoticz jail in FreeNAS. Like many people on the forums, I stumbled upon the issue of getting my Aeotec Z-Stick Gen5 working inside my jail. After some hard work, patience and lots of Googling, I finally figured it out. See below how to do it.

Installing domoticz and open-zwave (see link)
Create a jail, and in the jail run
pkg update
pkg upgrade
pkg install
pkg install sqlite3 expat curl libiconv gmake cmake subversion git devel/boost-libs devel/boost-python-libs devel/boost-all


If running into issues with the wrong boost lib, use this guide to install an older boost lib. This is a recent bug known during the creation of this post, it might be solved soon!

Create a new user in the webgui of FreeNAS.
  • Account -> Users -> Add User
  • Fill in a username ('domoticz') and a full name
  • Disable password logins
  • Change the shell to ‘nologin’ to disable logins at all
  • Remember the ‘user id’ (this is important! In my case it is ‘1010’)
Add same user inside domoticz jail.

pw useradd -n domoticz -u 1010 -m -s /sbin/nologin

For open-zwave support:
cd /home/domoticz
git clone https://github.com/OpenZWave/open-zwave.git open-zwave-read-only
cd open-zwave-read-only
gmake


See what happens when you use ./MinOZW ttycuaU0 or what your correct devicename is, most likely this is where the headaches start as you won't get a proper response.

To solve this, make sure you can see your Z-Wave stick being loaded, and figure out it's unique address. The output of dmesg.
umodem0 on uhub2
umodem0: <vendor 0x0658 product 0x0200, class 2/0, rev 2.00/0.00, addr 5> on usbus0
umodem0: data interface 1, has no CM over data, has no break


Add the unique address number to /etc/devfs.rules with some extra rules.
[devfsrules_jail_allow_usb=5]
add path 'cu*' unhide


where the number is my address number. If you add the wrong number, the rule will disappear after a reboot. Now I know my device is accessible at /dev/cuaU0 (note the capital U!).

Once this worked, I made a symbolic link to my jail
ln -s /dev/cuaU0 /path/to/jail/dev/ttyUSB0


Then from within the jail, make sure to add permissions to the device
chown root:domoticz /dev/ttyU*
chmod 660 /dev/ttyU*


In the future I want to everything to run through domoticz:domoticz, so I added the domoticz user to the dialer group, but I'm not sure if this is neccessary. Now if I run ./MinOZW my output is:
root@domoticz_1:/home/domoticz/open-zwave-read-only # ./MinOZW
Starting MinOZW with OpenZWave Version 1.4.2893
2018-01-25 09:01:25.234 Error, Cannot find a path to the configuration files at ../../../config/, Using config/ instead...
2018-01-25 09:01:25.235 Info, Reading config/options.xml for Options
2018-01-25 09:01:25.235 Warning, Failed to Parse options.xml: Failed to open file
2018-01-25 09:01:25.236 Always, OpenZwave Version 1.4.2893 Starting Up
2018-01-25 09:01:25.236 Info, Setting Up Provided Network Key for Secure Communications
2018-01-25 09:01:25.236 Warning, Failed - Network Key Not Set
2018-01-25 09:01:25.236 Info, mgr, Added driver for controller /dev/ttyUSB0
2018-01-25 09:01:25.236 Info, Opening controller /dev/ttyUSB0
2018-01-25 09:01:25.237 Info, Trying to open serial port /dev/ttyUSB0 (attempt 1)
2018-01-25 09:01:25.237 Info, Serial port /dev/ttyUSB0 opened (attempt 1)
2018-01-25 09:01:25.237 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2018-01-25 09:01:25.237 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
2018-01-25 09:01:25.237 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9
2018-01-25 09:01:25.237 Detail, contrlr, Queuing (Command) FUNC_ID_SERIAL_API_GET_CAPABILITIES: 0x01, 0x03, 0x00, 0x07, 0xfb
2018-01-25 09:01:25.238 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa
2018-01-25 09:01:25.238 Detail,
2018-01-25 09:01:25.238 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x15) - FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2018-01-25 09:01:25.451 Detail, Unsolicited message received while waiting for ACK.
2018-01-25 09:01:25.452 Detail, contrlr, Received: 0x01, 0x10, 0x01, 0x15, 0x5a, 0x2d, 0x57, 0x61, 0x76, 0x65, 0x20, 0x33, 0x2e, 0x39, 0x35, 0x00, 0x01, 0x99
2018-01-25 09:01:25.452 Detail,
2018-01-25 09:01:25.452 Info, contrlr, Received reply to FUNC_ID_ZW_GET_VERSION:
2018-01-25 09:01:25.452 Info, contrlr, Static Controller library, version Z-Wave 3.95
2018-01-25 09:01:25.452 Detail, Node045, Expected reply was received
2018-01-25 09:01:25.452 Detail, Node045, Message transaction complete
2018-01-25 09:01:25.452 Detail,
2018-01-25 09:01:25.452 Detail, contrlr, Removing current message
2018-01-25 09:01:25.452 Detail,
2018-01-25 09:01:25.453 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x20) - FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
2018-01-25 09:01:25.455 Detail, contrlr, Received: 0x01, 0x08, 0x01, 0x20, 0xf2, 0x9f, 0x32, 0x46, 0x01, 0xce
2018-01-25 09:01:25.455 Detail,
2018-01-25 09:01:25.455 Info, contrlr, Received reply to FUNC_ID_ZW_MEMORY_GET_ID. Home ID = 0xf29f3246. Our node ID = 1
2018-01-25 09:01:25.455 Detail, Node159, Expected reply was received
2018-01-25 09:01:25.455 Detail, Node159, Message transaction complete
2018-01-25 09:01:25.455 Detail,
2018-01-25 09:01:25.455 Detail, contrlr, Removing current message
2018-01-25 09:01:25.455 Detail,
2018-01-25 09:01:25.455 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x05) - FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9
2018-01-25 09:01:25.456 Detail, contrlr, Received: 0x01, 0x04, 0x01, 0x05, 0x28, 0xd7
2018-01-25 09:01:25.457 Detail,
2018-01-25 09:01:25.457 Info, contrlr, Received reply to FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES:
2018-01-25 09:01:25.457 Info, contrlr, There is no SUC ID Server (SIS) in this network.
2018-01-25 09:01:25.457 Info, contrlr, The PC controller is a primary controller.
2018-01-25 09:01:25.457 Detail, Node215, Expected reply was received
2018-01-25 09:01:25.457 Detail, Node215, Message transaction complete
2018-01-25 09:01:25.457 Detail,
2018-01-25 09:01:25.457 Detail, contrlr, Removing current message
2018-01-25 09:01:25.457 Detail,
2018-01-25 09:01:25.457 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x07) - FUNC_ID_SERIAL_API_GET_CAPABILITIES: 0x01, 0x03, 0x00, 0x07, 0xfb
2018-01-25 09:01:25.461 Detail, contrlr, Received: 0x01, 0x2b, 0x01, 0x07, 0x01, 0x00, 0x00, 0x86, 0x00, 0x01, 0x00, 0x5a, 0xfe, 0x81, 0xff, 0x88, 0x4f, 0x1f, 0x00, 0x00, 0xfb, 0x9f, 0x7d, 0xa0, 0x67, 0x00, 0x00, 0x80, 0x00, 0x80, 0x86, 0x00, 0x00, 0x00, 0xe8, 0x73, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x60, 0x00, 0x00, 0xfb
2018-01-25 09:01:25.461 Detail,
2018-01-25 09:01:25.461 Info, contrlr, Received reply to FUNC_ID_SERIAL_API_GET_CAPABILITIES
2018-01-25 09:01:25.461 Info, contrlr, Serial API Version: 1.0
2018-01-25 09:01:25.461 Info, contrlr, Manufacturer ID: 0x0086
2018-01-25 09:01:25.461 Info, contrlr, Product Type: 0x0001
2018-01-25 09:01:25.461 Info, contrlr, Product ID: 0x005a
2018-01-25 09:01:25.461 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_RANDOM: 0x01, 0x04, 0x00, 0x1c, 0x20, 0xc7
2018-01-25 09:01:25.461 Detail, contrlr, Queuing (Command) FUNC_ID_SERIAL_API_GET_INIT_DATA: 0x01, 0x03, 0x00, 0x02, 0xfe
2018-01-25 09:01:25.461 Detail, contrlr, Queuing (Command) FUNC_ID_SERIAL_API_SET_TIMEOUTS: 0x01, 0x05, 0x00, 0x06, 0x64, 0x0f, 0x97
2018-01-25 09:01:25.461 Detail, contrlr, Queuing (Command) FUNC_ID_SERIAL_API_APPL_NODE_INFORMATION: 0x01, 0x07, 0x00, 0x03, 0x01, 0x02, 0x01, 0x00, 0xf9
2018-01-25 09:01:25.461 Detail, Expected reply was received
2018-01-25 09:01:25.461 Detail, Message transaction complete
2018-01-25 09:01:25.462 Detail,
2018-01-25 09:01:25.462 Detail, contrlr, Removing current message
2018-01-25 09:01:25.462 Detail,
2018-01-25 09:01:25.462 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x56) - FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa
2018-01-25 09:01:25.463 Detail, contrlr, Received: 0x01, 0x04, 0x01, 0x56, 0x00, 0xac
2018-01-25 09:01:25.463 Detail,
2018-01-25 09:01:25.463 Info, contrlr, Received reply to GET_SUC_NODE_ID. Node ID = 0
2018-01-25 09:01:25.463 Info, Controller Does not Support SUC - Cannot Setup Controller as SUC Node
2018-01-25 09:01:25.463 Detail, Node172, Expected reply was received
2018-01-25 09:01:25.464 Detail, Node172, Message transaction complete
2018-01-25 09:01:25.464 Detail,
2018-01-25 09:01:25.464 Detail, contrlr, Removing current message
2018-01-25 09:01:25.464 Detail,
2018-01-25 09:01:25.464 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x1c) - FUNC_ID_ZW_GET_RANDOM: 0x01, 0x04, 0x00, 0x1c, 0x20, 0xc7
2018-01-25 09:01:25.520 Detail, contrlr, Received: 0x01, 0x25, 0x01, 0x1c, 0x01, 0x20, 0x00, 0x49, 0x2f, 0x02, 0x9d, 0x51, 0xed, 0x3b, 0xdd, 0x6f, 0x61, 0x95, 0x27, 0xfc, 0xa8, 0x48, 0x48, 0xc4, 0x59, 0xbe, 0x89, 0xe0, 0xc7, 0xb4, 0x90, 0xcf, 0x5c, 0xe8, 0x44, 0xcd, 0xf9, 0xf3, 0xfc
2018-01-25 09:01:25.520 Detail,
2018-01-25 09:01:25.520 Info, contrlr, Received reply to FUNC_ID_ZW_GET_RANDOM: true
2018-01-25 09:01:25.520 Detail, Node032, Expected reply was received
2018-01-25 09:01:25.520 Detail, Node032, Message transaction complete
2018-01-25 09:01:25.520 Detail,
2018-01-25 09:01:25.520 Detail, contrlr, Removing current message
2018-01-25 09:01:25.520 Detail,
2018-01-25 09:01:25.520 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x02) - FUNC_ID_SERIAL_API_GET_INIT_DATA: 0x01, 0x03, 0x00, 0x02, 0xfe
2018-01-25 09:01:25.622 Detail, contrlr, Received: 0x01, 0x25, 0x01, 0x02, 0x05, 0x00, 0x1d, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0xc5
2018-01-25 09:01:25.622 Detail,
2018-01-25 09:01:25.622 Info, mgr, Driver with Home ID of 0xf29f3246 is now ready.
2018-01-25 09:01:25.622 Info,
2018-01-25 09:01:25.622 Info, contrlr, Received reply to FUNC_ID_SERIAL_API_GET_INIT_DATA:
2018-01-25 09:01:25.622 Info, contrlr, Node 001 - New
2018-01-25 09:01:25.622 Detail, Node001, AdvanceQueries queryPending=0 queryRetries=0 queryStage=None live=1
2018-01-25 09:01:25.622 Detail, Node001, QueryStage_ProtocolInfo
2018-01-25 09:01:25.622 Detail, Node001, Queuing (Query) Get Node Protocol Info (Node=1): 0x01, 0x04, 0x00, 0x41, 0x01, 0xbb
2018-01-25 09:01:25.622 Detail, Node001, Queuing (Query) Query Stage Complete (ProtocolInfo)
2018-01-25 09:01:25.622 Info, Node001, Initializing Node. New Node: false (false)
2018-01-25 09:01:25.622 Detail, Expected reply was received
2018-01-25 09:01:25.622 Detail, Message transaction complete
2018-01-25 09:01:25.622 Detail,
2018-01-25 09:01:25.623 Detail, contrlr, Removing current message
2018-01-25 09:01:25.623 Detail, Node001, Notification: DriverReady
2018-01-25 09:01:25.623 Detail, Node001, Notification: NodeNew
2018-01-25 09:01:25.623 Detail, Node001, Notification: NodeAdded
2018-01-25 09:01:25.623 Detail,
2018-01-25 09:01:25.623 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x06) - FUNC_ID_SERIAL_API_SET_TIMEOUTS: 0x01, 0x05, 0x00, 0x06, 0x64, 0x0f, 0x97
2018-01-25 09:01:25.633 Detail, contrlr, Received: 0x01, 0x05, 0x01, 0x06, 0x64, 0x0f, 0x96
2018-01-25 09:01:25.633 Detail,
2018-01-25 09:01:25.633 Info, contrlr, Received reply to FUNC_ID_SERIAL_API_SET_TIMEOUTS
2018-01-25 09:01:25.633 Detail, Node015, Expected reply was received
2018-01-25 09:01:25.633 Detail, Node015, Message transaction complete
2018-01-25 09:01:25.633 Detail,
2018-01-25 09:01:25.634 Detail, contrlr, Removing current message
2018-01-25 09:01:25.634 Detail,
2018-01-25 09:01:25.634 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x00) - FUNC_ID_SERIAL_API_APPL_NODE_INFORMATION: 0x01, 0x07, 0x00, 0x03, 0x01, 0x02, 0x01, 0x00, 0xf9
2018-01-25 09:01:25.635 Detail, contrlr, Removing current message
2018-01-25 09:01:25.635 Detail,
2018-01-25 09:01:25.635 Info, Node001, Sending (Query) message (Callback ID=0x00, Expected Reply=0x41) - Get Node Protocol Info (Node=1): 0x01, 0x04, 0x00, 0x41, 0x01, 0xbb
2018-01-25 09:01:25.638 Detail, Node001, Received: 0x01, 0x09, 0x01, 0x41, 0x93, 0x16, 0x01, 0x02, 0x02, 0x01, 0x33
2018-01-25 09:01:25.638 Detail,
2018-01-25 09:01:25.638 Info, Node001, Received reply to FUNC_ID_ZW_GET_NODE_PROTOCOL_INFO
2018-01-25 09:01:25.638 Info, Node001, Protocol Info for Node 1:
2018-01-25 09:01:25.638 Info, Node001, Listening = true
2018-01-25 09:01:25.638 Info, Node001, Beaming = true
2018-01-25 09:01:25.638 Info, Node001, Routing = false
2018-01-25 09:01:25.638 Info, Node001, Max Baud Rate = 40000
2018-01-25 09:01:25.638 Info, Node001, Version = 4
2018-01-25 09:01:25.638 Info, Node001, Security = false
2018-01-25 09:01:25.641 Info, Node001, Basic device class (0x02) - Static Controller
2018-01-25 09:01:25.641 Info, Node001, Generic device Class (0x02) - Static Controller
2018-01-25 09:01:25.641 Info, Node001, Specific device class (0x01) - Static PC Controller
2018-01-25 09:01:25.641 Info, Node001, COMMAND_CLASS_BASIC is not mapped
2018-01-25 09:01:25.641 Info, Node001, Mandatory Command Classes for Node 1:
2018-01-25 09:01:25.641 Info, Node001, None
2018-01-25 09:01:25.641 Info, Node001, Mandatory Command Classes controlled by Node 1:
2018-01-25 09:01:25.641 Info, Node001, COMMAND_CLASS_BASIC
2018-01-25 09:01:25.641 Detail, Node022, Expected reply was received
2018-01-25 09:01:25.641 Detail, Node022, Message transaction complete
2018-01-25 09:01:25.642 Detail,
2018-01-25 09:01:25.642 Detail, Node001, Removing current message
2018-01-25 09:01:25.642 Detail, Node001, Notification: NodeProtocolInfo
2018-01-25 09:01:25.642 Detail, Node001, Notification: ValueAdded
2018-01-25 09:01:25.642 Detail, Node001, Query Stage Complete (ProtocolInfo)
2018-01-25 09:01:25.642 Detail, Node001, AdvanceQueries queryPending=0 queryRetries=0 queryStage=Probe live=1
2018-01-25 09:01:25.642 Detail, Node001, QueryStage_Probe
2018-01-25 09:01:25.642 Detail, Node001, QueryStage_WakeUp
2018-01-25 09:01:25.642 Detail, Node001, QueryStage_ManufacturerSpecific1
2018-01-25 09:01:25.642 Detail, Node001, Load Controller Manufacturer Specific Config
2018-01-25 09:01:25.652 Info, Product name collision: VRS15-1LZ Switch type 301 id 209 manufacturerid 1d, collides with VRS15-1LZ Binary Scene Switch, type 301 id 209 manufacturerid 1d
2018-01-25 09:01:25.652 Info, Product name collision: VRF01-1LZ Multilevel Scene Switch - 1.5A Fan type 1001 id 209 manufacturerid 1d, collides with VRF01-1LZ Quiet Fan Speed Control, type 1001 id 209 manufacturerid 1d
2018-01-25 09:01:25.655 Info, Node001, Opening config param file config/aeotec/zw090.xml
2018-01-25 09:01:25.655 Detail, Node001, QueryStage_NodePlusInfo
2018-01-25 09:01:25.655 Detail, Node001, QueryStage_SecurityReport
2018-01-25 09:01:25.655 Detail, Node001, QueryStage_ManufacturerSpecific2
2018-01-25 09:01:25.655 Detail, Node001, QueryStage_Versions
2018-01-25 09:01:25.655 Detail, Node001, QueryStage_Instances
2018-01-25 09:01:25.655 Info, Node001, Essential node queries are complete
2018-01-25 09:01:25.655 Detail, Node001, QueryStage_Static
2018-01-25 09:01:25.655 Detail, Node001, QueryStage_Associations
2018-01-25 09:01:25.655 Detail, Node001, QueryStage_Neighbors
2018-01-25 09:01:25.655 Detail, Requesting routing info (neighbor list) for Node 1
2018-01-25 09:01:25.655 Detail, Node001, Queuing (Command) Get Routing Info (Node=1): 0x01, 0x07, 0x00, 0x80, 0x01, 0x00, 0x00, 0x03, 0x7a
2018-01-25 09:01:25.655 Detail, Node001, Queuing (Query) Query Stage Complete (Neighbors)
2018-01-25 09:01:25.655 Detail, Node001, Notification: EssentialNodeQueriesComplete
2018-01-25 09:01:25.656 Detail,
2018-01-25 09:01:25.656 Info, Node001, Sending (Command) message (Callback ID=0x00, Expected Reply=0x80) - Get Routing Info (Node=1): 0x01, 0x07, 0x00, 0x80, 0x01, 0x00, 0x00, 0x03, 0x7a
2018-01-25 09:01:25.660 Detail, Node001, Received: 0x01, 0x20, 0x01, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5e
2018-01-25 09:01:25.660 Detail,
2018-01-25 09:01:25.660 Info, Node001, Received reply to FUNC_ID_ZW_GET_ROUTING_INFO
2018-01-25 09:01:25.660 Info, Node001, Neighbors of this node are:
2018-01-25 09:01:25.660 Info, Node001, (none reported)
2018-01-25 09:01:25.660 Detail, Expected reply was received
2018-01-25 09:01:25.660 Detail, Message transaction complete
2018-01-25 09:01:25.660 Detail,
2018-01-25 09:01:25.660 Detail, Node001, Removing current message
2018-01-25 09:01:25.660 Detail, Node001, Query Stage Complete (Neighbors)
2018-01-25 09:01:25.660 Detail, Node001, AdvanceQueries queryPending=0 queryRetries=0 queryStage=Session live=1
2018-01-25 09:01:25.660 Detail, Node001, QueryStage_Session
2018-01-25 09:01:25.661 Detail, Node001, QueryStage_Dynamic
2018-01-25 09:01:25.661 Detail, Node001, QueryStage_Configuration
2018-01-25 09:01:25.661 Detail, Node001, QueryStage_Complete
2018-01-25 09:01:25.661 Warning, CheckCompletedNodeQueries m_allNodesQueried=0 m_awakeNodesQueried=0
2018-01-25 09:01:25.661 Warning, CheckCompletedNodeQueries all=1, deadFound=0 sleepingOnly=1
2018-01-25 09:01:25.661 Info, Node query processing complete.
2018-01-25 09:01:25.661 Detail, Node001, Notification: NodeQueriesComplete
2018-01-25 09:01:25.661 Detail, contrlr, Notification: AllNodesQueried


Note that it finds the correct .xml file for my device!

Once this is all working, go ahead and compile domoticz
cd /home/domoticz/
git clone https://github.com/domoticz/domoticz.git domoticz
cd domoticz
cmake -DCMAKE_BUILD_TYPE=Release
make -j 2


change the number to how many cores you're willing to use to speed up the build.

Then for autostart

nano /usr/local/etc/rc.d/domoticz


and paste the following

#! /bin/sh
#
#

# PROVIDE: domoticz
# REQUIRE: LOGIN cleanvar
# KEYWORD: shutdown

#
# Add the following lines to /etc/rc.conf to enable domoticz:
#
#domoticz_enable (bool): set to "YES" to start domotics at boot
#domoticz_dbdir (str): Default to "/var/db/domoticz"
# domoticz database directory
#domoticz_user (str): Default to www, user for starting domoticz
#domoticz_group (str): Default to www, group for stating domoticz
#domoticz_pidfile (str): Custum PID file path and name
# Default to "/var/run/domoticz/${hostname}.pid".
#domoticz_args (str): Custom additional arguments to be passed
#

. /etc/rc.subr

name="domoticz"
rcvar="domoticz_enable"
stop_cmd="${name}_stop"

load_rc_config $name

: ${domoticz_dbdir:="/home/domoticz/domoticz"}
: ${domoticz_user:=root}
: ${domoticz_group:=wheel}
: ${domoticz_enable:=NO}
: ${domoticz_directory:=/home/domoticz/domoticz/domoticz}
: ${domoticz_args:="-syslog -daemon"}

#: ${domoticz_args:="-syslog -dbase /home/domoticz/domoticz/db/domoticz.db -daemon -wwwbind 0.0.0.0 -p /var/run/domoticz_1.pid"}

pidfile=${domoticz_pidfile:-"/var/run/domoticz/${hostname}.pid"}

command="/home/domoticz/domoticz/domoticz"
command_args="-dbase ${domoticz_dbdir}/domoticz.db -pidfile ${pidfile} ${domoticz_args}"

domoticz_stop() {
if [ -e "${pidfile}" ]; then
echo "Stopping ${name}..."
kill -9 `cat ${pidfile}`
rm ${pidfile}
else

run_rc_command "$1"


If someone could pitch in to clean up the rc.d file that would be much appreciated!

That's it, after you have set it up, you can add the Z-Wave stick in the Domoticz webgui.
 
Last edited:
Status
Not open for further replies.
Top