Need help installing Aeotech Z-Stick Gen 5 on RPi

I’d like some help please getting this Z-Stick up and running. Before I plugged it in, I did a dmesg -w. Below is the output after plugging it in.

I’d really appreciate some help getting this Z-Stick running so I can add some Z-Wave devices. Thanks!

[19:34:28] openhabian@openHABianPi:~$ dmesg -w
[ 0.000000] Booting Linux on physical CPU 0xf00
[ 0.000000] Linux version 4.9.59-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #1047 SMP Sun Oct 29 12:19:23 GMT 2017
[ 0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
[ 0.000000] CPU: div instructions available: patching division code
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
[ 0.000000] OF: fdt:Machine model: Raspberry Pi 2 Model B Rev 1.1
[ 0.000000] cma: Reserved 8 MiB at 0x3ac00000
[ 0.000000] Memory policy: Data cache writealloc
[ 0.000000] On node 0 totalpages: 242688
[ 0.000000] free_area_init_node: node 0, pgdat 80c6f380, node_mem_map ba3a1000
[ 0.000000] Normal zone: 2133 pages used for memmap
[ 0.000000] Normal zone: 0 pages reserved
[ 0.000000] Normal zone: 242688 pages, LIFO batch:31
[ 0.000000] percpu: Embedded 14 pages/cpu @ba35c000 s25600 r8192 d23552 u57344
[ 0.000000] pcpu-alloc: s25600 r8192 d23552 u57344 alloc=14*4096
[ 0.000000] pcpu-alloc: [0] 0 [0] 1 [0] 2 [0] 3 _
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 240555
[ 0.000000] Kernel command line: bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=416 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=PARTUUID=a135bebf-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[ 0.000000] PID hash table entries: 4096 (order: 2, 16384 bytes)
[ 0.000000] Dentry cache hash table entries: 131072 (order: 7, 524288 bytes)
[ 0.000000] Inode-cache hash table entries: 65536 (order: 6, 262144 bytes)
[ 0.000000] Memory: 940368K/970752K available (7168K kernel code, 486K rwdata, 2012K rodata, 1024K init, 770K bss, 22192K reserved, 8192K cma-reserved)
[ 0.000000] Virtual kernel memory layout:
_ vector : 0xffff0000 - 0xffff1000 ( 4 kB)

_ fixmap : 0xffc00000 - 0xfff00000 (3072 kB)_
_ vmalloc : 0xbb800000 - 0xff800000 (1088 MB)_
_ lowmem : 0x80000000 - 0xbb400000 ( 948 MB)_
_ modules : 0x7f000000 - 0x80000000 ( 16 MB)_
_ .text : 0x80008000 - 0x80800000 (8160 kB)_
_ .init : 0x80b00000 - 0x80c00000 (1024 kB)_
_ .data : 0x80c00000 - 0x80c79834 ( 487 kB)_
_ .bss : 0x80c7b000 - 0x80d3b964 ( 771 kB)_
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=4, Nodes=1
[ 0.000000] Hierarchical RCU implementation.
[ 0.000000] Build-time adjustment of leaf fanout to 32.
[ 0.000000] NR_IRQS:16 nr_irqs:16 16
[ 0.000000] arm_arch_timer: Architected cp15 timer(s) running at 19.20MHz (phys).
[ 0.000000] clocksource: arch_sys_counter: mask: 0xffffffffffffff max_cycles: 0x46d987e47, max_idle_ns: 440795202767 ns
[ 0.000010] sched_clock: 56 bits at 19MHz, resolution 52ns, wraps every 4398046511078ns
[ 0.000030] Switching to timer-based delay loop, resolution 52ns
[ 0.000341] Console: colour dummy device 80x30
[ 0.001308] console [tty1] enabled
[ 0.001360] Calibrating delay loop (skipped), value calculated using timer frequency… 38.40 BogoMIPS (lpj=192000)
[ 0.001437] pid_max: default: 32768 minimum: 301
[ 0.001838] Mount-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.001889] Mountpoint-cache hash table entries: 2048 (order: 1, 8192 bytes)
[ 0.003210] Disabling memory control group subsystem
[ 0.003364] CPU: Testing write buffer coherency: ok
[ 0.003447] ftrace: allocating 22392 entries in 66 pages
[ 0.054831] CPU0: update cpu_capacity 1024
[ 0.054896] CPU0: thread -1, cpu 0, socket 15, mpidr 80000f00
[ 0.054970] Setting up static identity map for 0x100000 - 0x100034
[ 0.057785] CPU1: update cpu_capacity 1024
[ 0.057797] CPU1: thread -1, cpu 1, socket 15, mpidr 80000f01
[ 0.058819] CPU2: update cpu_capacity 1024
[ 0.058828] CPU2: thread -1, cpu 2, socket 15, mpidr 80000f02
[ 0.059814] CPU3: update cpu_capacity 1024
[ 0.059824] CPU3: thread -1, cpu 3, socket 15, mpidr 80000f03
[ 0.059949] Brought up 4 CPUs
[ 0.060150] SMP: Total of 4 processors activated (153.60 BogoMIPS).
[ 0.060184] CPU: All CPU(s) started in HYP mode.
[ 0.060213] CPU: Virtualization extensions available.
[ 0.061358] devtmpfs: initialized
[ 0.074904] VFP support v0.3: implementor 41 architecture 2 part 30 variant 7 rev 5
[ 0.075367] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.075445] futex hash table entries: 1024 (order: 4, 65536 bytes)
[ 0.076267] pinctrl core: initialized pinctrl subsystem
[ 0.077588] NET: Registered protocol family 16
[ 0.080165] DMA: preallocated 1024 KiB pool for atomic coherent allocations
[ 0.090649] hw-breakpoint: found 5 (+1 reserved) breakpoint and 4 watchpoint registers.
[ 0.090712] hw-breakpoint: maximum watchpoint size is 8 bytes.
[ 0.090937] Serial: AMBA PL011 UART driver
[ 0.093369] bcm2835-mbox 3f00b880.mailbox: mailbox enabled
[ 0.176336] bcm2835-dma 3f007000.dma: DMA legacy API manager at bb80f000, dmachans=0x1
[ 0.178795] SCSI subsystem initialized
[ 0.179032] usbcore: registered new interface driver usbfs
[ 0.179161] usbcore: registered new interface driver hub
[ 0.179342] usbcore: registered new device driver usb
[ 0.184719] raspberrypi-firmware soc:firmware: Attached to firmware from 2017-10-24 17:09
[ 0.186471] clocksource: Switched to clocksource arch_sys_counter
[ 0.241902] VFS: Disk quotas dquot_6.6.0
[ 0.242056] VFS: Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
[ 0.242377] FS-Cache: Loaded
[ 0.242768] CacheFiles: Loaded
[ 0.259237] NET: Registered protocol family 2
[ 0.260525] TCP established hash table entries: 8192 (order: 3, 32768 bytes)
[ 0.260692] TCP bind hash table entries: 8192 (order: 4, 65536 bytes)
[ 0.260911] TCP: Hash tables configured (established 8192 bind 8192)
[ 0.261060] UDP hash table entries: 512 (order: 2, 16384 bytes)
[ 0.261147] UDP-Lite hash table entries: 512 (order: 2, 16384 bytes)
[ 0.261495] NET: Registered protocol family 1
[ 0.262181] RPC: Registered named UNIX socket transport module.
[ 0.262227] RPC: Registered udp transport module.
[ 0.262258] RPC: Registered tcp transport module.
[ 0.262289] RPC: Registered tcp NFSv4.1 backchannel transport module.
[ 0.263389] hw perfevents: enabled with armv7_cortex_a7 PMU driver, 5 counters available
[ 0.266578] workingset: timestamp_bits=14 max_order=18 bucket_order=4
[ 0.285380] FS-Cache: Netfs ‘nfs’ registered for caching
[ 0.286836] NFS: Registering the id_resolver key type
[ 0.286911] Key type id_resolver registered
[ 0.286944] Key type id_legacy registered
[ 0.290235] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 251)
[ 0.290461] io scheduler noop registered
[ 0.290499] io scheduler deadline registered (default)
[ 0.290897] io scheduler cfq registered
[ 0.296745] BCM2708FB: allocated DMA memory fad00000
[ 0.296824] BCM2708FB: allocated DMA channel 0 @ bb80f000
[ 0.306541] Console: switching to colour frame buffer device 82x26
[ 0.316705] bcm2835-rng 3f104000.rng: hwrng registered
[ 0.319398] vc-mem: phys_addr:0x00000000 mem_base=0x3ec00000 mem_size:0x40000000(1024 MiB)
[ 0.325315] vc-sm: Videocore shared memory driver
[ 0.348445] brd: module loaded
[ 0.362590] loop: module loaded
[ 0.365307] Loading iSCSI transport class v2.0-870.
[ 0.368784] usbcore: registered new interface driver smsc95xx
[ 0.371425] dwc_otg: version 3.00a 10-AUG-2012 (platform bus)
[ 0.602243] Core Release: 2.80a
[ 0.604808] Setting default values for core params
[ 0.607458] Finished setting default values for core params
[ 0.810575] Using Buffer DMA mode
[ 0.813144] Periodic Transfer Interrupt Enhancement - disabled
[ 0.815720] Multiprocessor Interrupt Enhancement - disabled
[ 0.818352] OTG VER PARAM: 0, OTG VER FLAG: 0
[ 0.820980] Dedicated Tx FIFOs mode
[ 0.824072] WARN::dwc_otg_hcd_init:1032: FIQ DMA bounce buffers: virt = 0xbad14000 dma = 0xfad14000 len=9024
[ 0.829662] FIQ FSM acceleration enabled for :
_ Non-periodic Split Transactions_
_ Periodic Split Transactions_
_ High-Speed Isochronous Endpoints_
_ Interrupt/Control Split Transaction hack enabled_
[ 0.842807] dwc_otg: Microframe scheduler enabled
[ 0.842882] WARN::hcd_init_fiq:459: FIQ on core 1 at 0x8058f5b0
[ 0.845495] WARN::hcd_init_fiq:460: FIQ ASM at 0x8058f920 length 36
[ 0.848126] WARN::hcd_init_fiq:486: MPHI regs_base at 0xbb87a000
[ 0.850804] dwc_otg 3f980000.usb: DWC OTG Controller
[ 0.853443] dwc_otg 3f980000.usb: new USB bus registered, assigned bus number 1
[ 0.856129] dwc_otg 3f980000.usb: irq 62, io mem 0x00000000
[ 0.858801] Init: Port Power? op_state=1
[ 0.861357] Init: Power Port (0)
[ 0.864142] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[ 0.866802] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.869408] usb usb1: Product: DWC OTG Controller
[ 0.871950] usb usb1: Manufacturer: Linux 4.9.59-v7+ dwc_otg_hcd
[ 0.874518] usb usb1: SerialNumber: 3f980000.usb
[ 0.878130] hub 1-0:1.0: USB hub found
[ 0.880651] hub 1-0:1.0: 1 port detected
[ 0.883877] dwc_otg: FIQ enabled
[ 0.883885] dwc_otg: NAK holdoff enabled
[ 0.883891] dwc_otg: FIQ split-transaction FSM enabled
[ 0.883909] Module dwc_common_port init
[ 0.884244] usbcore: registered new interface driver usb-storage
[ 0.887074] mousedev: PS/2 mouse device common for all mice
[ 0.890840] bcm2835-wdt 3f100000.watchdog: Broadcom BCM2835 watchdog timer
[ 0.893755] bcm2835-cpufreq: min=600000 max=900000
[ 0.896883] sdhci: Secure Digital Host Controller Interface driver
[ 0.899507] sdhci: Copyright© Pierre Ossman
[ 0.902416] sdhost-bcm2835 3f202000.sdhost: could not get clk, deferring probe
[ 0.905388] sdhci-pltfm: SDHCI platform and OF driver helper
[ 0.908955] ledtrig-cpu: registered to indicate activity on CPUs
[ 0.911871] hidraw: raw HID events driver © Jiri Kosina
[ 0.914894] usbcore: registered new interface driver usbhid
[ 0.917689] usbhid: USB HID core driver
[ 0.921434] vchiq: vchiq_init_state: slot_zero = 0xbad80000, is_master = 0
[ 0.925913] [vc_sm_connected_init]: start
[ 0.934810] [vc_sm_connected_init]: end - returning 0
[ 0.938098] Initializing XFRM netlink socket
[ 0.940859] NET: Registered protocol family 17
[ 0.943710] Key type dns_resolver registered
[ 0.946818] Registering SWP/SWPB emulation handler
[ 0.950485] registered taskstats version 1
[ 0.959976] uart-pl011 3f201000.serial: cts_event_workaround enabled
[ 0.962915] 3f201000.serial: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[ 1.890877] console [ttyAMA0] enabled
[ 1.899475] sdhost: log_buf @ bad13000 (fad13000)
[ 1.986507] mmc0: sdhost-bcm2835 loaded - DMA enabled (>1)
[ 1.994910] of_cfs_init
[ 2.000211] of_cfs_init: OK
[ 2.006196] Waiting for root device PARTUUID=a135bebf-02…
[ 2.016729] Indeed it is in host mode hprt0 = 00021501
[ 2.113717] random: fast init done
[ 2.133468] mmc0: host does not support reading read-only switch, assuming write-enable
[ 2.148656] mmc0: new high speed SDHC card at address 0001
[ 2.157820] mmcblk0: mmc0:0001 GB1QT 29.8 GiB
[ 2.166907] mmcblk0: p1 p2
[ 2.216508] usb 1-1: new high-speed USB device number 2 using dwc_otg
[ 2.225890] Indeed it is in host mode hprt0 = 00001101
[ 2.249262] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
[ 2.259525] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
[ 2.420529] EXT4-fs (mmcblk0p2): recovery complete
[ 2.432033] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
[ 2.445779] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
[ 2.456916] usb 1-1: New USB device found, idVendor=0424, idProduct=9514
[ 2.464235] devtmpfs: mounted
[ 2.472486] usb 1-1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.484478] Freeing unused kernel memory: 1024K
[ 2.493188] hub 1-1:1.0: USB hub found
[ 2.500253] hub 1-1:1.0: 5 ports detected
[ 2.826541] usb 1-1.1: new high-speed USB device number 3 using dwc_otg
[ 2.924219] systemd[1]: System time before build time, advancing clock.
[ 2.966932] usb 1-1.1: New USB device found, idVendor=0424, idProduct=ec00
[ 2.976973] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[ 2.990526] smsc95xx v1.0.5
[ 3.047073] NET: Registered protocol family 10
[ 3.068624] ip_tables: © 2000-2006 Netfilter Core Team
[ 3.091591] smsc95xx 1-1.1:1.0 eth0: register ‘smsc95xx’ at usb-3f980000.usb-1.1, smsc95xx USB 2.0 Ethernet, b8:27:eb:b4:d6:0d
[ 3.113964] systemd[1]: systemd 232 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
[ 3.142692] systemd[1]: Detected architecture arm.
[ 3.163009] systemd[1]: Set hostname to .
[ 3.242441] uart-pl011 3f201000.serial: no DMA platform data
[ 3.703099] systemd[1]: Created slice User and Session Slice.
[ 3.716388] systemd[1]: Listening on udev Kernel Socket.
[ 3.728997] systemd[1]: Listening on Journal Socket (/dev/log).
[ 3.742601] systemd[1]: Created slice System Slice.
[ 3.755307] systemd[1]: Created slice system-getty.slice.
[ 3.767689] systemd[1]: Reached target Slices.
[ 3.779415] systemd[1]: Created slice system-systemd\x2dfsck.slice.
[ 4.439187] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
[ 4.589583] systemd-journald[127]: Received request to flush runtime journal from PID 1
[ 4.981195] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[ 6.869247] smsc95xx 1-1.1:1.0 eth0: hardware isn’t capable of remote wakeup
[ 6.869534] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 7.098676] Adding 102396k swap on /var/swap. Priority:-1 extents:1 across:102396k SSFS
[ 8.401267] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC1E1
[ 8.401475] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 27.183283] random: crng init done
[181459.941441] warning: `/bin/ping’ has both setuid-root and effective capabilities. Therefore not raising all capabilities.
[343992.532014] usb 1-1.5: new full-speed USB device number 4 using dwc_otg
[343992.665359] usb 1-1.5: New USB device found, idVendor=0658, idProduct=0200
[343992.665377] usb 1-1.5: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[343993.064241] cdc_acm 1-1.5:1.0: ttyACM0: USB ACM device
[343993.065193] usbcore: registered new interface driver cdc_acm
[343993.065200] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters

So your system loaded the Aeotech hardware, perhaps asking something more specific?

1 Like

Thanks @anonymous.one! You’re right, the stick is installed. The only Z-Wave device I currently have is the Aeotech MultiSensor 6. When I use the stick binding to search for devices, it finds the MultiSensor. Once I name it and add it, I click the pencil to edit the settings but the checkmark button to save my changes is grayed out. Any ideas? Appreciate your response!

I too have this problem. My research says that it’s parameter 9: Report the Power mode. This parameter is incorrectly defined and displays 256 in my UI. It is also underlined with a RED line indicating the invalid value. The valid values I believe are 0 & 1. If the DB entry gets fixed this should work for us again. If you need to edit another parameter right now, you can use HABmin, it doesn’t lock you out of the configuration because of the one bad parameter.

A screenshot(s) may be helpful so we are looking at the same spot?

Note the Overview section for Parameter 9. It states this parameter cannot be used as Get/Set usage. So it’s not editable. Not sure if that is part of the reason that the parameter reports with the Red Underline. You can also see the Blue circle is not available for Click to Save.

Same for me tonight after I reset the sensor and discovered it again. Any ideas on how to get this to work?

I said it will not be fixed until the Z-Wave DB entry is corrected or underlying bug fixed. I responded earlier that you can use HABmin to edit OTHER parameters. You can edit the Channels in PaperUI, just click on the X in the upper right.

What is you issue?

@Toneus… my issue is I have installed OH2 on a RPi within the past few days and have been able to spend only a few hours trying to learn/understand something that is COMPLETELY new to me. I’m sorry, but I just don’t have the experience you do and I’m trying to get help. Some of what you say doesn’t really mean anything to me yet since I’m still learning.

How do I run HABmin? What does “just click on the X in the upper right” do other than just close the config window?

Ok, I understand. Believe it or not, you will pick it up pretty fast. The Sensor is not the easiest device to cut your teeth on because there is so much going on, but we’ll get you through it.

In OpenHAB there are multiple Admin UIs. Take this with a grain of salt, but PaperUI the Orange pages is the main admin page going forward. HABmin is very similar and is built using a similar structure. HABmin is an optional UI that you can enable in the PaperUI pages.

To enable HABmin
In the PaperUI, click Ad-Ons on the left menu list. Then on the right in the orange title bar click User Interfaces. Install the HABmin UI. It should install and start automatically.

Then go to the URL https://youropenhabhost:8080/start/index

You should now see the HABmin page as an available UI.

Each UI is divided into sections, Basically Control, Things & Items Config, and Add-Ons.

Things are devices, Items are Switches, Numbers, and other endpoints.

Channels are the same as the links to the Items or the Items themselves.

What would you like to do next?

1 Like

Thanks @Toneus! What I’d like to do next is have a light turn on when motion is detected and then turn off after 5 minutes once no further motion has been detected. I’d like to write this automation in PaperUI or HABmin since writing rules as code is above my skills at the moment.

My sensor seems to be installed. Although it would be nice to be able to confirm it’s working correctly.

Ok, let me start by saying what you’re trying to do is not difficult, it’s not even long. But what is below is going to look complex at first. Take your time and we’ll get you through it.

I and many other currently do all rules and other configuration in code. It’s not difficult and that is what most of the example you will encounter here on the community and in the docs. So I suggest using an editor on the RPi and using the following.

You need to find your root directory for the configuration files on the RPi. In there you will find an items/ and rules/ directories (and others).

In the rules directory create a file named motion.rules. Paste the following code and make the edits.

var Timer myTimer_KT_Motion = null
val int timeoutMinutes = 3

rule "Kitchen Motion Detection"
when
// The following Item Kitchen_Motion should be the Thing that the Channel is Linked to in Paper UI.
     Item Kitchen_Motion changed to ON
then
//   You will want to create a rule which determines when it is Day and When it is Night. Once you have implemented
//   Day Night states, you can enable the following line. Remember to uncomment the last brace at the bottom too.
//   if ( NightState.state==ON && Lt_FR_Table.state==OFF ) {

//   This checks to see if there is currently a timer that exists.
      if ( myTimer_KT_Motion===null ) {
         logInfo("KTMotion", "Motion detected in the Kitchen turning on lights for {} minutes.", timeoutMinutes)

//   Change Lt_Kitchen to be a Switch thing.
         Lt_Kitchen.sendCommand(ON)

//   I have two lights that I turn on for motion
//         Lt_FR_Table.sendCommand(ON)

         myTimer_KT_Motion = createTimer(now.plusMinutes(timeoutMinutes), [|
         logInfo("KTMotion", "Timer expired turning off lights")

//   Change Lt_Kitchen to be a Switch thing.
         Lt_Kitchen.sendCommand(OFF)

//  Turning off my second light
//         Lt_FR_Table.sendCommand(OFF)

         myTimer_KT_Motion = null
         ])
      }
      else {
         logInfo("KTMotion", "Motion detected in Kitchen rescheduling timer, adding {} minutes.", timeoutMinutes )
         myTimer_KT_Motion.reschedule(now.plusMinutes(timeoutMinutes))
      }

// Uncomment the following curly brace if you enable the first IF statement above.
//   }

end

I create items that I link the Channel to. You likely have linked or automatically (easy mode) created the items. You will need to get the name of the Item that is Linked to the Alarm Channel for the sensor. You can expand it by clicking on the Blue circle. If you click on the copy icon at the end of the text it will copy the Linked Item to your Clipboard. Mine is Kitchen_Motion. Back to this in a moment. See the image below for a better idea of where. You will also do this for any Light you want to control. That screen shot is below too to help you find yours.

  1. Change the Kitchen_Motion in the code to be the Sensor Alarm Item in PaperUI that you copied into your clipboard.

  1. Find the Thing (light) you want to control. Do the same copy and paste of the LInked Item. You can use the Copy icon again to make it easy. Mine is Lt_Kitchen.

You will want to check the logs when you do this work it will give you hints of problems. The log is likely in /var/log/openhab/openhab.log You can tail -f that file for a streaming log output.

2 Likes

Thank you @Toneus! I’m not going to lie, coding automation is really something that I feel like I will struggle with. I’m going to give this a go and see where it takes me. I REALLY appreciate you taking the time to put all of that together.

You literally have to change two parameters in three places in that code. Otherwise, it will just work. The hard part is learning your way around the PaperUI and getting the right values to put into the code. It just looks crazy. I commented all the blocks that you don’t need or might use once you become more comfortable.

Standing by…

I have found the expire binding to also be useful in the case of turning off lights when combined with a motion sensor.

Switch basement “Playroom” (AllLights) { expire=“15m,command=OFF”,channel=“zwave:device:zwavemaster:node27:switch_dimmer” }

What I have found is that my motion sensor is only on for 5 to 8 mins and my rule is as follows

rule “Turn on playroom light"
when
Item basement_motion received update
then
if ( basement_motion.state == ON ) {
basement_play_dim.sendCommand(“100”)
basement_play.sendCommand(“ON”)
logInfo(”/var/log/openhab2/openhab.log", “Basement Rule 2: Turn on playroom light to 100% due to motion”)

After changing the expire from 5 mins to 15 mins, its been working great. And if you are wondering why I am sending a 100 and ON command to the same switch, it is an odd bug/issue I have come across with my lightswitch, easier to update both; and down the road when it is no longer needed for a playroom it will morph into something that will use the dimmer functionality.
I would suggest @162884 to explore the rule files and item files as the expire binding can save on having to write out a lot of timer based rules.

Are you sure that you shouldn’t just be using the straight values in sendCommand()? I don’t think the quoting is required, and I wonder if you are faking it out with a string 100 by quoting it. There would be a lot more people that would be raising hell if sendCommand wasn’t working right with All Devices.

basement_play_dim.sendCommand(100)

basement_play.sendCommand(ON)

Aw snap that explains the ON/OFF issue I’ve had with that switch!

However for dimmers the quotes are needed to set the lighting value, I have two dimmers and both are working as intended this way. However this has peaked my interest so I may give it a try tonight.

Kudos @Toneus

@Toneus, is this the rules directory I need to put the motion.rules file? I’m ready to tackle this tonight. Thanks!

[18:45:58] openhabian@openHABianPi:/etc/openhab2/rules$

I connect to my RPi via SSH from a Mac using the Terminal app.

Looks about right. if you cd back one directory, are there several other directories like html, icons, items,… then yes.

Yes there is… here’s my rule. I’m sure I missed some things.

var Timer myTimer_KT_Motion = null
val int timeoutMinutes = 3

rule "Kitchen Motion Detection"
when
// The following Item Alarm (burglar) should be the Thing that the Channel is Linked to in Paper UI.
Item Alarm (burglar) changed to on
then
// you will want to create a rule which determines when it is day and when it is night. once you have implemented
// day night states, you can enable the following line. remember to uncomment the last brace at the bottom too.
// if ( nightstate.state==on && lt_fr_table.state==off ) {

// this checks to see if there is currently a timer that exists.
if ( mytimer_kt_motion===null ) {
loginfo(“ktmotion”, “motion detected in the Family Room turning on lights for {} minutes.”, timeoutminutes)

// change Switch to be a switch thing.
Switch.sendcommand(on)

// I have two lights that I turn on for motion
// Lt_FR_Table.sendCommand(ON)

     myTimer_KT_Motion = createTimer(now.plusMinutes(timeoutMinutes), [|
     logInfo("KTMotion", "Timer expired turning off lights")

// Change Switch to be a Switch thing.
Switch.sendCommand(OFF)

// Turning off my second light
// Lt_FR_Table.sendCommand(OFF)

     myTimer_KT_Motion = null
     ])
  }
  else {
     logInfo("KTMotion", "Motion detected in Kitchen rescheduling timer, adding {} minutes.", timeoutMinutes )
     myTimer_KT_Motion.reschedule(now.plusMinutes(timeoutMinutes))
  }

// Uncomment the following curly brace if you enable the first IF statement above.
// }

end