ApacheHVAC Component Variable Names

The VE Python API allows users create simple programs using the Python Programming Language, to interact with a VE Model and/or Vista Results File
Post Reply
nikhil_makan
VE Newbie
VE Newbie
Posts: 4
Joined: Wed Feb 16, 2022 12:00 am

ApacheHVAC Component Variable Names

Post by nikhil_makan »

Good Day, I know there has been a few other post related to this topic which I will paste the links here for reference.

https://forums.iesve.com/viewtopic.php? ... c25d0d3b74
https://forums.iesve.com/viewtopic.php? ... c25d0d3b74

I am trying to read the results off a heating coil in an ApacheHVAC system via the htn results file. However I am getting an error and not sure if its because I got the aps_var name wrong. But I have no idea where to get the correct aps_var names as the get_variables() methods does not return ApacheHVAC component variables.

I am using IES VE 2021.3.1.0

Sample Code:

Code: Select all

import iesve
from ies_file_picker import IesFilePicker
import pandas as pd

file_name = IesFilePicker.pick_vista_file([("Vista Files", "*.aps;*.apm;*.htn;*.cln;*.htg;*.clg;*.asp")], "Pick a file")
print(file_name)

with iesve.ResultsReader.open(file_name) as results_file:
    hvac = iesve.HVACNetwork
    network = hvac.load_network(results_file.hvac_file)
    print("\nName: " + network.name)
    
    #df = pd.DataFrame.from_records(results_file.get_variables())

    value = results_file.get_hvac_component_results("HC003396","HVAC_TYPE_SIMPLE_HEATING_COIL","Air flow",-1,-1)
    print(value)  
Error:

Code: Select all

    value = results_file.get_hvac_component_results("HC003396","HVAC_TYPE_SIMPLE_HEATING_COIL","Air flow",-1,-1)
Boost.Python.ArgumentError: Python argument types in
    ResultsReader.get_hvac_component_results(ResultsReader, str, str, str, int, int)
did not match C++ signature:
    get_hvac_component_results(class ResultsReader {lvalue}, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, int, class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >, int start_day=-1, int end_day=-1)
Any help on interpreting this error would be greatly appreciated!
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: ApacheHVAC Component Variable Names

Post by Rhind »

Hi,

Looks like you're passing a wrong second parameter to get_hvac_component_results(). You need to use the number rather than the name, so in this case you would need to use 2 as specified in the user guide.

Try changing this:

Code: Select all

value = results_file.get_hvac_component_results("HC003396","HVAC_TYPE_SIMPLE_HEATING_COIL","Air flow",-1,-1)
to this:

Code: Select all

value = results_file.get_hvac_component_results("HC003396",2,"Air flow",-1,-1)
Hopefully that fixes the issue for you.
nikhil_makan
VE Newbie
VE Newbie
Posts: 4
Joined: Wed Feb 16, 2022 12:00 am

Re: ApacheHVAC Component Variable Names

Post by nikhil_makan »

Perfect! That wasn't too clear in the documentation, but fixed my issue. Thank you!

Going back to the original question however is there anywhere to get the aps variable names for HVAC components? For example, I am unable to return results of Heating or Cooling Coils for the variables 'Air entering relative humidity' and 'Air leaving relative humidity'.

It just returns a Python None which I assume means the variable doesn't exist. I am able to return many of the other variables (Sensible Load, Air flow etc.)

I can confirm there are results against these variables in VistaPro
marentette
VE Newbie
VE Newbie
Posts: 4
Joined: Thu Nov 10, 2022 10:57 pm

Re: ApacheHVAC Component Variable Names

Post by marentette »

Any updates to this? I am also finding the 'get_hvac_component_results' method returns None for parameters that can be seen in VistaPro.

Is this due to the variable name being different from the VistaPro interface and the result file?
User avatar
Rhind
IES Staff
IES Staff
Posts: 87
Joined: Fri Mar 22, 2013 5:06 pm

Re: ApacheHVAC Component Variable Names

Post by Rhind »

Should be 'Entering relative humidity' and 'Leaving relative humidity'. There are a number of such cases where the display name in Vista differs from that used in the results files. If you contact support, they can provide a list of all the variable names.
User avatar
richardquincey
IES Staff
IES Staff
Posts: 2
Joined: Thu Feb 23, 2023 12:00 pm

Re: ApacheHVAC Component Variable Names

Post by richardquincey »

There is an article on Discover IES that provides a script for outputting all the variable names (both apache & display) & units available in any aps file
https://www.iesve.com/discoveries/view/ ... cripts-aps
marentette
VE Newbie
VE Newbie
Posts: 4
Joined: Thu Nov 10, 2022 10:57 pm

Re: ApacheHVAC Component Variable Names

Post by marentette »

Thanks, I do not see any HVAC component variables in the exported list.

Code: Select all

with iesve.ResultsReader.open(file_name) as results_file_reader:
    hvac = iesve.HVACNetwork
    network = hvac.load_network(results_file_reader.hvac_file)
    for component in network.components:           

        if isinstance(component, iesve.HVACAirToAirHeatEnthalpyExchanger):

            #results from each erv
            vars = ["Latent heat recovery" , "Sensible heat recovery","Total enthalpy/heat recovery","Exhaust/right side entering air flow", "Supply/left side entering air flow"]
            for var in vars:
                results = results_file_reader.get_hvac_component_results(component.id, 
                                                                            10 , 
                                                                            var, -1 , -1) #This returns None for all ERV varibles that have a value in VistaPro 
                if results:
                    print("Results: {}".format(results) + var)
                    
            
        if isinstance(component, iesve.HVACHeatingCoil):
            results = results_file_reader.get_hvac_component_results(component.id, 
                                                            2, 
                                                            "Sensible load", -1 , -1)# This works! 
In the example above all of the ERV variables that have a value inside VistaPro return None. The heating coil returns the Sensible Load data as expected.
User avatar
richardquincey
IES Staff
IES Staff
Posts: 2
Joined: Thu Feb 23, 2023 12:00 pm

Re: ApacheHVAC Component Variable Names

Post by richardquincey »

Variables available in the Python API for HVACAirToAirHeatEnthalpyExchanger are listed in The VEScripts user guide section 6.1.7.2.10.1. these are currently limited to:

latent_heat_effectiveness (float) Latent heat effectiveness
motor_or_pump_power (float) Motor or pump power
sensible_heat_effectiveness (float) Sensible heat effectiveness


Post Reply