I said I would post when I had the system cleaner and working. My cellar is set up with 31 bin columns and 23 rows. Here is a partial picture. To answer the question - Yes I built and installed everything in the room with the help of my wife. The walls are 2x6 and are high density spray foam. The cellar will hold 689 bottles maximum. It is in the basement and it is not maintained by AC. Humidity is manual as well but terracotta pots hold the humidity to 60-70% with little work.

There are step downs in a couple areas to fit under a beam. These areas are represent by "." Empty bins are shown as available. This is still a work in progress as I have to finish populating the database and then do remove and add bottles screen. I also have to copy reviews into the database. I will post to this thread as I progress.
The code to change the bin column and row follow. First to select the column.
Then Select the Row
Here is the Database I created:
[ATTACH]n1386286[/ATTACH]
Here is what the HSTouch Screen looks like

The up and down buttons do the heavy lifting. They the two scripts above. I will ultimately be able to push the bin number and a proper review will be placed where it now says review.
I hope this helps.
There are step downs in a couple areas to fit under a beam. These areas are represent by "." Empty bins are shown as available. This is still a work in progress as I have to finish populating the database and then do remove and add bottles screen. I also have to copy reviews into the database. I will post to this thread as I progress.
The code to change the bin column and row follow. First to select the column.
Code:
05/14/2020 ControlCounter.vb 'Pass three parameters, The addition or subtraction, the refid to increase the value, and weather to print to HS Log IMPORTS System.IO IMPORTS System.Core IMPORTS System.Net Sub Main(ByVal parms As Object) 'There are 0 parameters Dim sParm() As String Dim parm, rName As String Dim dvRef, Inc As Integer Dim CntrValue As Integer Dim Debug As Boolean If parms.GetType().ToString = "System.String" Then 'Called from an Event parm = parms.ToString() Else ' Called from HSTouch parm = parms(0).ToString() & "|" & parms(1).ToString() & "|" & parms(2).ToString() End If 'Now use parm as your input variable... sParm = Split(parm, "|", -1, 1) Inc = CInt(sParm(0)) If Inc = 2 Then Inc = -1 End If dvRef = CInt(sParm(1)) Debug = sParm(1) rName = "CtlCntr" If Debug Then hs.WriteLog(rName, parm) End If CntrValue = hs.DeviceValueEx(dvRef) CntrValue = CntrValue + Inc If CntrValue > 31 Then CntrValue = 1 End If If CntrValue <= 0 Then CntrValue = 31 End If hs.SetDeviceValueByRef(dvRef, CntrValue, True) End Sub
Code:
'PopulateWineCellar.vb - Used to pull wine information from database and populate the Wine inventory screen '5/15/2020 - JLG IMPORTS System.Data.SQLite IMPORTS System.Core IMPORTS System.IO IMPORTS System.Net IMPORTS System.Data.Objects Sub Main(ByVal parms As Object) ' ' cs is the connection String that points to the desired database. ' Dim cs As String = "Data Source=/opt/HomeSeer/Data/WineCellar.db;Version=3;" Dim RackCol As String Dim parm As String Dim Debug As Boolean Dim rdr As SqliteDataReader Dim dvRef(23), i As Integer Dim Wine(23) As String Dim sWinery As String ' 'Set up the 23 rows Device Refernce ID ' dvRef(0) = 787 'Device which holds the column count. ' 'I created all of my devices that hold the row in the wine rack at the same time and I luckly got them continuous. ' For i = 1 to 23 dvRef(i) = 763 + i Next ' 'Get the column number in rack. ' RackCol = CStr(hs.DeviceValue(dvRef(0))) Try 'Absolutely critical to use or debug messages will be cryptic Using con As New SqliteConnection(cs) if con.State = ConnectionState.Closed Then con.Open() 'open the database End if Using cmd As New SqliteCommand(con) 'create command cmd.CommandText = "SELECT * FROM CellarContents WHERE Column = " & RackCol & " ORDER BY Row ASC" rdr = cmd.ExecuteReader() i = 0 Using rdr While (rdr.Read()) 'Concatenate the fields into a single string i = i + 1 sWinery = rdr("Winery") If sWinery = "N/A" Then Wine(i) = "." ElseIf sWinery = "Empty" Then Wine(i) = "Available " Else Wine(i)= sWinery & " " & CStr(rdr("Year")) & " " & rdr("WineName") & " " & rdr("Varietal") & " " & rdr("Country") & " " & rdr("Region") End If End While End Using End Using con.Close() End Using Catch ex As Exception 'Error trapping hs.WriteLogEx("Wine", ex.Message, "#ff0000") End Try For i = 1 to 23 hs.SetDeviceString(dvRef(i), Wine(i), True) Next End Sub
[ATTACH]n1386286[/ATTACH]
Here is what the HSTouch Screen looks like
The up and down buttons do the heavy lifting. They the two scripts above. I will ultimately be able to push the bin number and a proper review will be placed where it now says review.
I hope this helps.
Comment