[VitoConnect] Getting readings from Viessmann Heating system via VitoConnect

Hello,

This is my first post here, I wanted to thanks @opus and @thetrueavatar for sharing this viessmann / vitoconnect solution.
I own a Viessmann fuel boiler (vitoladens 300c) with a vitoconnect attach to it since 1 year, used initially for remote control / supervision.

I want to optimize my heating and I’ve just installed and configured an OpenHab solution with the Viessmann-API : after a few gotchas it’s working nicely. I’m also configuring some MAX! radiators TRV but that’s another story..

Just want to share an alternative to your config : as I want to persist in influxdb the temperatures data fetch from the vitoconnect, I needed the items to be cast as Number and not String, so here are my openhab config ;

Items definition, the ‘gTemperatures’ is used ad a funcitonal group to persist all ‘temperatures related’ items to be persisted in influxdb

Number Viessmann_OutsideTemperature "T° Extérieur [%.1f °C]"        (gTemperatures)  
Number Viessmann_BoilerTemperature  "T° Chaudière [%.1f °C]"        (gTemperatures)  
Number Viessmann_EcoTemperature     "T° consigne Eco [%.1f °C]"                      
Number Viessmann_NormalTemperature  "T° consigne Normal [%.1f °C]"                   
Number Viessmann_ComfortTemperature "T° consigne Comfort [%.1f °C]"                 

php script that will output JSON formatted data (for me /etc/openh2/scripts/viessmann-api/get-vitoconnect-data.php)

<?php include __DIR__.'/bootstrap.php'; ?>
{
    "Mode" :          <?php echo $viessmannApi->getActiveMode() ?>,
    "Program" :       <?php echo $viessmannApi->getActiveProgram() ?>,
    "IsBurnerAcive" : <?php echo $viessmannApi->isHeatingBurnerActive() ?>,
    
    "ExtTemp" :      <?php echo $viessmannApi->getOutsideTemperature() ?>,
    "BoilerTemp" :   <?php echo $viessmannApi->getBoilerTemperature() ?>,
    "EcoTemp" :      <?php echo $viessmannApi->getEcoProgramTemperature() ?>,
    "NormalTemp" :   <?php echo $viessmannApi->getNormalProgramTemperature() ?>,
    "ComfortTemp" :  <?php echo $viessmannApi->getComfortProgramTemperature() ?>

}

GetVitoconnetData rule to extract the data for each item, cast as number thanks to JSONPATH Transformation :

// Updates heating related Items with data exposed by the vitoConnect/Viessmann-PHP API :
rule "GetVitoconnetData"
  when
     Time cron "0 0/5 * * * ?" //called every five  minutes
  then

    var jsonVitoData = executeCommandLine("php /etc/openhab2/scripts/viessmann-API/get-vitoconnect-data.php", 5000)
    
    logDebug("GetVitoconnetData","get-vitoconnect-data.php executed !")
    try {
        // Parse the output and post Updates :
        Viessmann_OutsideTemperature.postUpdate( transformRaw("JSONPATH", "$.ExtTemp", jsonVitoData)  ) 
        Viessmann_BoilerTemperature.postUpdate( transformRaw("JSONPATH", "$.BoilerTemp", jsonVitoData)  ) 
        
        Viessmann_EcoTemperature.postUpdate( transformRaw("JSONPATH", "$.EcoTemp", jsonVitoData)  ) 
        Viessmann_NormalTemperature.postUpdate( transformRaw("JSONPATH", "$.NormalTemp", jsonVitoData)  ) 
        Viessmann_ComfortTemperature.postUpdate( transformRaw("JSONPATH", "$.ComfortTemp", jsonVitoData)  ) 
        logDebug("GetVitoconnetData","vitoconnet data updated !")

    }  catch(TransformationException e) {
        logError("GetVitoconnetData", "Unable to extract valid data from script result : " + e.getMessage)
    }
  end

Using above config, my influxdb/grafana is working and will let me know precisely how my heating operate.

I still have to work on persistence of the ‘isBurnerActive’ field, maybe as a 0/1 int.
Another missing information in my influxdb is the ‘circulation pump’ activation.. but I dont think vitoconnect give access to this.. so sad.

Thank you again for sharing this.

EDIT : on my system, use of ‘@@’ in command line was a mistake : on a raspberry the behaviour with the ‘@@’ is a truncated script output send to the rule.. my data was not retrieved as wanted (only first 2 fields at the begining of the json structure were correctly fetch)