Use Toon to switch Fibaro plugs

Everything about external control, apps, VNC, etc goes here.

Moderators: marcelr, TheHogNL, Toonz

Post Reply
Henk-JanS
Starting Member
Starting Member
Posts: 11
Joined: Mon Nov 06, 2017 4:37 pm

Use Toon to switch Fibaro plugs

Post 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...
jeltel
Starting Member
Starting Member
Posts: 18
Joined: Tue Dec 05, 2017 10:16 pm

Re: Use Toon to switch Fibaro plugs

Post 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
Rudolf
Member
Member
Posts: 136
Joined: Mon Dec 04, 2017 8:50 pm

Re: Use Toon to switch Fibaro plugs

Post 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
jeltel
Starting Member
Starting Member
Posts: 18
Joined: Tue Dec 05, 2017 10:16 pm

Re: Use Toon to switch Fibaro plugs

Post 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.
Toonz
Forum Moderator
Forum Moderator
Posts: 1873
Joined: Mon Dec 19, 2016 1:58 pm

Re: Use Toon to switch Fibaro plugs

Post 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
member of the Toon Software Collective
jeltel
Starting Member
Starting Member
Posts: 18
Joined: Tue Dec 05, 2017 10:16 pm

Re: Use Toon to switch Fibaro plugs

Post by jeltel »

Thanks. I saw the same solution in another thread earlier. It works :)
jeltel
Starting Member
Starting Member
Posts: 18
Joined: Tue Dec 05, 2017 10:16 pm

Re: Use Toon to switch Fibaro plugs

Post 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.
Rudolf
Member
Member
Posts: 136
Joined: Mon Dec 04, 2017 8:50 pm

Re: Use Toon to switch Fibaro plugs

Post 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.
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Use Toon to switch Fibaro plugs

Post by TheHogNL »

TargetStatus in getdevices.json should change from 0 to 1 if you turn on the plug. At least at my toon :)
Member of the Toon Software Collective
Post Reply

Return to “Toon external control”