I would like to know if anyone has a very simple arduino only example the configuration file and myhouse file? It wouldn't hurt if it included the use of the Webserver.
Thanks in advance for any help
Ronnie
Many thanks
Ronnie
George, thanks for sharing your file. Haven't looked at it in a while.
In my newer platform I added an SMTP object / notification object that can be mapped to as well, maybe something like that should be created/ported in pytomation? https://github.com/zonyl/netomity/blob/master/NetomityTests/Devices/NotificationTests.cs
Welcome to the platform Ronnie!
-J
--
You received this message because you are subscribed to the Google Groups "pytomation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytomation+...@googlegroups.com.
To post to this group, send email to pytom...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Ok I have pytomation installed (i think correctly). I have installed in the default location with all of the dependencies from requirements.txt satisfied.I was wondering if I needed to restart the computer after a change to the code or if i can just restart the script?When i try to restart the process using "/etc/init.d/pytomation restart" I get "failed to kill 3045: No such process"I have the uno driver working (tested by sending values via serial monitor).I haven't tried playing with the web interface except to simply try to view it and i get a connection refused error (with instance file examples).I made a new instance Myhouse.py based on the code from the first response .import selectfrom pytomation.interfaces import Arduino, Serial, Command
from pytomation.devices import Door, Light
# Configure the interfaceuno = Arduino(Serial('/dev/ttyACM0', 9600))#Define I/O points.uno.setChannel('ADIC')uno.setChannel('ADON')#Use in a Light and Doord_bedroom = Door(address='ADIC',devices=(uno),name='Master Bedroom Door')l_bedroom = Light(address='ADON',devices=(uno),name='Master Bedroom Light')
I guess its my ignorance of python thats holding me up here. From arduino I would expect the code to have at least something likeif (d_bedroom==HIGH) {digitalWrite(l_bedroom, HIGH);}else {digitalWrite( l_bedroom, LOW);}
Traceback (most recent call last):File "/home/pytomation/pytomation.py", line 4, in <module>from pytomation.common import config, pytomation_systemFile "/home/pytomation/pytomation/common/__init__.py", line 1, in <module>from .pytomation_system import *File "/home/pytomation/pytomation/common/pytomation_system.py", line 4, in <module>from ..utility.periodic_timer import PeriodicTimerFile "/home/pytomation/pytomation/utility/__init__.py", line 1, in <module>from .cron_timer import *File "/home/pytomation/pytomation/utility/cron_timer.py", line 12, in <module>from .periodic_timer import PeriodicTimerFile "/home/pytomation/pytomation/utility/periodic_timer.py", line 4, in <module>from apscheduler.schedulers.background import BackgroundSchedulerFile "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/background.py", line 4, in <module>from apscheduler.schedulers.base import BaseSchedulerFile "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/base.py", line 10, in <module>from tzlocal import get_localzoneImportError: No module named tzlocal
$ pip2 list
APScheduler (3.0.5)
apt-xapian-index (0.45)
apturl (0.4.1ubuntu4)
argparse (1.2.1)
BeautifulSoup (3.2.1)
bitsets (0.7.10)
chardet (2.0.1)
colorama (0.2.5)
command-not-found (0.3)
concepts (0.7.10)
configglue (1.1.2)
debtagshw (0.1)
defer (1.0.6)
dirspec (13.10)
dnspython (1.11.1)
duplicity (0.6.23)
features (0.5.5)
feedparser (5.1.3)
fileconfig (0.5.2)
gevent (1.0.2)
gevent-websocket (0.9.5)
graphviz (0.4.10)
greenlet (0.4.9)
html5lib (0.999)
httplib2 (0.8)
interruptingcow (0.6)
lockfile (0.8)
lxml (3.3.3)
Mako (0.9.1)
MarkupSafe (0.18)
mock (1.3.0)
nemo-emblems (0.0.1)
numpy (1.8.2)
oauthlib (0.6.1)
oneconf (0.3.7)
PAM (0.4.2)
paramiko (1.10.1)
pexpect (3.1)
phue (0.8)
Pillow (2.3.0)
pip (1.5.4)
piston-mini-client (0.7.5)
protobuf (2.5.0)
pycrypto (2.6.1)
pycups (1.9.66)
pycurl (7.19.3)
pyephem (3.7.6.0)
pygobject (3.12.0)
pygooglevoice (0.5, /home/ronnie/pytomation/pytomation/src/pygooglevoice)
pyharmony (1.0, /home/ronnie/pytomation/pytomation/src/pyharmony)
pyinotify (0.9.4)
pyjnest (0.6, /home/ronnie/pytomation/pytomation/src/pyjnest)
pyOpenSSL (0.13)
pyserial (2.6)
pysmbc (1.0.14.1)
python-apt (0.9.3.5)
python-debian (0.1.21-nmu2ubuntu2)
pytz (2015.7)
pyxdg (0.25)
reportlab (3.0)
requests (2.2.1)
sessioninstaller (0.0.0)
setuptools (3.3)
six (1.5.2)
system-service (0.1.6)
Twisted-Core (13.2.0)
Twisted-Names (13.2.0)
Twisted-Web (13.2.0)
tzlocal (1.2)
ujson (1.35)
urllib3 (1.7.1)
uTidylib (0.2)
wsaccel (0.6.2)
wsgiref (0.1.2)
zope.interface (4.0.5)
$ sudo python2 ./pytomation.py
Traceback (most recent call last):
File "./pytomation.py", line 4, in <module>
from pytomation.common import config, pytomation_system
File "/home/ronnie/pytomation/pytomation/pytomation/common/__init__.py", line 1, in <module>
from .pytomation_system import *
File "/home/ronnie/pytomation/pytomation/pytomation/common/pytomation_system.py", line 4, in <module>
from ..utility.periodic_timer import PeriodicTimer
File "/home/ronnie/pytomation/pytomation/pytomation/utility/__init__.py", line 1, in <module>
from .cron_timer import *
File "/home/ronnie/pytomation/pytomation/pytomation/utility/cron_timer.py", line 12, in <module>
from .periodic_timer import PeriodicTimer
File "/home/ronnie/pytomation/pytomation/pytomation/utility/periodic_timer.py", line 4, in <module>
from apscheduler.schedulers.background import BackgroundScheduler
File "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/background.py", line 4, in <module>
from apscheduler.schedulers.base import BaseScheduler
File "/usr/local/lib/python2.7/dist-packages/apscheduler/schedulers/base.py", line 15, in <module>
from apscheduler.executors.pool import ThreadPoolExecutor
File "/usr/local/lib/python2.7/dist-packages/apscheduler/executors/pool.py", line 2, in <module>
import concurrent.futures
ImportError: No module named concurrent.futures
import select
from pytomation.interfaces import Arduino, Serial, Command, PytoWebSocketServer, HTTP
from pytomation.devices import Door, Light
websocket = PytoWebSocketServer()
# Configure the interface
uno = Arduino(Serial('/dev/ttyACM0', 9600))
#Define I/O points.
uno.setChannel('ADON')
#Use in a Light
l_bedroom = Light(address='ADON',
devices=(uno),
name='Master Bedroom Light')
Thanks for the info on serial.
Awesome software BTW and again many thanks for the help
m_livingroom = Motion(address='AC',
devices=(uno),
delay={
Attribute.COMMAND: Command.STILL,
Attribute.SECS: 30,
},
name='Livingroom Motion',
l_livingroom = Light(address='AN',
devices=(uno2, m_livingroom),
trigger=({
'command': Command.ON,
'mapped': Command.OFF,
'source': m_livingroom,
'secs': 30,
},),
name='Livingroom Light',
commands=[Command.ON, Command.OFF])
About the ignore attribute, I have been able to make it work with the light switch. I just wasn't sure what device to ignore to make it effective for the Web interface.
commands=[Command.ON, Command.OFF])
I found this in an example. Used to only show those options on Web interface.
I did delete tho.
Thanks
Ronnie
--
You received this message because you are subscribed to the Google Groups "pytomation" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pytomation+...@googlegroups.com.
To post to this group, send email to pytom...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.