Have you tried it as a one liner in rc.local?

host=$(hostname -I | sed 's/ *$//g');port=:80;cd /var/www/opensprinkler/;python ospi.py $host$port

Also try setting the full path to ‘python’ like ‘/usr/local/bin/python’ <- check that path on your device. I don't have an OSPI!

BTW: Why not skip the ‘cd …’ part and use full paths all the way to minimize any errors?

host=$(hostname -I | sed 's/ *$//g');port=:80;///python /var/www/opensprinkler/ospi.py $host$port