Howto: Connect a Viessman heater to loxone, see the status, control it

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • henk.oosterlinck
    Dumb Home'r
    • 17.06.2016
    • 18

    Howto: Connect a Viessman heater to loxone, see the status, control it

    Hello,

    I was able to connect and control my viessmann boiler.
    This interface gives you complete and full control of every parameter and all data the viessman heater has.
    I have the feeling I read and write all parameters and all data.
    In this item I want to give some directions on how it can be done.

    Note: openhab looks like a good opensource alternative for loxone.
    Note: all of this is a mixture of german and english, I did not translate everything (yet)

    Why?
    I have thermostats/temperature sensors in almost every room mostly via KNX but there are alternatives.
    I have ways to detect presence in my house or some rooms.
    I have magnetic contacts on most windows, so I know when it is open and the heating should be off.
    When we leave home the alarm system is usually armed, so I know if there is nobody at home because the alarm system is on, ...
    If the target temperature is reached in every room the heater is switched to "OFF" or"Warm Water only", if heating is required i switch to the operating mode "Heating + Warm Water". This is a way of controlling the circulator pump of the heating or the heater, viessmann does not allow direct control of this circulator pump.
    If i am on holliday and forgot to switch the heater off I can switch the viessman off.
    If i am on holliday and switched the heater completely off, I can switch it back on for the housekeeper/cleaning if they come during my holidays. (you can put your viessman in holiday mode, but not all days except tuesday)
    It must be possible to make some economies by controlling the heater better, without losing any comfort.
    There are plenty of ideas, I don't think there are limitations to this interface.

    Hardware required:
    - Raspberry pi 2 with an SD card with some space (16gb in my case, take a good one as they tend to fail over time just like with loxone). One can install this on a windows computer too I think.
    - Optolink USB cable can be the original from Viessman but I used this one see http://openv.wikispaces.com/Bauanleitung+USB (there is an email adress there from someone who can make this for you, it costed me 43.99 including transport costs)
    The total cost of this is at about100 euros

    The communication is done using :
    - vcontrold daemon, this program does the communication with the viessman heater, see http://openv.wikispaces.com/vcontrold
    - vclient executable which is part of or comes with vcontrold daemon
    - a bash shell script to upload the status to loxone (it is an modified version of a script written for openhab: see http://www.intranet-of-things.com/software/downloads). This script is in the crontab and runs every "5" minutes.
    - a cgi script I wrote myself to send commands to the boiler, I could not pass commands via telnet, this uses http and works with loxone (theoretically telnet should work, but I could not make it work.

    Installation vcontrold:
    - install linux on the raspberry pi, I used Raspbian Jessie.
    - install the vcontrold daemon: see http://openv.wikispaces.com/vcontrold+mit+Raspberry+Pi.
    - you need to adapt the vcontrold.xml and the vito.xml. I could not make any version of them work completely for me. Details follow, my version of these files is attached.
    There are some commands in the vcontrold.xml (setaddrTo0/1/2/3/4/5)
    There are some extra commands in the vito.xml (setBetriebArtM1, ...)
    - make sure the vcontrold daemon is running
    Test it using "telnet raspberrypi 3002", or using "/usr/local/bin/vclient -h 127.0.0.1:3002 -c getBetriebArtM1"
    (Note that you can change it using "/usr/local/bin/vclient -h 127.0.0.1:3002 -c 'setBetriebArtM1 WW'")

    Installation script to update status in loxone:
    -decide which statusses you need in loxone, put the corresponding commands in heating.getcommands (this is a list of vcontrold commands) and heating.tpl (this is the list of virtual inputs you will have in loxone).
    test using this command: /usr/local/bin/vclient -h 127.0.0.1:3002 -f heating.getcommands -t heating.tpl
    You should see the output of each comand.
    - create a virtual input in loxone for each status they are named like this one "VIHeating_Temperature_Outdoor"
    - run heating.bash to spot errors
    - schedule it in chrontab (note the locking mechanism using flock to avoid starting it twice)
    */5 * * * * /usr/bin/flock -w 0 /home/pi/openvloxone/cronheating.lock /home/pi/openvloxone/heating.bash
    Now you can see the status of your boiler in Loxone.

    Installation cgi script to send commands to the viessman:
    - add the cgi script to send commands from loxone to the viessman heater
    - add any required commands to loxone as virtual output
    you can test in a brower using "http://192.168.x.x/cgi-bin/cgi-vclient.sh?setBetriebsArtM1To5"
    If you put these commands in a virtual output loxone can control your heater.

    Issues:
    strangely the getBetriebsArt and setBetriebsart do not use the same values
    1-> '00' ='WW'
    3 -> '01' ='RED'
    4 -> '02' ='NORM'
    2 -> '03' ='H+WW'
    5 -> '03' ='H+WW'
    0-> '05' ='ABSCHALT'
    I have the feeling that the "RED" corresponds somehow to "ww only" and "norm" to "H+ww", but i did not find documentation on this yet.
    Angehängte Dateien
    Zuletzt geändert von henk.oosterlinck; 06.12.2016, 20:33.
  • sonorobby
    LoxBus Spammer
    • 26.08.2015
    • 317

    #2
    Hallo Henk, does this work with every viessmann heating system?
    how do you connect to the heating system? via cable? where to attach this?

    Kommentar

    • svethi
      Lebende Foren Legende
      • 25.08.2015
      • 6247

      #3
      sonorobby das hat er doch geschrieben. Es geht um den selbstgebastelten Optolink Adapter.
      Miniserver; KNX; Vitogate; EnOcean (EnOceanPi); Loxone Air; Caldav-Kalenderanbindung; RaspberryPi und für keine Frickellösung zu schade :-)

      Kommentar

      • henk.oosterlinck
        Dumb Home'r
        • 17.06.2016
        • 18

        #4
        This item is more about connecting openv to loxone than about openv itself, a part of the documentation is in the openv forum.
        What you find in the openv forum looks very universal,it should work with practically every viessman heater, see openv forum.
        There is a list of supported heaters on the openv forum, mine was in, I saw other people with my heater were using openv too.

        You will need to adapt the XML files as described in the openv forum for your own heating system.
        There are of course differenes:
        - there are 2 or 3 protocols around, depending on the version of you heater, and you need to specify your heater type so it picks the correct protocol.
        - not everyone has 2 heating circuits
        - not everyone has a solar boiler
        - there are heaters with gas,oil, and I think even heat pumps
        - ...

        The connection is an optical link, so there is no electrical connection between the raspberry pi.
        It connects into the V with 2 lights, there is limited danger because the link is optical.
        You can buy an optolink connector from viessman too, it is used by installers to configure the boiler.
        I bought it from someone in the openv forum who had made his version, I did not have to solder anything, no work for me, it is cheaper than the viessman connector.
        I did not make the adapter myself, I bought it as described on the openv forum.
        There is a 3d print for the housing, which i printed in black in 3d.

        Attached a picture of my raspberry and the openv connector (attached with some wire).

        Kommentar


        • svethi
          svethi kommentierte
          Kommentar bearbeiten
          You have to fill in a little bit of water ;-)
      • s_filmoff
        Smart Home'r
        • 05.09.2015
        • 53

        #5
        Thanks for this great HowTo.
        I just ordered a raspberry pi .
        Do you control your Viessman heater with the intelligent temperature control function block?

        Kommentar

        • henk.oosterlinck
          Dumb Home'r
          • 17.06.2016
          • 18

          #6
          I do use the intelligent room controller.

          I don't think my setup is the easiest example to demonstrate the use of the IRR block.

          I use KNX with loxone, part of the heating control is done in the knx thermostat i have in each room I want to control.
          This makes it more complicated to explain.
          My setup is a mixture of KNX and Loxone.

          Up to a few months ago I only controlled the radiator heating circuit.
          I am working on adding the floor heating and controlling it.
          It makes that I have a slow and a fast heating circuit in some rooms.
          I am almost sure that it will work, but that is not all working and tested now.

          Some of the thermostats are a merten/schneider model, there are others.
          See picture.

          The valves are also from schneider/eberle (I recently bought this one http://www.eberle.de/product.aspx?id=2384)
          The valves are all connected to a knx module (gira 1018 00, or 2114 00)
          see Picture of the valves

          I added some pictures from loxone and ets.

          This helps to give you an idea, but this is not the easiest part to automate.
          Angehängte Dateien

          Kommentar

          • Gast

            #7
            Hi Henk,

            ho did you remove the "slider" from the Viessman heater - I have a large space between my optolink and the heater, if the "slider" is still there ?

            Regards
            Manuel

            Kommentar


            • henk.oosterlinck
              henk.oosterlinck kommentierte
              Kommentar bearbeiten
              You can I think remove it with a credit card (take an old card or loyalty card you don't need or so).

              Slide the slider to the left.
              Put the credit card behind it from the left to the right.
              Force the credit card trough about in the middle of the slider.
              This will unblock the plastic hook retaining the slider.

              You an see this plastic hook on the fotos I posted earlier (the one were the water was low), just below the black box wiht the optolink connector.
              Zuletzt geändert von henk.oosterlinck; 16.01.2017, 19:56.
          • Gast

            #8
            Hi Henk,
            this is great project and very useful. I am now considering to purchase Vitoconnect type OPTO1 and start experimenting. This device will connect to ly local wifi and will obtain regular IP address in order to communicate with Wiessmann remote server and then with my mobile phone. So, it will/ must exchange http commands. Do you think is viable to expect that I can connect Loxone and use http commands to control my boiler. Or do I really need Raspberry to control it?

            Marek

            Kommentar

            • henk.oosterlinck
              Dumb Home'r
              • 17.06.2016
              • 18

              #9
              I have looked at the option of buying vitocom 100 before the summer of 2016.
              The cost of a vitocom 100 was +- 275 euros (found some for 212 euros, ...), that is installed in my house by my heating system installer.
              You end up using the viessman vitotrol app (or other), which is hassle free and nice.
              With this app you will be able to control you heater/boiler, change target temperature, holiday mode, ...

              I think this vitoconnect is more recent than my research.
              Looks like this vitoconnect is an alternative to the vitocom 100.
              It costs apparently less than 100 euro and as it uses the optical cable it is easier to install than the vitocom 100.

              I found this link where you will find some technical background of the protocol behind the app:
              https://www.viessmann.com/app_vitoda...ebService.asmx
              I am not sure if and how you can use the commands described from loxone, but this looks similar to the openv.
              You will have to find some way to link this with loxone.

              You may find a way to do the same, passing just like what I described "any command" from loxone to the boiler, via this vitoconnect.

              Good luck!

              Kommentar

              • Gast

                #10
                Dear Henk,

                I have a Reed contact on my gas meter.
                Therefore it is possible to log the whole gas consumption.

                Now I would like to seperate the gas consumption for warm water.

                Do you know how to do this ?
                Which parameter of the Viessman is the right one to analyze ?

                Can I differ between gas consumption for heating and gas consumption for warm water in the viessman ?

                Thanks a lot.

                Regards
                Manuel

                Kommentar

                • henk.oosterlinck
                  Dumb Home'r
                  • 17.06.2016
                  • 18

                  #11
                  see



                  It seems that for some values such as solar power/hours the viessman keeps a detailled log.

                  For other values such as gas consumption the viessman does not keep any traces.
                  You cannot easily and precisely/correctly do this according to these links.

                  Kommentar

                  • Dimon
                    LoxBus Spammer
                    • 27.08.2015
                    • 381

                    #12
                    Original Viessmann Kabel (3m) 14€ incl. Versand!
                    Haus: 1x Miniserver, 7x Extension, 4x RelayExtension, 1x 1-Wire, 1x DimmerExtension, 1x Tree Extension, 1x ModBus Extension, 1x DMX Extension, 6x RGBW, 2x UFO, 1x AirBaseExtension, 3x RGBW Air, Air Touch, Touch Pure Air, LED Pendulum Slim Tree
                    Wohnung: 1x Miniserver, 3x Extension, 2x RelayExtension, 1x 1-Wire, 1x DimmerExtension, 1x DMX,
                    Cams: Mobotix T25, Mobotix D22, Mobotix Q25, Axis P1428-E
                    LOXBERRY: SmartMeter, Weather 4 Lox
                    Heizung: Viessmann Vitocal 300-A
                    PV: Fronius Symo 17.5.3

                    Kommentar


                    • Nimda3000
                      Nimda3000 kommentierte
                      Kommentar bearbeiten
                      Wo hast Du das Kabel für 18€ gefunden? Hast Du einen Link?
                  • Gast

                    #13
                    Hello Henk,
                    thanks for your description. Do I have to create a simple virtual input or udp, http, virtuell text ?
                    How is the connection to the loxone virtual input. Just with the right VI name. What standes the ...|$1|$E1 for ?
                    Best regards,
                    Benny

                    Kommentar


                    • henk.oosterlinck
                      henk.oosterlinck kommentierte
                      Kommentar bearbeiten
                      see http://openv.wikispaces.com/vclient

                      "Template Modus
                      Im Template Modus (-t) wird ein Template eingelesen und die dort enthaltenen Variablen ersetzt. Die Ausgabe erfolgt dann auf stdout.
                      Damit ist es einfach möglich, die Messwerte der Heizung auszulesen und direkt in eine Datenbank zu schreiben.
                      $1..$n Rückgabewert gewandelt in Gleitkommazahl
                      $R1..$Rn Rückgabewert ungewandelt (Text)
                      $C1..$Cn aufgerufenes Kommando
                      $E1..$En Fehlermeldung pro Kommando"

                      In the zip file "Bash scripts" there is a script called heating.bash.
                      This script heating.bash runs every 5 minutes and reads the status and writes the status to virtual inputs.
                      The parameters for this script are in 2 files: heating.tpl and heating.getcommands, both have the same amount of lines.
                      There are 2 files because vclient has this option to take 1 file "-f" with commands and 1 with the correspondance "-t".
                      In "heating.getcommands" the fist line is "getTempA" (get temperature outside/Aussen), this is a command of vcontrold/viessman daemon.
                      In "heating.tpl" the first line is "Heating_Temperature_Outdoor|$1|$E1",this is my virtual input that is called "VIHeating_Temperature_Outdoor". It is a number (not text) as the value will be something like 16°C.

                      The script passes each command to the viessman, and the first line of the result will be something like "Heating_Temperature_Outdoor|16|OK".
                      The $1 stands for the temperature 16, the E1 for the status OK.
                      etc.

                      Note that this script was copied from the openhab user forum. I adapted it adding some lines so it worked with loxone as well. I mentioned a link to the author of the first script.

                    • Gast
                      Gast kommentierte
                      Kommentar bearbeiten
                      Thanks Henk!
                  • sko3003
                    Azubi
                    • 11.12.2016
                    • 6

                    #14
                    Hello Henk,
                    The output via Telnet works without problems. For setting, see pictures.
                    Angehängte Dateien

                    Kommentar

                    • henk.oosterlinck
                      Dumb Home'r
                      • 17.06.2016
                      • 18

                      #15
                      I changed my intitial script "cgi-vclient.sh" so it would accept parameters.
                      Instead of passing "setBeteriebsArtM1to3" you can use it with parameters like "setBetriebsArtM1 3".
                      Wanted to share this here.

                      The cgi script is a workaround for the telnet that was not working.
                      Telnet seems to be working, I will try this.
                      Thanks a lot for this feedback.

                      Angehängte Dateien

                      Kommentar

                      Lädt...