Hardware
========
-You need a ampmeter sensor that outputs an audio signal.
+You need a ammeter sensor that outputs an audio signal.
It has been tested with `this YHDC sensor`_.
addgroup --system ampy # create a dedicated group
adduser --system --ingroup ampy --home /var/lib/ampy --disabled-password --disabled-login ampy
+ chmod g+ws /var/lib/ampy/ # group can write, sticky group
adduser ampy audio # ampy can use audio
adduser www-data ampy # httpd in group ampy
Select the alsa audio input
---------------------------
-Run ``device.py`` to find out which entry you should use.
+Run ``device.py`` to select which entry you want to use.
Then adjust DEVICE in run.py
You'll need to adjust VOLUME_CONSTANT in run.py so that you get the correct voltage value.
+Starting and stoping a powerfull apliance you know the consuptium of, should give you a good start.
+
+Later on, you can adjust the value based on your legal counter. See bellow.
+
Autostart
---------
Counter initialization
----------------------
-If you have a regular electric meter::
+Point your browser to counterset.php.
- echo "123456" > /var/lib/ampy/counter
- chown ampy: /var/lib/ampy/counter
+You should do that from time to time. It will show you how off the system is. You can then adjust your VOLUME_CONSTANT in run.py.
Copyright
watch -n 0.5 rrdtool graphv - '-s' '1546280606' 'DEF:watts=/var/lib/rrdcached/db/power.rrd:watts:AVERAGE' 'VDEF:avg=watts,AVERAGE' 'VDEF:last=watts,LAST' 'PRINT:avg:%lf' 'PRINT:last:%lf'
Alors que ça si:
watch -n 0.5 rrdtool lastupdate --daemon /var/run/rrdcached.sock /var/lib/rrdcached/db/power.rrd
+
+ If you want to run in a cgroup2 protected container, you need to add:
+ lxc.cgroup2.devices.allow = c 116:* rwm