UniPi - Homeseer plugin

ewillems
Posts: 6
Joined: Sun Nov 09, 2014 8:58 pm

UniPi - Homeseer plugin

Postby ewillems » Tue Dec 09, 2014 11:13 pm

I've written a script to integrate UniPi to HomeSeer (home automation software).

UniPi - Homeseer.png
UniPi - Homeseer.png (244.97 KiB) Viewed 5125 times


Features
- Read relay status
- Control relays
- Read inputs (digital and analog)
- Modify Analog output
- Auto detect one-wire sensors

To install:
- Extract the attached Unipi-v0.1.zip and follow instructions in install.txt
Attachments
Unipi-v0.1.zip
(238.29 KiB) Downloaded 277 times
tomas_hora
Site Admin
Posts: 298
Joined: Wed Oct 29, 2014 9:56 am

Re: UniPi - Homeseer plugin

Postby tomas_hora » Sat Dec 13, 2014 6:00 pm

Wow! Nice job. Thanks a lot! I will definitely try it :)
jellee
Posts: 6
Joined: Mon Mar 02, 2015 4:14 pm

Re: UniPi - Homeseer plugin

Postby jellee » Mon Mar 02, 2015 8:56 pm

Thanks! Good job!
jellee
Posts: 6
Joined: Mon Mar 02, 2015 4:14 pm

Re: UniPi - Homeseer plugin

Postby jellee » Wed Mar 04, 2015 2:50 pm

I could not run the script because dv.Ref(hs) was not defined correctly. I did correct that and now it is working. I use HomeSeer 3.0.0.152.
Changed script attached.
Attachments
Unipi.zip
(245.08 KiB) Downloaded 155 times
ewillems
Posts: 6
Joined: Sun Nov 09, 2014 8:58 pm

Re: UniPi - Homeseer plugin

Postby ewillems » Thu Mar 05, 2015 10:12 pm

Hi Jellee,

Great to see that there is at least one happy user using my software. Thanks for fixing this issue and sending back your version (that's the spirit of Open Source!). I should compare it with my version. If I remember correctly I did some little improvements on my side. I will combine these with your version. Expect a version 0.2 soon!

Just curious: Do you have one or more temperature sensors? Were they auto detected?

Thanks!

Erwin
jellee
Posts: 6
Joined: Mon Mar 02, 2015 4:14 pm

Re: UniPi - Homeseer plugin

Postby jellee » Sun Mar 08, 2015 11:07 pm

Hi Erwin,

No problem and thanks to you too.

Unfortunately I don't have any temperature sensor, so I could not check.

I still have a problem. The script (vb function) that need to run when a relais ON/OFF button is pressed at HomeSeer is not executed.
The code below takes care of linking that function to the button. I can remember I have changed the 'dvref' definition but that should not stop it, because it still gives the same dvref value as before.

Code: Select all

' For OFF button
hs.DeviceScriptButton_AddButton(dvref, "Off",0,"unipi.vb","RelayButton","Off",1,1,0)


Maybe you know what is happening? Or how I can check in HomeSeer that the function script is linked to the button?
For all the rest the script is running perfectly!

Thanks!
jellee
Posts: 6
Joined: Mon Mar 02, 2015 4:14 pm

Re: UniPi - Homeseer plugin

Postby jellee » Mon Mar 09, 2015 9:33 pm

My issue is solved now. I made a mistake in the script by myself. New zip attached.
Attachments
Unipi_HomeSeer.zip
UniPi_2015-03-09
(243.8 KiB) Downloaded 190 times
ewillems
Posts: 6
Joined: Sun Nov 09, 2014 8:58 pm

Re: UniPi - Homeseer plugin

Postby ewillems » Tue Mar 10, 2015 10:18 pm

Hi Jellee,

I've checked your changes, but the only change I've found is in the CreateRoot sub. The other changes are all because of search/replace. In the CreateDevice subs, you've replaced it with the same code:

Code: Select all

Dim dvref = dv.Ref(hs)


I've tested the script in my environments by deleting the root device, but was not able to reproduce your issue. My HS version is the same, 3.0.0.152. I've also checked the helpfiles (http://homeseer.com/support/homeseer/HS ... class1.htm), the property Ref should exists and hold the reference to the root device.

I've also compared my current version with the first version. There is a bug in that version: The LastUpdate value was constantly changing. You should remove the "hs.SetDeviceValue.." line in Sub UpdateDeviceValue to fix this bug.

Code: Select all

Sub UpdateDeviceValue(DeviceAddress as String, DeviceType as String, Value as Double)
        Dim dvRef = hs.GetDeviceRef(DeviceAddress)
'       hs.SetDeviceValueByRef(dvRef, Value, True)  <== Remove this line
        Select Case DeviceType


Hope that helps!

Regards,
Erwin

Return to “Homeseer”

Who is online

Users browsing this forum: No registered users and 1 guest