I've had an idea for a while now. About a spell that does a moderate amount of damage to any character not immune to it, but you can get an optional dwarven sphere companion, who is healed by it. This spell is very cheap magicka wise, but it also causes slight health damage to the caster. The idea of it is a spell that requires sacrificing the players health to heal this optional ally, and the dwarven sphere being a non-biological being is supposed to explain why something that damages biological creatures, can have no effect on it, or even heal it. If you know how health funnel functions in World of Warcraft, it's very similar to the idea.
I am pretty sure there are default healing spells in game, but they don't work on robots.
How would one ensure dwarven robots are immune to the damage, and that it doesn't make hostile if it does no damage? Also how would one ensure, that only they could be effected by the healing effect? Is this type of spell even possible, or would it be best for the sake of simplicity, to make a spell that damages the player, but only heals dwarven robots, if that's possible?