Using honeybee + radiance with CLI

Hello! Is there a guide that exists on how to get started with simulating HB models in radiance from the command line? I have models being generated in GH and output as .hbjson files along with the corresponding .rad directories, and I am wanting to run certain recipes using the CLI rather than going through GH.

Any guidance or direction would be greatly appreciated!

@compdesigner-nz Maybe this tutorial will help you.
https://www.ladybug.tools/honeybee-core/docs/honeybee.cli.html

Hi @compdesigner-nz,

There are two ways. In both cases you will need an inputs.json file so let’s start with that. When you run a recipe (here annual-daylight) through GH you will see in the folder that there is a JSON file. The JSON file stores all the inputs to the recipe. For annual-daylight you can see the possible inputs here. Not all inputs are required, e.g., you can see that I don’t have any input for the schedule. For annual-daylight the required inputs are model and wea.


annual_daylight_inputs

Method 1: queenbee local run
If you type queenbee local run --help in the cmd you get this:

To run the recipe I would execute the following command:
queenbee local run "C:\Program Files\ladybug_tools\python\Lib\site-packages\lbt_recipes\annual_daylight" . -i annual_daylight_inputs.json -w 6 -n queenbee_annual_daylight

Notice that I use a period for the project_folder argument because I am already in the folder with the input files. I now have a new folder (queenbee_annual_daylight). This folder is similar to the annual_daylight folder that was generated when I ran the recipe in GH.

You may have to run the following command first:
pip install queenbee-local -U

Method 2: pollination dsl run (I prefer this)
First you have to set an environment variable QB_POLLINATION_TOKEN. You do this by generating an API Key on https://app.pollination.cloud/. Under settings on your profile you can generate a key.


Save the key as an environment variable called QB_POLLINATION_TOKEN. Check this if you are not sure what to do. In the link the variable is called POLLINATION_API_KEY, but you should call it QB_POLLINATION_TOKEN. Once you have done this you can continue.

If you type pollination dsl run --help in the cmd you get this:


To run the recipe I would execute the following command:
pollination dsl run annual-daylight . -i annual_daylight_inputs.json -w 6 -n pollination_annual_daylight

Notice that I left out “pollination” from the recipe name, e.g., annual-daylight instead of pollination-annual-daylight. Either of them works.

Once again I now have a new folder called pollination_annual_daylight.

You may have to run the following command first:
pip install pollination-dsl -U
pip install pollination-annual-daylight -U

5 Likes

Just to supplement what @mikkel said here, there is a third method that’s a little bit more streamlined but only works for the recipes that ship with Ladybug Tools for Grasshopper (aka. lbt-recipes).

Method 3: lbt-recipes run (Chris prefers this)
Here are the docs for the command.

It’s very similar to the two other methods @mikkel posted except that you only need the name off the recipe and not the path to a folder with the recipe files. Also, aside from installing Radiance and Python, there are only two steps that you need to get all set up with this workflow:

pip install lbt-dragonfly -U

and then:

pip install lbt-recipes -U

FYI, this is the main page that links to all docs across the entire Ladybug Tools SDK:
https://discourse.ladybug.tools/pub/ladybug-tools-core-sdk-documentation
You will see that lbt-recipes is just one of several libraries that make up the plugin.

3 Likes

Thanks for the solution! With the weather file input, does it have to be a .wea file or can it be a .ddy or .epw file?

@chris why would CreateRadFolder fail?

Hi @compdesigner-nz,

In case you didn’t try yet - yes, you can use an .epw file. Btw, since you are not going to do any development on any of the recipes that ship with Ladybug Tools for Grasshopper (I assume this), but rather use them as they are, I would suggest that you use Method 3.

Can you share the logs file? You should find it in the __logs__ folder.

2 Likes

Don’t worry about the issue - solved it! Just me being an idiot and forgetting to assign my sensor grid to the test room!