Domoticz home control and unipi



  • I was full of trust my stupid mistake would be fixed now… I thought 'localhost' was a universal programming variable which would understand my host address Unfortunately changing it to 192.168.0.176 didn't change anything (nor after reboot rpi).

    I've added the hardware by selecting a dummy from the dropdown list and called it UniPi. After that I've created devices (virtual sensors) from this hardware.
    [attachment=0:qeoq8655]Domoticz hardware.PNG[/attachment:qeoq8655]
    Is it correct the UniPi Domoticz LUA script is saved in:
    ~/domoticz/scripts/lua/script_UniPi_domoticz.lua

    and the json.lua in:
    /usr/local/share/lua/5.2/json.lua

    Are there any commands to check the services are running fine?

    pi@raspberrypi / $ sudo service lua status
    lua: unrecognized service
    pi@raspberrypi / $ sudo service json status
    json: unrecognized service
    
    

    Thank you very much for your help and patience!



  • @ESF_nl:3i5lzae8:

    Is it correct the UniPi Domoticz LUA script is saved in:
    ~/domoticz/scripts/lua/script_UniPi_domoticz.lua

    Here is the mistake !!!!!!!!!!!!!!! Leave localhost as it is.

    **Rename the script to : script_device_UniPi.lua
    **
    All of your scrips must start with script_device for hardware…......

    File system based Lua scripts should be placed in the /home/pi/domoticz/scripts/lua directory. Since Lua is integrated in Domoticz it knows about the status of switches and sensors (the commandArray variable) which makes it easy to interact.
    In the scripts directory the lua directory can be found. The lua scripts are named "script_device_demo.lua" and "script_time_demo.lua". By copying these examples and changing demo into a sensible identifier like script_device_light2.lua the script will become active. Device scripts will be run at every device change and time scripts will be run every minute

    See here https://www.domoticz.com/wiki/Domoticz_and_Scripting



  • WOW! Super! I'm so happy the UniPi works with my Domoticz now!
    Thank you all for your help. Couldn't have done it without you.



  • Glad it helped

    Keep in mind that you can name your switches whatever you wish....fan,livving room light,hot water switch etc.
    Just put the same name to your script too and all work ok



  • Does anybody know what this error message means in the Domoticz log?

     2016-03-21 21:23:26.843 Error: EventSystem: commandArray in script /home/pi/domoticz/scripts/lua/script_device_UniPi.lua should only return ['string']='actionstring' or [integer]={['string']='actionstring'}
    2016-03-21 21:23:57.866 Error: EventSystem: commandArray in script /home/pi/domoticz/scripts/lua/script_device_UniPi.lua should only return ['string']='actionstring' or [integer]={['string']='actionstring'}
    2016-03-21 21:23:59.242 Error: EventSystem: commandArray in script /home/pi/domoticz/scripts/lua/script_device_UniPi.lua should only return ['string']='actionstring' or [integer]={['string']='actionstring'} 
    ```I've got screens full of them…


  • I think that it has to do with user variables. Did you do this correctly ? Go to setup->more options->user variables

    to use these you also need to create a user variable as a floating variable and name it 'ai1_value' assign a default level of zero
    --and respectivly 'ai2_value' for the 2nd sensor also floating and also starting with zero
    
    

    But best to ask about these questions on domoticz forum cause it has to do with it's settings and scripting and not unipi. You will get more support there about scripts



  • @ESF_nl
    Hi ESF_NL, I've just got the unipi working on raspberry pi running domoticz.
    Everything is working except for the Dig. inputs. They work in evok, not in domoticz.

    Did you get these working?

    Kind regards ,



  • @vandura
    Hello Vandura,

    I am also using this Unipi board , domoticz and the Lua script ( version b0.98) fom Spudgunman. I can control the relays on the board but using the Digital inputs do not work. Did you got this working by now? If yes, how did you succeed?

    gts , Krist ON4API



  • @spudgunman

    Hello spudgunman ,

    Thank you for this script . I am using it to control the relays on the Unipiboard from my Domoticz system.
    But I should also like to use the inputs. Did you continue your development so that inputs can also be used?
    I am using your beta version 0.98.

    Kind regards,
    Krist - ON4API



  • Hey, some one get solution for digital inputs nad one wire? Relays works nice. Im realy dont mnie how config that in script.


Log in to reply
 

Looks like your connection to UniPi.technology Forum was lost, please wait while we try to reconnect.