How to control how often SQL commands execute?

SQL sensors, it is my understanding, execute once every minute? I have a “heavy” SQL command I want to run once an hour. I have tried everything I can think of but nothing has worked. I tried creating command line sensors to run hourly via a script but apparently MariaDB is in a different “container” from the environment in which the command line sensors run, so there’s no database there. I tried creating a cron job to run a script, since MariaDB is available via the shell, but cron apparently doesn’t work. I’m running HAOS, by the way.

Any ideas for how to execute an SQL command once an hour?

You need to disable the automatic polling for the integration, then you can set up an automation (using a time pattern, perhaps) to use the homeassistant.update_entity action to refresh the sensor on your schedule. You can find information on how to do this on the Speedtest.net - Home Assistant.

The documentation for the SQL integration should probably include this information if you’d like to submit an edit to the page.

What integration are you referring to? Sql? The link you provided talks about disabling poling for an integration but what I want to control is how often SQL commands are run.