Page 1 of 1

Use Toon to switch Fibaro plugs

Posted: Tue Nov 21, 2017 2:48 pm
by Henk-JanS
I use my Synology NAS to switch on/off my Hue lights at convenient times. Until now, switching the Fibaro plugs I had was not possible: Toon can switch them on and off, but not according to a schedule. With the Fibaro plugs being quite expensive and still so limited, this frustrates many Toon users.

Now that my Toon is rooted I figured it shouldn't be too hard to actually find a way to resolve this. Many Toon features are called via web-type links or commands. Reading the smart meter values for instance via 192.168.1.11:10080/hdrv_zwave?action=ge ... vices.json. The output of the command includes a list of devices - not only the smart meter but also the Fibaro plugs configured in the system.

I could open the base URL http://192.168.1.11:10080/hdrv_zwave/index.html in any browser. This gives some sort of control panel with which you can switch on/off the Fibaro's. I traced what parameters were sent to the Toon to switch on/off and these are:

http://192.168.1.11:10080/hdrv_zwave?ac ... =4&state=1 for on and
http://192.168.1.11:10080/hdrv_zwave?ac ... =4&state=0 for off.

Scripting this turned out to be not very complex:

Code: Select all

curl --data "action=basicCommand&nodeID=4&state=1"  http://192.168.1.11:10080/hdrv_zwave?
curl --data "action=basicCommand&nodeID=4&state=0"  http://192.168.1.11:10080/hdrv_zwave?
With this my Synology can switch on and off my Fibaro plugs just as it would with my Hue lights...

Re: Use Toon to switch Fibaro plugs

Posted: Sat Jan 06, 2018 7:35 pm
by jeltel
Thanks for this. Nice to see how.i can easily switch zwave devices.

But I can't get the zwave/index.html to open. It says: Advanced Zwave page disabled. You can enable this in the settings app.
But Toon itself doesn't has this setting. Have you enabled it?

Edit: found some info. Apparently the Controlstatus is set somewhere. It is 0, but should be 1. But where is it.set?

https://forum.eneco.nl/algemene-vragen- ... ndex2.html

Re: Use Toon to switch Fibaro plugs

Posted: Sun Jan 07, 2018 10:23 pm
by Rudolf
Maybe the site with json-info from the (zwave) meteradapter also includes data from the neo coolcam?

http://toon/hdrv_zwave?action=getDevices.json

Re: Use Toon to switch Fibaro plugs

Posted: Sun Jan 07, 2018 10:27 pm
by jeltel
Rudolf wrote:Maybe the site with json-info from the (zwave) meteradapter also includes data from the neo coolcam?

http://toon/hdrv_zwave?action=getDevices.json
It does, but unlike the elec_flow etc there is no current value. Also type is unknown.

Re: Use Toon to switch Fibaro plugs

Posted: Tue Jan 30, 2018 1:06 pm
by Toonz
jeltel wrote:It does, but unlike the elec_flow etc there is no current value. Also type is unknown.
I had the same initially. The root cause is that the plug wasn't properly connected to Toon and was shown as 'unknown'.
I removed the plug from Toon and re-connected as follows:
- on Toon press the 'Koppelen' button
- directly after press and hold the button on the plug till the led on the plug starts flashing purple (~10-15 seconds) and then let go.
- soon after Toon recognized the plug with a proper name and did show the power consumption.

Hopes this helps.

Toonz

Re: Use Toon to switch Fibaro plugs

Posted: Tue Jan 30, 2018 8:10 pm
by jeltel
Thanks. I saw the same solution in another thread earlier. It works :)

Re: Use Toon to switch Fibaro plugs

Posted: Sat Dec 01, 2018 4:57 pm
by jeltel
I now have installed Home Assistant and want to control the Fibaro plugs via Home Assistant. While that is easy (set the state to 0 or 1). It is hard to let Home Assistant keep track of the state and current electricity flow of the Fibaro plug.

How can I get those out of Toon? The Getdevices.json doesn't change when setting the plug on and of.

Code: Select all

"dev_5": {"uuid": "9426f408-6736-4e19-a6c4-266f71a5696c", "name": "Lampjes", "internalAddress": "5", "type": "NAS_WR01Z", "supportsCrc": "0", "ccList": "5e 72 86 85 59 5a 73 70 25 27 71 32 20", "supportedCC": "5e 72 86 85 59 5a 73 70 25 27 71 32 20", "nodeFlags": [], "IsConnected": "1", "DeviceName": "Lampjes", "TargetStatus": "0", "CurrentElectricityFlow": "0.00", "CurrentElectricityQuantity": "9200.00", "HealthValue": "10"},
Where nothing changes when switching the devices on or off. Sothe CurrentElectricityFlow stays at 0.00 and the CurrentElectricityQuantity stays at 9200. I thought these would change, as some other wich would represent the current status of the smartplug. IsConnected does change when the smartplug is removed from a wall socket.

And I can switch the smartplugs with:
http://192.168.1.11:10080/hdrv_zwave?ac ... =4&state=1

But how to get the status and the elec_flow of the smartplugs? I can't seem to find it on the devices and googling doesn't help.

Re: Use Toon to switch Fibaro plugs

Posted: Mon Dec 03, 2018 12:58 pm
by Rudolf
You should check out '/qmf/www/hdrv_zwave/zwaveDev.js'
It contains some URLs that might prove useful; i.e.

Code: Select all

'/hdrv_zwave?action=GetBasic&waitForReponse=1&timeout=120&endPoint='+endPoint+'&nodeID='+address'
For me it doesn't, because I haven't connected any devices.
I remember being able to see at least the state, and maybe consumption too.

Browse around http://toon:10080/hdrv_zwave/index.html to get the nodeIDs.

Re: Use Toon to switch Fibaro plugs

Posted: Mon Dec 03, 2018 7:09 pm
by TheHogNL
TargetStatus in getdevices.json should change from 0 to 1 if you turn on the plug. At least at my toon :)