Home automation software

In the meanwhile, we did the necessary brainstorming about the “modularity” of this home automation project. We concluded that it is best to divide the system in different logic blocks.

These blocks are:
@Home Client
This application will be a user frontend to “administrate” the home automation system. (e.g. change “logic”, configure settings etc …) This application will run in the language that is set as the current language for the currently logged in user in the operating system. Translations are automatically looked up via the google translate API (you still have the possibility to edit the dictionary altough)

@Home Console
The part that will run on the different screens, places over the whole house.

@Home Engine
This is the actual “heart” of the system, which runs on a small device, and is console-based (so, without a GUI)

@Home Mobile
A piece of software that can be used on a mobile/handheld device. (for example, a SmartQ V5, or an Android device)

@Home Web
A webinterface to control or monitor certain aspects of the home automation system, when you are not at home.

I already started the development of the Client & Engine. Coding is done, to give the possibility to “lock” on machinename, IP-address, MAC-address, user etc … (Also, this can be used to prevent users to login on certain machines, and restrict access to certain items of the menu and even on button-level in the filterscreens.)

In the meanwhile, I donated my tv-guide and weather module to www.domotiga.nl

This entry was posted in Blog, Digital Vision, Electronics. Bookmark the permalink.

2 Responses to Home automation software

  1. eric baan says:

    hallo Kris,

    enige tijd geleden hebben wij kontakt gehad over jouw LEds trip dag en nacht project.
    Je hebt me enkele links gegeven voor download.
    Ik heb Eagle geinstalleerd en kan ook de printen zien ..

    Alleen mij is niet duidelijk waar ik info kan vinden over de werking en dergelijke …
    Ook zag ik dat je een mini funktiedecoder hebt ontwikkeld voor verlichting met strips in rijtuigen.

    Kun je me vertellen waar ik meer info kan vinden over deze twee projecten ? alleen het printje is mooi, maar daar kom ik niet uit …

    Grtz

    eric

    • Kris says:

      Hoi Eric,

      Als er een PIC microcontroller mee gemoeid is, dan zit er een HEX file bij. Deze moet je dan met een PIC programmer in de pic microcontroller flashen.
      Zodra je de decoder op je baan aansluit, en je de knop indrukt op de print, zal het adres dat je vervolgens vanop je digitale centrale aanroept, ingesteld
      worden als het adres van de decoder. Bij die rijtuig functiedecoder, zit er op de PDF onderaan, een verwijzing naar Sven Brandt.
      http://www.digital-bahn.de dus, daar kan je meer info vinden. (alleen heb ik er zelf een kleinere print voor ontworpen die makkelijk te frezen/etsen is)

      Voor de dag/nacht sturing, dat ligt wat gecompliceerder. Die maakt namelijk integraal deel uit van mijn domotica-systeem.
      Je zal dus zelf enige ervaring moeten hebben met programmeren van microcontrollers, om code in pic-formaat te gieten.
      Ik vrees dus dat je hier volledig op jezelf bent aangewezen, en dus inderdaad alleen de print kan gebruiken …
      Wel kan ik je hier de B4A code meegeven, aan de hand van de loops en commentaar in deze code, kan je vast en zeker zelf je dag/nacht code geschikt maken voor eigen gebruik.

      '******************************************************
      '*** overgang dag/nacht - nacht/dag functionaliteit ***
      '******************************************************
      '---------------------------
      'overgang van nacht naar dag
      '---------------------------
      Sub BtnOvergangNachtDag_Click
      '--- declare local variables for this sub ---
      Dim Tr As Thread

      '--- run this in a separate thread ---
      IntMode_Old = IntMode
      IntMode = 4
      Tr.Initialise("NachtDagThread")
      Tr.Priority = Tr.MaxPriority
      LblNachtDag.Text = "Actief"
      Tr.Start("NachtNaarDag",Null)
      End Sub
      Sub NachtDagThread_Ended(endedOK As Boolean, error As String) 'The thread has terminated. If endedOK is False error holds the reason for failure
      BoolLongCyclus = False
      LblNachtDag.Text=""
      IntMode = 1
      IntMode = IntMode_Old
      End Sub
      Sub NachtNaarDag
      '--- declare local variables for this sub ---
      Dim inti As Int
      Dim IntX As Int
      Dim IWait As Int

      BoolLongCyclus = True
      IWait = 40

      '--- initialise lighting ---
      StrLCD1Line(2) = " -- stap 1 van 5 -- "
      UpdateLCD(1,2)
      StrLCD1Line(3) = "** Nacht naar dag **"
      UpdateLCD(1,3)
      DoEvents
      BPlafondVerlichting = False
      BPlafondVerlichting2 = False
      BTLBlauw = False
      ITLModuleLinks = 0
      ITLModuleLinks_Old = 2
      ITLModuleRechts = 0
      ITLModuleRechts_Old = 2
      ITLLangeModule = 0
      ITLLangeModule_Old = 2
      ITLGarage2 = 0
      ITLGarage2_Old = 2
      ITLOvergang = 0
      ITLOvergang_Old = 2
      For inti = 1 To 2
      IRGBBlauwGarage(inti) = 0
      IRGBGroenGarage(inti) = 0
      IRGBRoodGarage(inti) = 0
      Next
      IHalogeenDoorgang = 0
      IHalogeenModuleLinks = 0
      IHalogeenModuleRechts = 0
      For inti = 1 To 3
      IHalogeenGarage2Set(inti) = 0
      Next
      For inti = 1 To 2
      UpdateTL(inti)
      WaitLoop(IWait)
      UpdateHalogen(inti)
      WaitLoop(IWait)
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      PlaySound(33)
      WaitLoop(IWait)
      StrFullBuffer = "Z"
      DoEvents

      '--- RGB LEDs from Dark Blue to Regular Blue ---
      For IntX = 0 To 255
      For inti = 1 To 2
      IRGBBlauwGarage(inti) = IntX
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      Next
      StrLCD1Line(2) = " -- stap 2 van 5 -- "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents

      '--- RGB LEDs from Blue to Purple ---
      For IntX = 0 To 255
      For inti = 1 To 2
      IRGBRoodGarage(inti) = IntX
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      Next
      StrLCD1Line(2) = " -- stap 3 van 5 -- "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents

      '--- RGB LEDs from Purple to Yellow ---
      For IntX = 0 To 255
      For inti = 1 To 2
      IRGBGroenGarage(inti) = IntX
      IRGBBlauwGarage(inti) = 255 - IntX
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      Next
      StrLCD1Line(2) = " -- stap 4 van 5 -- "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents

      '--- RGB LEDs from Yellow to White ---
      For IntX = 0 To 255
      For inti = 1 To 2
      IRGBBlauwGarage(inti) = IntX
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      Next
      StrLCD1Line(2) = " -- stap 5 van 5 -- "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents

      '--- switch from White RGB to White TL ---
      ITLLangeModule = 2
      ITLModuleLinks = 2
      ITLModuleRechts = 2
      ITLGarage2 = 2
      ITLOvergang = 2
      For inti = 1 To 2
      UpdateTL(inti)
      WaitLoop(IWait)
      Next
      StrFullBuffer = "Z"
      DoEvents

      '--- turn white TLs and halogens to max. brightness ---
      For IntX = 1 To 255
      ITLLangeModule = IntX
      ITLModuleLinks = IntX
      ITLModuleRechts = IntX
      ITLOvergang = IntX
      ITLGarage2 = IntX
      IHalogeenDoorgang = IntX
      IHalogeenModuleLinks = IntX
      IHalogeenModuleRechts = IntX
      For inti = 1 To 3
      IHalogeenGarage2Set(inti) = IntX
      Next
      For inti = 1 To 2
      UpdateTL(inti)
      WaitLoop(IWait)
      UpdateHalogen(inti)
      WaitLoop(IWait)
      Next
      Next
      StrFullBuffer = "Z"
      DoEvents

      For inti = 1 To 2
      IRGBBlauwGarage(inti) = 0
      IRGBGroenGarage(inti) = 0
      IRGBRoodGarage(inti) = 0
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      StrLCD1Line(2) = " "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents
      StrLCD1Line(3) = " "
      If IntMode_Old = 1 Then
      StrLCD1Line(3) = " *IDLE* "
      End If
      If IntMode_Old = 2 Then
      StrLCD1Line(3) = "*AUTOMATISCHE MODUS*"
      End If
      UpdateLCD(1,3)
      DoEvents
      StrFullBuffer = "Z"
      UpdateSliders
      End Sub
      '---------------------------
      'overgang van dag naar nacht
      '---------------------------
      Sub BtnOvergangDagNacht_Click
      '--- declare local variables for this sub ---
      Dim Tr As Thread

      '--- run this in a separate thread ---
      IntMode_Old = IntMode
      IntMode = 3
      Tr.Initialise("DagNachtThread")
      Tr.Priority = Tr.MaxPriority
      LblDagNacht.Text = "Actief"
      Tr.Start("DagNaarNacht",Null)
      End Sub

      Sub DagNachtThread_Ended(endedOK As Boolean, error As String) 'The thread has terminated. If endedOK is False error holds the reason for failure
      BoolLongCyclus = False
      LblDagNacht.Text=""
      IntMode = IntMode_Old
      End Sub
      Sub DagNaarNacht
      '--- declare local variables for this sub ---
      Dim inti As Int
      Dim IntX As Int
      Dim IWait As Int

      BoolLongCyclus = True
      IWait = 40

      '--- initialise lighting ---
      StrLCD1Line(2) = " -- stap 1 van 5 -- "
      UpdateLCD(1,2)
      StrLCD1Line(3) = "** Dag naar nacht **"
      UpdateLCD(1,3)
      DoEvents

      BPlafondVerlichting = False
      BPlafondVerlichting2 = True
      BTLBlauw = False
      ITLModuleLinks = 255
      ITLModuleLinks_Old = 0
      ITLModuleRechts = 255
      ITLModuleRechts_Old = 0
      ITLLangeModule = 255
      ITLLangeModule_Old = 0
      ITLGarage2 = 255
      ITLGarage2_Old = 0
      ITLOvergang = 255
      ITLOvergang_Old = 0
      For inti = 1 To 2
      IRGBBlauwGarage(inti) = 255
      IRGBGroenGarage(inti) = 255
      IRGBRoodGarage(inti) = 255
      Next
      IHalogeenDoorgang = 255
      IHalogeenModuleLinks = 255
      IHalogeenModuleRechts = 255
      For inti = 1 To 3
      IHalogeenGarage2Set(inti) = 255
      Next
      For inti = 1 To 2
      UpdateTL(inti)
      WaitLoop(IWait)
      UpdateHalogen(inti)
      WaitLoop(IWait)
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      PlaySound(32)
      WaitLoop(IWait)
      StrFullBuffer = "Z"
      DoEvents

      '--- turn white TLs and halogens to min. brightness ---
      For IntX = 255 To 0 Step -1
      ITLLangeModule = IntX
      ITLModuleLinks = IntX
      ITLModuleRechts = IntX
      ITLOvergang = IntX
      ITLGarage2 = IntX
      IHalogeenDoorgang = IntX
      IHalogeenModuleLinks = IntX
      IHalogeenModuleRechts = IntX
      For inti = 1 To 3
      IHalogeenGarage2Set(inti) = IntX
      Next
      For inti = 1 To 2
      UpdateTL(inti)
      WaitLoop(IWait)
      UpdateHalogen(inti)
      WaitLoop(IWait)
      Next
      Next
      StrLCD1Line(2) = " -- stap 2 van 5 -- "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents

      '--- RGB LEDs from white to Yellow ---
      For IntX = 255 To 0 Step -1
      For inti = 1 To 2
      IRGBBlauwGarage(inti) = IntX
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      Next
      StrLCD1Line(2) = " -- stap 3 van 5 -- "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents

      '--- RGB LEDs from Yellow to Purple ---
      For IntX = 255 To 0 Step -1
      For inti = 1 To 2
      IRGBGroenGarage(inti) = IntX
      IRGBBlauwGarage(inti) = 255 - IntX
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      Next
      StrLCD1Line(2) = " -- stap 4 van 5 -- "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents

      '--- RGB LEDs from Purple to Blue ---
      For IntX = 255 To 0 Step -1
      For inti = 1 To 2
      IRGBRoodGarage(inti) = IntX
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      Next
      StrLCD1Line(2) = " -- stap 5 van 5 -- "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents

      '--- RGB LEDs from Regular Blue to Dark Blue ---
      For IntX = 255 To 0 Step -1
      For inti = 1 To 2
      IRGBBlauwGarage(inti) = IntX
      UpdateRGB(inti)
      WaitLoop(IWait)
      Next
      Next
      StrLCD1Line(2) = " "
      UpdateLCD(1,2)
      StrFullBuffer = "Z"
      DoEvents
      StrLCD1Line(3) = " "
      If IntMode_Old = 1 Then
      StrLCD1Line(3) = " *IDLE* "
      End If
      If IntMode_Old = 2 Then
      StrLCD1Line(3) = "*AUTOMATISCHE MODUS*"
      End If
      UpdateLCD(1,3)
      DoEvents
      StrFullBuffer = "Z"
      UpdateSliders
      End Sub

      succes,
      Kris

Leave a Reply

Your email address will not be published. Required fields are marked *