Some background to make Domoticz work:
You need to open port 7080 in the iptables.conf (See toonroot.txt)
I always reboot afterwards to reload the iptables but there's a way of reloading the iptables without reboot
but well, reboot works fine.
By the way, you need to edit the iptables.conf every time Toon is software updated (And so SSH is again firewalled)
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.
After the iptables are ok you have to enable this special webinterface since it's not the same as the one that comes default with the Toon. For that you have to edit this part in \HCBv2\config\hcb_project.xml into something like this:
Code: Select all
<!-- Release uses lighttpd; put hcb_web somewhere where its harmless -->
<port>7080</port>
<defaultEntry>/HCBv2/www/</defaultEntry>
<enforceWhitelist>0</enforceWhitelist>
<whitelist>
<item>hdrv_zwave</item>
</whitelist>
You probably have to restart some service but I always reboot since I never bothered what service to restart.
Not sure whether a
is needed.
If anyone can confirm this, that would be great.
If everything went fine you can connect to Toon by using your browser
Try this for example:
Code: Select all
http://ip_toon:7080/happ_thermstat?action=printTableInfo
( change the part http://ip_toon/ to your Toon IP)
If that works, continue
So now if everything went well we have a API like interface to connect to wich spits out valuable info.
I won't go into detail about every webhandler but you can find almost all of them by using
Code: Select all
strings -f \HCBv2\sbin\<binary-name> |grep web
In case of Domotica we want:
Code: Select all
http://ip_toon:7080/happ_thermstat?action=printTableInfo
These are the Opentherm dataID's with the corresponing values in not very handy human readible format.
(I'll get back on this)
We also want this:
Code: Select all
http://ip_toon:7080/happ_pwrusage?action=GetCurrentUsage
That's Electricity Usage. Something that is not working for the Domoticz Toon op afstand Domoticz plugin
I also use this one:
Code: Select all
http://ip_toon:7080/hdrv_zwave?action=getDevices.json
because I have a smoke detector and a Fibaro Smart plug.
Things like setting the temperature is done through Toon op afstand since I only wanted to monitor this data.
So how to push this data to Domoticz?
We need a few script for this. (Maybe some day I will make one script-to-do-it-all)
OT_data_json.php. This converts the gibberish Opentherm data into human friendly data (and in valid json format..)
E.g.
Code: Select all
{'dataId':'18', 'value0':'01', 'value1':'66', 'updated':'1449186252', 'description':'[ID 18: 01 66]'},,
becomes:
Code: Select all
{"dataId":"18","value":1.3984375,"Timestamp":"Fri 4 Dec 2015 0:44:52"}
(Which means my Waterpressure is currently 1.39 bar)
AGPO uses this value incorrectly as the threshold value for waterpressure but anyway
and it dumps the json file to /tmp/otttableout.txt
This is fed into Domoticz by "domoticz.toon.script"
It takes the values from the json data and pushes them to the http Domoticz API
There almost no error correction (Time...)
Anyway, put those in crontab:
*/1 * * * * /path-to-/OT_data_json.php
*/1 * * * * /path-to/Electricity_data_json.php
*/1 * * * * /path-to/domoticz.toon.script
*/1 * * * * /path-to/rookmelder_data_json.php
Unrar the attached scripts and upload to your Domoticz server
You probably need to do
to make them executable.
Edit OT_data_json.php and change the part http://IP_Toon/ to your Toon IP.
Edit domoticz.toon.script, change the part http://IP_Toon/ to your Toon IP and change to your idx values and your good to go.
Same thing for Electricity_data_json.php
Same thing for rookmelder_data_json.php
To do: Test the OT data for proper conversion. Probably OK but i never checked it. My AGPO CV is not sending every available value so it's possible there is an error typo/error/conversion-error in those not supported by my HVAC.
The scripts are running fine but will fail silently when an error is encountered
(I never noticed one though in about 4 months)
So to do: Error correction, they now fail silently when not running
To do: Get rid of /tmp/ottableout.txt (Debug legacy)
To do: Make a one-size-fits-all script with all available options and values to query. (Again debug legacy)
To do: Use some optional form of authentication for Domoticz.
To do: replace probably with confirmed...
Enjoy!