Re: Toon as a domotica controller?
Posted: Mon Dec 14, 2015 7:54 pm
Here's the original update script for 3.0.29.
Domotica - Home Automation Forum
https://www.domoticaforum.eu/
Code: Select all
-rw-r--r-- 1 root root 7525 Dec 15 09:41 base-qb2-ene_3.0.29-880-0_qb2.ipk
-rw-r--r-- 1 root root 148428 Dec 15 09:41 boot-logos_1.64-ene_qb2.ipk
-rw-r--r-- 1 root root 206675 Dec 15 09:41 firmware-ma_1.74_qb2.ipk
-rw-r--r-- 1 root root 197400 Dec 15 09:41 flash-gui_1.648-ene-qeio_qb2.ipk
-rw-r--r-- 1 root root 562747 Dec 15 09:41 flash-qwidget-diy_1.161-qeio_qb2.ipk
-rw-r--r-- 1 root root 56154 Dec 15 09:41 happ-kpi_1.119-ene_qb2.ipk
-rw-r--r-- 1 root root 175568 Dec 15 09:41 happ-pwrusage_1.416_qb2.ipk
-rw-r--r-- 1 root root 52630 Dec 15 09:42 happ-scsync_1.102_qb2.ipk
-rw-r--r-- 1 root root 50385 Dec 15 09:42 happ-smartplug_1.90_qb2.ipk
-rw-r--r-- 1 root root 170268 Dec 15 09:42 happ-thermstat_1.554-trunk_qb2.ipk
-rw-r--r-- 1 root root 20054 Dec 15 09:42 happ-usermsg_1.36_qb2.ipk
-rw-r--r-- 1 root root 36968 Dec 15 09:42 happ-weather_1.68_qb2.ipk
-rw-r--r-- 1 root root 29711 Dec 15 09:41 hcb-bxtproxy_1.70_qb2.ipk
-rw-r--r-- 1 root root 111531 Dec 15 09:42 hcb-config_1.218_qb2.ipk
-rw-r--r-- 1 root root 149656 Dec 15 09:41 hcb-core_1.144_qb2.ipk
-rw-r--r-- 1 root root 115749 Dec 15 09:41 hcb-netcon_1.224_qb2.ipk
-rw-r--r-- 1 root root 56363 Dec 15 09:41 hcb-rrd_2.125_qb2.ipk
-rw-r--r-- 1 root root 23459 Dec 15 09:42 hcb-watchdog_1.40_qb2.ipk
-rw-r--r-- 1 root root 51561 Dec 15 09:42 hdrv-hue_1.61-eneDevices_qb2.ipk
-rw-r--r-- 1 root root 96858 Dec 15 09:42 hdrv-p1_1.363_qb2.ipk
-rw-r--r-- 1 root root 261129 Dec 15 09:41 hdrv-zwave_1.505-ene_qb2.ipk
-rw-r--r-- 1 root root 22132 Dec 15 09:41 kernel-module-ftdi-sio_2.6.36-R07-h18_qb2.ipk
-rw-r--r-- 1 root root 10500 Dec 15 09:41 kernel-module-pl2303_2.6.36-R07-h18_qb2.ipk
-rw-r--r-- 1 root root 14715 Dec 15 09:41 libhcb-xml_1.83_qb2.ipk
-rw-r--r-- 1 root root 82856 Dec 15 09:42 libpcre_7.6-r8_qb2.ipk
-rw-r--r-- 1 root root 103529 Dec 15 09:42 lighttpd-mod-hcb-web_1.4.33-26_qb2.ipk
-rw-r--r-- 1 root root 121967 Dec 15 09:42 lighttpd_1.4.33-17_qb2.ipk
-rw-r--r-- 1 root root 2817466 Dec 15 09:41 qt-gui_1.3733_qb2.ipk
-rw-r--r-- 1 root root 12272555 Dec 15 09:42 qt-libs_5.3.1-06-setpos_qb2.ipk
Code: Select all
# HCBv2 static stuff
qtqt:245:respawn:/usr/bin/startqt >/dev/null 2>&1
Code: Select all
<Config>
<message>
<content>Merry Christmas!!</content>
<subject>A Wish</subject>
<subtitle>for everyone</subtitle>
<messageType>critical</messageType>
<received_t>2015-12-25 0:00</received_t>
<internalAddress></internalAddress>
<read_t></read_t>
<readMsgSend>1</readMsgSend>
<hideOnRemove>0</hideOnRemove>
<package>happ_usermsg</package>
<type>message</type>
<name>upgrade_msg</name>
<visibility>1</visibility>$ACTIONS //to do: show christmas tree.png
</message>
</Config>"
I was just about to ask thisIerlandfan wrote: You probably want to check /etc/inittab for (if not auto-added by opkg install)Code: Select all
# HCBv2 static stuff qtqt:245:respawn:/usr/bin/startqt >/dev/null 2>&1
By the way, you need to edit the iptables.conf every time Toon is software updated (And so SSH is again firewalled)
Edit: even if you upgrade manually!
So better way is to make a custom start-up script which modifies the iptables every time Toon reboots. Multiple ways of doing that. If anyone wants to write that part, "go your gang" as some soccer trainer probably will say some day
That's not really going to help you when all boot scripts are replaced in an update ( from /etc/inittab to /etc/default HCBv2). Better keep a small 3-pin plug dangling from your serial port to the outside of toon, just in case. The boot loader will not be replaced that often, if at all, so serial access through /dev/ttymxc0 wil not be compromised that easily.So better way is to make a custom start-up script which modifies the iptables every time Toon reboots.
Mine has "CurrentGasQuantity":"5914146.00", and 5914.211 m^3 on the meter. The meter has the actual value (in m^3), while gas readings through the M-bus to the P1 port are updated only once every hour, on the hour, in liters. Electricity data transferred to the P1 port are updated every 10 seconds. These data include total consumption and production, for the current tariff, the actual tariff, actual power uptake and power production (in case of solar panels or microWKK).I get 6,83 m3 on the toon's screen and 669490.00 from the json reply and I don't understand why.
This makes sense, and is actually also what is happening inside toon. happ_pwrusage has a data structure called midnightInfo. There just isn't any web handler to get itmarcelr wrote: So, to get daily consumption, record CurrentGasQuantity, take the number measured just after midnight, and subtract from all following readings. Update the midnight measurement every night to get accurate data every day.
No, but you CAN get the UNIX timestamp.happ_pwrusage has a data structure called midnightInfo. There just isn't any web handler to get it
Code: Select all
return file_get_contents( $toon_url.':'.$toon_port.'/happ_thermstat?action=printTableInfo');
Code: Select all
info = [
{'dataId':'0', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 0: 00 00, SlaveState burn=NoFlame, fault=0]'},
{'dataId':'1', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 1: 00 00]'},
{'dataId':'2', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 2: 00 00]'},
{'dataId':'3', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 3: 00 00]'},
{'dataId':'15', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 15: 00 00]'},
{'dataId':'17', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 17: 00 00, RelModLvl=0.00]'},
{'dataId':'25', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 25: 00 00, TempBoiler=0.00]'},
{'dataId':'5', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 5: 00 00]'},
{'dataId':'6', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 6: 00 00]'},
{'dataId':'9', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 9: 00 00]'},
{'dataId':'16', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 16: 00 00, RoomSetpoint=0.00]'},
{'dataId':'18', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 18: 00 00]'},
{'dataId':'24', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 24: 00 00, RoomTemperature=0.00]'},
{'dataId':'26', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 26: 00 00]'},
{'dataId':'27', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 27: 00 00]'},
{'dataId':'28', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 28: 00 00, TempReturn=0.00]'},
{'dataId':'35', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 35: 00 00]'},
{'dataId':'48', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 48: 00 00]'},
{'dataId':'56', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 56: 00 00, DHW Setpoint=0.00]'},
{'dataId':'57', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 57: 00 00]'},
{'dataId':'73', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 73: 00 00]'},
{'dataId':'113', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 113: 00 00]'},
{'dataId':'114', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 114: 00 00]'},
{'dataId':'115', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 115: 00 00]'},
{'dataId':'116', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 116: 00 00, BurnerStarts=0]'},
{'dataId':'117', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 117: 00 00]'},
{'dataId':'118', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 118: 00 00]'},
{'dataId':'119', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 119: 00 00]'},
{'dataId':'120', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 120: 00 00, BurnerHours=0]'},
{'dataId':'121', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 121: 00 00]'},
{'dataId':'122', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 122: 00 00]'},
{'dataId':'123', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 123: 00 00]'},
{'dataId':'127', 'value0':'00', 'value1':'00', 'updated':'0', 'description':'[ID 127: 00 00]'}
]