Page 9 of 94

Re: domoticz in synology as package! Available now.

Posted: Tuesday 14 April 2015 11:05
by pilgou60
Hello everybody.
I'm a new french and i would like to say thanks to everybody whose help us to setup our NAS. As you can see, i don't speak very well english but i would try to be clear.
I have a Synology ds214play with dsm 5.1.5022.

I installed on it domoticz v2258 and USB Serial Drivers v3.0.2 downloaded on your website http://jadahl.dscloud.me/sspks/?arch=evansport .

My usb receptor is SIGMA z-WAVE USB PLUS. (http://www.domotique-store.fr/domotique ... signs.html)

apparently, this dongle is not recognize. this is resutlt from dmesg command.

[323446.835258] usb 1-1: new full-speed USB device number 3 using ehci_hcd
[323447.380698] usbcore: registered new interface driver cdc_acm

Could you help me to setup my ds214play to work with this USB dongle or advise me to buy a new USB dongle that work with z-wave ZG8101.

Thanks a lot for your help.
Bruno

Re: domoticz in synology as package! Available now.

Posted: Tuesday 14 April 2015 23:10
by jhsim
Doume wrote:You can only do that if your telnet session is 'root' itself....
OK, Doume, now I'm out of my depth.

Re: domoticz in synology as package! Available now.

Posted: Wednesday 15 April 2015 8:29
by kaivalagi
jhsim wrote:
Doume wrote:You can only do that if your telnet session is 'root' itself....
OK, Doume, now I'm out of my depth.
Login to the command line with username "root" and password the same as your administrator account then try doing the chmod

Re: domoticz in synology as package! Available now.

Posted: Wednesday 15 April 2015 11:10
by jhsim
kaivalagi wrote:
jhsim wrote:
Doume wrote:You can only do that if your telnet session is 'root' itself....
OK, Doume, now I'm out of my depth.
Login to the command line with username "root" and password the same as your administrator account then try doing the chmod
That's it! RFXCOM and Z-wave both working now!

Thank you so much :-)

Re: domoticz in synology as package! Available now.

Posted: Wednesday 15 April 2015 11:59
by jumbotroll
pilgou60 wrote:Hello everybody.
I'm a new french and i would like to say thanks to everybody whose help us to setup our NAS. As you can see, i don't speak very well english but i would try to be clear.
I have a Synology ds214play with dsm 5.1.5022.

I installed on it domoticz v2258 and USB Serial Drivers v3.0.2 downloaded on your website http://jadahl.dscloud.me/sspks/?arch=evansport .

My usb receptor is SIGMA z-WAVE USB PLUS. (http://www.domotique-store.fr/domotique ... signs.html)

apparently, this dongle is not recognize. this is resutlt from dmesg command.

[323446.835258] usb 1-1: new full-speed USB device number 3 using ehci_hcd
[323447.380698] usbcore: registered new interface driver cdc_acm

Could you help me to setup my ds214play to work with this USB dongle or advise me to buy a new USB dongle that work with z-wave ZG8101.

Thanks a lot for your help.
Bruno

Try the new Domoticz v2.0.2362-6 version with support for Z-wave. Download here: http://jadahl.dscloud.me/sspks/?arch=evansport
Regards
Jumbotroll

Re: domoticz in synology as package! Available now.

Posted: Thursday 16 April 2015 18:11
by pilgou60
hello everybody
I installed new version od domoticz (v2.2362)
when i want to set USB ZWave usb dongle i have a message driver failed.
Could you help me please.

2015-04-16 18:08:02.785 OpenZWave: Closed
2015-04-16 18:08:12.088 EventSystem stopped...
2015-04-16 18:08:12.113 OpenZWave: Starting...
2015-04-16 18:08:12.113 OpenZWave: using config in: /usr/local/domoticz/Config/
2015-04-16 18:08:30.614 Hardware Monitor: Fetching data (System sensors)
2015-04-16 18:08:32.142 Error: OpenZWave: Driver Failed!!

Re: domoticz in synology as package! Available now.

Posted: Thursday 16 April 2015 18:41
by pilgou60
for jhsim :
I use z-wave usb plus dongle. It's not the same as z-wave usb dongle. The chipset is different.

Are you sure this device is included in the driver package 3.0.2 ?

Re: domoticz in synology as package! Available now.

Posted: Thursday 16 April 2015 18:42
by pilgou60
Sorry.
thanks for you help.

Re: domoticz in synology as package! Available now.

Posted: Friday 17 April 2015 12:59
by raxor
Hi all

After a hard and funny work i have mi XPENology DSM 5.1 (HP 54NL) working with Domoticz. I'm sysadmin and have some skill in development.

Material i use: kankunit smartplugs wifi (x4 relay.cgi hacked), 3x FIBARO x2 1.5 relay and Controller Aeon Labs Z-Stick S2

Version: domoticz_bromolow-5.1_2.0.2276-6.spk (openzw and usb drivers included) from this post https://dl.dropboxusercontent.com/u/180 ... 2276-6.spk
Debian-Chroot from Synocommunity for sh scripting and cron tasks

I want to give back to the community the knowledge I have gained researching on the internet

Codes are not mine, i only repair and debug code to make it work on synologys

Install debian-chroot

- In DSM 5.1
- Add synocommunity source in packages center
- Setup --> Packages source, add
Synocommunity -- http://packages.synocommunity.com/
In General TAB enable "Any editor"
- Apply
- Go to community packages and install debian-chroot
- Enable Debian-chroot

SSHd synology NAS and enter in CHROOT session

Code: Select all

/var/packages/debian-chroot/scripts/start-stop-status chroot
Error code is normal.

Code: Select all

aptitude update

Code: Select all

aptitude upgrade

Code: Select all

aptitude install locales
(select en_US.UTF-8)

Code: Select all

pkg-reconfigure locales

Code: Select all

dpkg-reconfigure tzdata

Code: Select all

locale-gen en_US.UTF-8
this repair error code

Install packages: I need in the next example

Code: Select all

aptitude install snmpd

Code: Select all

aptitude install snmp

Code: Select all

aptitude install curl

Enable crontab from debian-chroot- AND cron job to retrieve snmp info from QNAP NAS every 5 minutes (you can put any .sh you want, and install any package you can need with "aptitude install")

Exit CHROOT session. CTRL + D or exit

In synology, create shell script in /usr/local/rc.d (when synology starts always execute scripts in this dir with start parameter).

nano /usr/local/rc.d/crontabchroot.sh

Code: Select all

#!/bin/sh
# starts the chroot cron service on startup and stops it
# on reboot/shutdown

case "$1" in
start)
 chroot /volume1/@appstore/debian-chroot/var/chroottarget /etc/init.d/cron start
 ;;
stop)
 chroot /volume1/@appstore/debian-chroot/var/chroottarget /etc/init.d/cron stop
 ;;
*)
 echo "Usage: $0 [start|stop]"
 ;;
esac

Code: Select all

chmod +x /usr/local/rc.d/crontabchroot.sh

Code: Select all

nano /volume1/@appstore/debian-chroot/var/chroottarget/etc/crontab
Add

Check every 5 minutes

Code: Select all

*/5 *   * * *   root    /usr/bin/qnap.sh

Code: Select all

nano /volume1/@appstore/debian-chroot/var/chroottarget/usr/bin/qnap.sh

Code: Select all

#!/bin/bash
 
 # Settings
 
 NASIP="192.168.1.xxx"		        # NAS IP Address
 PASSWORD="public"			# SNMP Password
 DOMO_IP="192.168.1.xxx"		        # Domoticz IP Address
 DOMO_PORT="8084"			# Domoticz Port
 NAS_IDX="23"				# Virtual switch NAS STATUS
 CPU_TEMP_IDX="24"			# Virtual temerature sensor IDX NAS CPU
 HD1_TEMP_IDX="25"			# Virtual temerature sensor IDX HD1
 
 # Check if NAS in online 
 
 PINGTIME=`ping -c 1 -q $NASIP | awk -F"/" '{print $5}' | xargs`
 
 echo $PINGTIME
 if expr "$PINGTIME" '>' 0
 then
 		curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$NAS_IDX" | grep "Status" | grep "On" > /dev/null
 
         if [ $? -eq 0 ] ; then
         	        # NAS already ON
        					echo "NAS already ON"
 
           	        # Temprature CPU
             			               CPUtemp=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.24681.1.2.6.0 | cut -c 2-3`
                        	               # Send data
                                               curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$CPU_TEMP_IDX&nvalue=0&svalue=$CPUtemp"
 
          	        # Temperature HD1
 						HDtemp1=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.24681.1.2.11.1.3.1 | cut -c 2-3`
 						# Send data
 						curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$HD1_TEMP_IDX&nvalue=0&svalue=$HDtemp1"
 
 		else
 			# NAS ON
        					echo "NAS ON"
        					# Send data
           				       curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$NAS_IDX&switchcmd=On"
 
           	        # Temprature CPU
             			              CPUtemp=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.24681.1.2.6.0 | cut -c 2-3`
                        	              # Send data
                                              curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$CPU_TEMP_IDX&nvalue=0&svalue=$CPUtemp"
 
          	        # Temperature HD1
 						HDtemp1=`snmpget -v 2c -c $PASSWORD -O qv $NASIP 1.3.6.1.4.1.24681.1.2.11.1.3.1 | cut -c 2-3`
 						# Send data
 						curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$HD1_TEMP_IDX&nvalue=0&svalue=$HDtemp1"
 
 	fi
 
 else
        	curl -s "http://$DOMO_IP:$DOMO_PORT/json.htm?type=devices&rid=$NAS_IDX" | grep "Status" | grep "Off" > /dev/null
        		# NAS uitgeschakeld
         if [ $? -eq 0 ] ; then
         			echo "NAS already OFF"
         			exit
         else
        				echo "NAS OFF"
        				# Send data
           				curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=switchlight&idx=$NAS_IDX&switchcmd=Off"
         fi
 
 fi

Code: Select all

chmod +x /volume1/@appstore/debian-chroot/var/chroottarget/usr/bin/qnap.sh
Enable qnap SNMP explained here: http://www.domoticz.com/wiki/NAS_Monitoring.

- And create dummy switch and sensors

My qnap have only one HD. If you want to monitoring any other HD or remaining HD size go to http://www.domoticz.com/wiki/NAS_Monitoring and view code

I Notice Remaining HD size code from wiki has bugged:

This part.....

Code: Select all

curl -s -i -H "Accept: application/json" "http://$DOMO_IP:$DOMO_PORT/json.htm?type=command&param=udevice&idx=$HD_REMAIN_IDX&nvalue=0&svalue=$size"
Returns: "1.68 TB" in my case, space betwen "8" and "T" makes url returns 404 response. TRim variable after pull data to Domoticz server solve problem. (i dont know how to).

Above info is valid to any sh cron job you want to launch

----------------------------------------------------------------------------------

Another objective achieved
Shutdown Windows computer (windows 7) from domoticz: chroot not needed

- SSHd Synology NAS

Code: Select all

nano /volume1/@appstore/domoticz/scripts/shutdown_PC.sh

Code: Select all

#!/bin/sh
#Shutdown Computer
# IP of computer and admin user needed
net rpc -S 192.168.1.xx -U USER%PWD shutdown -t 1 -f
(-f parameter force shutdown)

Code: Select all

chmod +x /volume1/@appstore/domoticz/scripts/shutdown_PC.sh
To no disable windows UAC you can insert reg info to accept RPC commands

In windows create reg file. enablerpcshutdown.reg

Code: Select all

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system]
"LocalAccountTokenFilterPolicy"=dword:00000001
- Execute to add to registry,

Enable remote registry service

- Execute CMD witch admin rights (search cmd in start button, right button in cmd.exe execute with admin rights)

Code: Select all

sc config RemoteRegistry start= auto
sc start RemoteRegistry
- reboot windows

In Domoticz create virtual switch
Switch type: push off button
Assign to off action:
"script://volume1/@appstore/domoticz/scripts/shutdown_PC.sh"
Save

Profit

I hope this can be useful to others and for me to remembers the steps to reproduce :D

Im noob on Domoticz (4 days) but, i'm very satisffied with my advances: blockly events to auto off some lights after time, Floorplan with image, Scenes (to lights off). I use OpenVPN to manage Domoticz from outside :D. hahaha My Wife hate's me, 4 days with no time for her. But now i sure my children do not left any light on when we leave our house.

Next target LUA scripting.

Thanks to community and developers

Re: domoticz in synology as package! Available now.

Posted: Friday 17 April 2015 21:56
by fwehrle
Thnak you vert much for sharing. I copy-paste it in a note reminder. :)
If you need help in lua scripting , tell me. :)

Re: domoticz in synology as package! Available now.

Posted: Monday 20 April 2015 20:27
by jumbotroll
See later post.

Re: domoticz in synology as package! Available now.

Posted: Wednesday 22 April 2015 7:06
by ab1976
Which version should I use on my DS211j? Thanks in advanced

ps I'm using RFXCOMe

Re: domoticz in synology as package! Available now.

Posted: Wednesday 22 April 2015 10:00
by jumbotroll
ab1976 wrote:Which version should I use on my DS211j? Thanks in advanced

ps I'm using RFXCOMe
What kind of CPU does my NAS have?
Check here:
http://forum.synology.com/wiki/index.ph ... y_NAS_have

DS211j have: Marvell Kirkwood mv6281 1.2Ghz ARM 16-bit@DDR2, 128MB of RAM.

http://jadahl.dscloud.me/sspks/?arch=88f6281

Regards
Jumbotroll

Re: domoticz in synology as package! Available now.

Posted: Monday 27 April 2015 14:58
by Nicogluck
Hi everyone,

My Domoticz (installed on my DS415play) gives frequently the following error message in the log :
Error: Error accessing automatic backup directories

I saw in different opened topics that Domoticz under Windows needs to be launched as administrator.
Is it the same here ?
Is there any solution ?

Thanks to all.

Re: domoticz in synology as package! Available now.

Posted: Monday 27 April 2015 16:31
by G3rard
Nicogluck wrote:Hi everyone,

My Domoticz (installed on my DS415play) gives frequently the following error message in the log :
Error: Error accessing automatic backup directories

I saw in different opened topics that Domoticz under Windows needs to be launched as administrator.
Is it the same here ?
Is there any solution ?

Thanks to all.
You have to give the right permissions to the backup folder and the subfolders with chmod and chown (add user Domoticz to group root).
I use Midnight Commander (http://packages.synocommunity.com) to do this.

Re: domoticz in synology as package! Available now.

Posted: Monday 27 April 2015 21:52
by Pvhpsb
Hello,
I try to work a lua script (script_time_ping.lua).
The message in the log file is LUA ping fail.
The message in the domoticz.log (ping: permission denied (are you root)?).
Can anyone help me out?
Regards,
Patrick

Re: domoticz in synology as package! Available now.

Posted: Monday 27 April 2015 23:35
by G3rard
Pvhpsb wrote:Hello,
I try to work a lua script (script_time_ping.lua).
The message in the log file is LUA ping fail.
The message in the domoticz.log (ping: permission denied (are you root)?).
Can anyone help me out?
Regards,
Patrick
User domoticz has no rights to use ping. I think i used the following, but I am not sure anymore because I have tried several things.

Code: Select all

chmod u+s /bin/ping
Let us know if this fixed the problem.

Re: domoticz in synology as package! Available now.

Posted: Tuesday 28 April 2015 14:02
by JesseKlaasse
jumbotroll wrote:Domoticz v2.0.2383-7 with openzwave and usbserial driver included.
DSM-5.1 5022.
Hi! First of all, thank you very much for this excellent package. It's working perfectly fine!
I have a question. By default, Domoticz is installed on the Synology as a http web site. Would it be possible to include the option to run it as https? I don't like the idea of a password transported plain text over http.

Re: domoticz in synology as package! Available now.

Posted: Tuesday 28 April 2015 15:36
by Pvhpsb
G3rard wrote:
Pvhpsb wrote:Hello,
I try to work a lua script (script_time_ping.lua).
The message in the log file is LUA ping fail.
The message in the domoticz.log (ping: permission denied (are you root)?).
Can anyone help me out?
Regards,
Patrick
User domoticz has no rights to use ping. I think i used the following, but I am not sure anymore because I have tried several things.

Code: Select all

chmod u+s /bin/ping
Let us know if this fixed the problem.
It,s works for me, thanks.
Regards

Re: domoticz in synology as package! Available now.

Posted: Tuesday 28 April 2015 18:39
by mvveelen
Kudo's for jumbotroll and his effort to make regular updates for the packages so far. I've updated my Domoticz twice today without any problems. Thanks for your effort and (please) keep up the good work !