Jump to content

Welcome to Smart Home Forum by FIBARO

Dear Guest,

 

as you can notice parts of Smart Home Forum by FIBARO is not available for you. You have to register in order to view all content and post in our community. Don't worry! Registration is a simple free process that requires minimal information for you to sign up. Become a part of of Smart Home Forum by FIBARO by creating an account.

 

As a member you can:

  •     Start new topics and reply to others
  •     Follow topics and users to get email updates
  •     Get your own profile page and make new friends
  •     Send personal messages
  •     ... and learn a lot about our system!

 

Regards,

Smart Home Forum by FIBARO Team


Virtual Devices

The category contains virtual devices submitted by users.
Downloading and submission terms have to be accepted.
Types of files accepted: LUA, VFIB, ZIP, TAR, RAR, JSON.
Virtual devices have to be described properly, screen shots are optional.
Support topics are created automatically here Virtual devices
Report topics and files that are no longer supported by authors.
All the files submitted have to be approved by administrators.

85 files

  1. VD-Solar-Charger.lua

    VD-Solar-Charger.lua
     
    This extracts all available information from the MPPT charger.
     
    --  Unit ID        Instance in VRM
    --    245            258                Venus GX VE.Direct 1 port (ttyO2)
    --    243            260                Venus GX VE.Direct 2 port (ttyO4)

    40 downloads

       (0 reviews)

    0 comments

    Submitted

  2. VD-Venus.lua

    VD-Venus.lua
     
    Extracts all info from Unit ID 100
     
    -- READ Venus Register 840-846  UNIT ID 100

    37 downloads

       (0 reviews)

    0 comments

    Submitted

  3. VD: MQTT bridge

    0) Create HTTP -> MQTT bridge. (skip if you already have)
     
    $ sudo apt-get install mosquitto mosquitto-clients unzip attached mqtt_php.zip to www root folder, for example, /var/www/html/fibaro/mqtt.php  call from browser http://192.168.1.28/fibaro/mqtt.php where "192.168.1.28" www server where you unzip attached mqtt_php.zip and "fibaro/mqtt.php" path in your www server  here is valid response 1) import attached VD to HC2 MQTT_bridge.vfib 
    change VD params

     
    change url path for HTTP bridge in main loop
     

     
    2) create simple HTML test page
     
    <!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8" /> </head> <body> <div id="log"></div> <script src="https://code.jquery.com/jquery-3.3.1.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/paho-mqtt/1.0.1/mqttws31.min.js" type="text/javascript"></script> <script type="text/javascript"> (function () { if (!console) { console = {}; } var old = console.log; var logger = document.getElementById('log'); console.log = function (message) { if (typeof message == 'object') { logger.innerHTML += (JSON && JSON.stringify ? JSON.stringify(message) : String(message)) + '<br />'; } else { logger.innerHTML += message + '<br />'; } } })(); // Create a client instance client = new Paho.MQTT.Client("192.168.1.28", 1884, "clientId"); // set callback handlers client.onConnectionLost = onConnectionLost; client.onMessageArrived = onMessageArrived; // connect the client client.connect({ onSuccess: onConnect }); // called when the client connects function onConnect() { // Once a connection has been made, make a subscription and send a message. console.log("onConnect"); // Topic: home/roomID/deviceType/deviceID //client.subscribe("home/#"); // all events from all home //client.subscribe("home/4/#"); // all events from 4 room //client.subscribe("home/4/com.fibaro.binarySwitch/#"); // only binarySwitch events from 4 room client.subscribe("home/+/com.fibaro.binarySwitch/#"); // only binarySwitch events from all home } // called when the client loses its connection function onConnectionLost(responseObject) { if (responseObject.errorCode !== 0) { console.log("onConnectionLost:" + responseObject.errorMessage); } } // called when a message arrives function onMessageArrived(message) { console.log("Message Arrived: " + message.payloadString); console.log("Topic: " + message.destinationName); } </script> </body> </html>  
    please change 192.168.1.28 in code on IP address HTTP MQTT bridge
    locate on this test page
    you should get page like 
     
     
     
    Good luck!
     

    158 downloads

       (0 reviews)

    4 comments

    Submitted

  4. Venus_GX.vfib

    Venus_GX.vfib
     
    Please enter the local IP address of your Venus in the LUA "Main loop"
    ( under advanced settings of the virtual device)
                                    vvvvvvvvvvv
    local Venus_IP = "192.168.1.11"
     
    Just replace the numbers with yours(keep the " characters)
     

    94 downloads

       (0 reviews)

    0 comments

    Updated

  5. Volumio_VD_1.0

    Here's a virtual device I created to control my Volumio Music Player, which is running on a Rasbperry Pi.
    Volumio comes with an own built-in ReST API that I use for the this virtual device.
     
    You must have your Volumio connected to your local area network (the same as Fibaro HC).
    After importing the virtual device, set the IP address and the port (default port 80) to point at your Volumio.
     
    Offical site of Volumio: www.volumio.org
    Volumio ReST API documentation: www.volumio.github.io/docs/API/REST_API.html
     
    Note: Tested on Fibaro HC2 4.180
     
    Enjoy.

    114 downloads

       (0 reviews)

    0 comments

    Updated

  6. Watering - adjust and history

    1. Adjust Watering Scene
     
    Features:
    adjusts watering time sends email/push about watering conditions saves historical watering conditions  
    This scene allows you to adjust watering time based on
    current rain forecast rain (till noon) current temperature forcast temperature  
    You can change watering conditions as you like in adjustWatering() function.
    For example:
    if current rain >= 1 mm then turn off watering for 24h if forecast rain >= 2 mm then turn off watering for 24h if current rain >= 0.5 mm then decrease watering duration by 30% if current temperature >= 30°C then increase watering duration by 40% if current temperature <= 1°C then turn off watering for 24h if forecast temperature <= 1°C then send warning about frost  
    The scene requires Sankotronic's 'Weather State and Forecast VD'.
    Tested with "Weather State and Forecast v2.7.1 standalone"
    Supports almost all services supported by 'Weather State and Forecast VD':
    OpenWeatherMap (only daily version) Dark Sky WeatherBit Weather HERE  
    You can change it as always at Sankotronic's 'Weather State VD'.
     
    Customization:
    local vdID = 476 -- ID of 'Weather State VD' from which we will take data local sendEmail = true -- change to false if you don't want to receive emails local sendPush = true -- change to false if you don't want to receive push messages local emailUserId = 2 -- user id to send emails local pushDeviceId = 0 -- mobile device id to send push messages Watering schedule should be set in sprinkler panel.
    I scheduled running this scene everyday 15 minutes before planned start of irrigation.
    The scene increases/decreases watering time of all sprinklers.
     
    Optional modules:
     
    2. Watering History VD
     
    Features:
    shows watering time for the last 7 days shows watering conditions for the last 7 days (gathered by Adjust Watering Scene) shows current watering state (on/off) shows current watering mode (auto/manual) shows watering plan allows to change watering mode (auto/off) allows to run watering once (15/30/60 min)  
    Customization:
    buttons code:
    local sprinklerNr = 1 -- sprinkler number (1, 2, 3, ...) VD supports only one sprinkler. If you want to see the watering history of more sprinklers then you have to create separete VD for every sprinkler. Remember to set sprinklerNr variable for every of them.
     
    3. Netatmo Scene
     
    If you don't have your own Netatmo Station, then you can use the neareast station in your location.
    All public stations you can check here: https://weathermap.netatmo.com
     
    The rain data from the netatmo are much better than the data from Forecast Weather Service. Especially if the rain Netatmo station is near your location.
     
    All you need is:
    a) copy the code from Netatmo.lua and paste it into Sankotronic's 'SA_Weather_Module_scene' at the end of file
    b) sign up to get access data (https://auth.netatmo.com) and fill these fields in pasted Netatmo Scene code. Client ID and Client Secret token you can get when you create app on site https://dev.netatmo.com/apps/
    local n_client_id = "" local n_client_secret = "" local n_username = "" local n_password = "" c) then change these variables values in the main loop of Sankotronic's 'Weather State VD' as follows:
    local netatmoWeather = true local netatmoRain = true d) if Sankotronic's 'Weather State VD' doesn't show netatmo values then increase distance to find a rain gauge in pasted Netatmo Scene code:
    local long_lat_adjust = 0.1 Enjoy...
     

     

    269 downloads

       (0 reviews)

    9 comments

    Updated

  7. Weather State & Forecast suite standalone

    Weather State & Forecast suite standalone
     
    UPDATED USER MANUAL (09/10/2021)
    I have updated user manual and added chapter 6.4 Weather Forecast global variable and how to read it
    In this chapter users can find how to get forecast data and use this data in their code.
    Please click on this link to download user manual:  SA WS VD and WF VD User manual v2.3EN.pdf
     
    UPGRADE PROBLEM?
    Please check upgrade instructions in User manual or below in version history.
     
    INTRODUCTION
    Weather state & forecast module enhance HC2 weather capabilities. Weather State & Forecast module in its latest version works with five most popular weather services:
    OpenWeatherMap Accu Weather NEW WeatherBit Weather HERE Weather API NEW Weather Underground NEW Weather Underground PWS  
    bringing completely new level of weather experience to Fibaro Home Center 2 users.
     
    PREREQUISITES
    Fibaro Home Center 2 with firmware 4.160 or greater with installed Weather provider plugin set as main weather provider.
    Sankotronic Lab Emoji VD standalone
    User account for at least one of the available weather services
     
    FEATURES
    With Netatmo Weather station suite or Netatmo Public Weather station suite gives best support for Irrigation Control watering adjustment Works with 7 most popular weather services on the planet Regularly refreshes weather state and forecast User can setup when forecast push and popup notifications will be sent same as e-mail with complete forecast User can install more than one set of VD’s and follow weather for more than one place It is now separated from Netatmo weather station but can still display Netatmo measurements (will be available only with UHAS version) User can add additional sensor for lux and UV Automatically finds weather provider plugin if installed and can then update weather on the HC2 web GUI and mobile applications VD has built in multi-language support with 27 languages included (see APPENDIX 1 for the list). VD can use HC selected language or user can select any other available language. VD will automatically translate current weather and forecast data to selected language Easy setup for VD icons. User can download HC2 Icon Preview VD to easily find icon ID numbers Global variables are automatically added, monitored, repaired and cleaned and does not require user intervention Supported are metric and imperial units for measured data. Wind speed can be set to show in meter per second (m/s) instead of km/h or mph  
    INSTALLATION AND UPGRADE
    Please check provided User Manual
     
    PACKAGE CONTENT
    Weather State VD v2.8.1 Weather Forecast VD v2.8.1 Weather Module scene v2.8.1 (only one scene needed for multiple VD installed)  Icon pack 1 - standard HC weather icons Icon pack 2 - flat weather icons provided by Wunderground User manual EN v2.2  
    TERMS AND CONDITIONS
    Permission to use, copy, modify and distribute this software and its documentation for educational, research, personal use and non-profit purposes, without fee and without a signed licensing agreement is hereby granted, provided that the copyright notice, with "Terms and conditions" and "Disclaimer" appear in all copies, modifications and distributions. It is strictly forbidden to sell, rent, lease and/or lend this software for profit without prior consent from the Author.
     
    DISCLAIMER
    This software is provided by copyright owner "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the author and distributor be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.
    Fibar Group S.A. and their employees are not responsible for support of the ABC VD. Please contact the author Sankotronic, on the Fibaro Forum, for any questions or support required.
     
    VERSION HISTORY
    2.8.1 - Weather Unlocked forecast extended for better support for Irrigation Control VD. Also corrected Weather API rain precipitation display 2.8 - Added new weather services and resolved some bugs, see bellow or User Manual for more details. 2.7.1 - Corrected bug that prevented using Wunderground, corrected day/night weather icons and other bugs. 2.7 - Added scene for safe communication with weather servers. Added e-mail notifications. Added 3 more weather services and updated WU service... For more detailed list check bellow 2.4 – VD completely redesigned and added openweathermap 5 day / 3 hour forecast. VD's update is synced to always have up to date weather info. Solved some more bugs 2.3.1 – Solved bug with Weather State VD update button 2.3 – First release on Fibaro marketplace  
     

    2,390 downloads

       (7 reviews)

    24 comments

    Updated

  8. Yeelight Manager

    VD YEELIGHT MANAGER
    Originally released on domotique-fibaro.fr
    v. 1.3.0 - 14/01/2018
     
    I present the VD Yeelight Manager which, as its name suggests, allows you to integrate Yeelight products with the HC2. To be very precise, I only have a Bedside Lamp and I have not tested this VD with other products. However, since the API is generic, there are no reasons that it does not work too. The only limit, I did not integrate in the DV management of the background light since the Bedside Lamp does not have such a light.
     
    To use it, simply enter the IP of the Yeelight in the IP field of the DV, and the port in the Port field of the DV (the port used by the Yeelights is 55443). You can add or change elements of the virtual device according to your needs (the white light bulb does not need, for example, anything related to color management), as long as the TCP Connection and Transmission buttons keep their respective names (btnTCPConnection and btnTransmission). Yeelight Manager will find them himself by these names.
     
    In order to be able to manage a Yeelight 'almost' like a module, simply insert in the scene or the code of the button or Main Loop the following code:
    _y={credits='Yeelight Controller v. 1.3.0 - Copyright 2018 Olivier Meyer - GNU GPLv3',global='y_yeelight_global',item='y_yeelight_',props={power=true,bright=true,ct=true,rgb=true,hue=true,sat=true,color_mode=true,flowing=true,delayoff=true,flow_params=true,music_on=true,name=true,bg_power=true,bg_flowing=true,bg_flow_params=true,bg_ct=true,bg_lmode=true,bg_bright=true,bg_rgb=true,bg_hue=true,bg_sat=true,nl_br=true},f=fibaro,debug=function(s,m,c)s.f:debug(string.format('<span style="color:%s;">%s</span>', c, m))end,here=function(s)local h=type(s.f.getSelfId)=='nil' if h then return h,__fibaroSceneId else return h,s.f:getSelfId(),_elementID_ end end,log=function(s)local h=s:here()if h then local a=s.f:args()if a then if a[1].yeelight then s:debug(a[1].debug,a[1].color);s:debug(a[1].command,a[1].color);os.exit()end end end end,getBtn=function(s,i,n)local c,r=0,api.get('/devices/'..tostring(i))['properties']['rows'] local x=#r for a=1,x do local y=#r[a].elements for b=1,y do c=c+1 if n==r[a].elements[b].name then return c end end end s:debug('[Yeelight] Unable to locate button '..n..', check virtual device '..i,'Tomato');return nil end,build=function(s,m,p)local c='{"id":1, "method":"'..m..'", "params":['for i=1,#p do if type(p[i])=="number"then c=c..p[i]else c=c..'"'..p[i]..'"'end;if i~=#p then c=c..', 'end end;c=c..']}\r\n'return c end,load=function(s,v)local g=s.f:getGlobalValue(v)if string.len(g or '')>0 then local d=json.decode(g)if d and type(d)=='table'then return d else s:debug('[Yeelight] Unable to process data, check variable','Tomato')end else s:debug('[Yeelight] No data found!','Tomato')end return nil end,set=function(s,i,d)local g=s:load(s.global)if g[tostring(i)]then local a,b,c=s:here();g[tostring(i)].scene=a;g[tostring(i)].id=b;g[tostring(i)].button=c;g[tostring(i)].command=d;s.f:setGlobal(s.global,json.encode(g))end end,call=function(s,i,m,p)local b=s:getBtn(i,'btnTransmission')if b==nil then return nil end;local c=s:build(m,p)s:set(i,c)s.f:call(i,'pressButton',b)end,getValue=function(s,i,p,g)if s:checkP(p) then if type(g)~='table' then g=s:load(s.item..i)end if g.properties then if g.properties[p] then if g.properties[p].value then return g.properties[p].value end end end s:debug('[Yeelight] Unable to get value of '..tostring(p)..', please check variable.','Tomato');end return nil end,getModificationTime=function(s,i,p,g)if s:checkP(p) then if type(g)~='table' then g=s:load(s.item..i)end if g.properties then if g.properties[p] then if g.properties[p].modificationTime then return g.properties[p].modificationTime end end end s:debug('[Yeelight] Unable to get modification time of '..tostring(p)..', please check variable.','Tomato');end return nil end,get=function(s,i,p)local g=s:load(s.item..i);return s:getValue(i,p,g),s:getModificationTime(i,p,g)end,getStatus=function(s,i)local g=s:load(s.item..i)if g then if g.status then return g.status end end return nil end,getLastChange=function(s,i)local g=s:load(s.item..i)if g then if g.last then return g.last end end return nil end,checkP=function(s,p)if not s.props[p] then s:debug('[Yeelight] '..p..' is not an existing property!','Tomato') return false end return true end} _y:log() This code above offers the following functions:
    _y:call(id, method, params) which allows to send a command to the lamp. The various buttons of the VD give examples. To go further, please have a look at the Yeelight API documentation  : Yeelight_Inter-Operation_Spec.pdf _y:get(id, property) which does exactly the same thing as fibaro:get() _y:getValue(id, property) which does exactly the same thing as fibaro:getValue() _y:getModificationTime(id, property) which does exactly the same thing as fibaro:getModificationTime() _y:getStatus(id) which returns "online" if the lamp is connected to the wifi network, and "offline" otherwise _y:getLastChange(id) which returns a table containing the properties that have just been modified and their new value  
    The logs generated by the call () function are displayed in the debug zone of the scene (do not forget the _y: log () line and allow enough instances) or in the button or main loop of the virtual module from which the function was used.
     
    To use these lamps as scene triggers, the VD automatically creates a global variable y_yeelight_XXX, where XXX is the ID of the VD. This global variable contains all the properties of the lamp and is updated in real time.
    For example, to start a scene when a Yeelight is turned on:
    --[[ %% globals y_yeelight_XXX --]] _y={credits='Yeelight Controller v. 1.3.0 - Copyright 2018 Olivier Meyer - GNU GPLv3',global='y_yeelight_global',item='y_yeelight_',props={power=true,bright=true,ct=true,rgb=true,hue=true,sat=true,color_mode=true,flowing=true,delayoff=true,flow_params=true,music_on=true,name=true,bg_power=true,bg_flowing=true,bg_flow_params=true,bg_ct=true,bg_lmode=true,bg_bright=true,bg_rgb=true,bg_hue=true,bg_sat=true,nl_br=true},f=fibaro,debug=function(s,m,c)s.f:debug(string.format('<span style="color:%s;">%s</span>', c, m))end,here=function(s)local h=type(s.f.getSelfId)=='nil' if h then return h,__fibaroSceneId else return h,s.f:getSelfId(),_elementID_ end end,log=function(s)local h=s:here()if h then local a=s.f:args()if a then if a[1].yeelight then s:debug(a[1].debug,a[1].color);s:debug(a[1].command,a[1].color);os.exit()end end end end,getBtn=function(s,i,n)local c,r=0,api.get('/devices/'..tostring(i))['properties']['rows'] local x=#r for a=1,x do local y=#r[a].elements for b=1,y do c=c+1 if n==r[a].elements[b].name then return c end end end s:debug('[Yeelight] Unable to locate button '..n..', check virtual device '..i,'Tomato');return nil end,build=function(s,m,p)local c='{"id":1, "method":"'..m..'", "params":['for i=1,#p do if type(p[i])=="number"then c=c..p[i]else c=c..'"'..p[i]..'"'end;if i~=#p then c=c..', 'end end;c=c..']}\r\n'return c end,load=function(s,v)local g=s.f:getGlobalValue(v)if string.len(g or '')>0 then local d=json.decode(g)if d and type(d)=='table'then return d else s:debug('[Yeelight] Unable to process data, check variable','Tomato')end else s:debug('[Yeelight] No data found!','Tomato')end return nil end,set=function(s,i,d)local g=s:load(s.global)if g[tostring(i)]then local a,b,c=s:here();g[tostring(i)].scene=a;g[tostring(i)].id=b;g[tostring(i)].button=c;g[tostring(i)].command=d;s.f:setGlobal(s.global,json.encode(g))end end,call=function(s,i,m,p)local b=s:getBtn(i,'btnTransmission')if b==nil then return nil end;local c=s:build(m,p)s:set(i,c)s.f:call(i,'pressButton',b)end,getValue=function(s,i,p,g)if s:checkP(p) then if type(g)~='table' then g=s:load(s.item..i)end if g.properties then if g.properties[p] then if g.properties[p].value then return g.properties[p].value end end end s:debug('[Yeelight] Unable to get value of '..tostring(p)..', please check variable.','Tomato');end return nil end,getModificationTime=function(s,i,p,g)if s:checkP(p) then if type(g)~='table' then g=s:load(s.item..i)end if g.properties then if g.properties[p] then if g.properties[p].modificationTime then return g.properties[p].modificationTime end end end s:debug('[Yeelight] Unable to get modification time of '..tostring(p)..', please check variable.','Tomato');end return nil end,get=function(s,i,p)local g=s:load(s.item..i);return s:getValue(i,p,g),s:getModificationTime(i,p,g)end,getStatus=function(s,i)local g=s:load(s.item..i)if g then if g.status then return g.status end end return nil end,getLastChange=function(s,i)local g=s:load(s.item..i)if g then if g.last then return g.last end end return nil end,checkP=function(s,p)if not s.props[p] then s:debug('[Yeelight] '..p..' is not an existing property!','Tomato') return false end return true end} _y:log() local function run() --executed on light on end local trigger = fibaro:getSourceTrigger() if trigger.type == "global" then if trigger.name == "y_yeelight_XXX" then if _y:getLastChange(XXX)["power"] == "on" then run() end end end

    422 downloads

       (1 review)

    0 comments

    Updated

  9. ZeverSolar Monitor

    Poniżej pierwsza wersja kodu dla Fibaro VD odczytująca dane z falownika  ZeverSolar -instalacji fotowoltaicznej dostępne po sieci lokalnej: adresIP/home.cgi. 
     
    VD ZeverSolar wymaga tylko wpisania swojego adresu IP
    VD ZeverSolar umożliwia:
    1. Prezentacje danych: czas odczytu, wartość chwilowa pacW,  wielkość produkcji dziennej.
    2. Przycisk wymuszający odczyt on demand "Update?".
    3. Zapis zmiennych globalnych pacW, etodayKWh.
     

     

    74 downloads

       (1 review)

    0 comments

    Updated

  10. ZXT-120 AC control VD

    This is a simple VD+Scene to control ZXT-120 AC controllers. I use it because of 2 factors:
    1) You can control everything on one screen instead of 3 devices in HC2 interface
    2) it is visible in Home Center app (ZXT-120 is not visible natively yet)
    It supports heating and cooling modes and fan speed. You can see current status as well.
    Setup is very simple:
    VD - just put ID of the child device of ZXT-120 which controls temperature into the "Port" field of VD
    Scene - You have to put IDs of three child deviced of ZXT in the triggers field annd the same ID into "Options" part of the scene. Also put VD ID inn the "Options" part.
    Maybe it can be useful for some of you.
    ZXT-120.zip

    115 downloads

       (1 review)

    1 comment

    Submitted


×
×
  • Create New...