Rule-based systems have been increasing in popularity in recent years. They allow for easier handling of both simple and complicated problems utilising a set of rules created in various ways (e.g., manually, or (semi-) automatically, via, say, machine learning or decision trees) depending on the situation. Despite their usefulness however, there are still improvements to be made. Knowledge representation technologies have been available for a long time and provide the means to represent domains formally and correlate entities in those domains. They also allow for ontological reasoning that can take advantage of such connections between entities. These techniques can be useful when applied on rule-based systems in order to improve the quality of rules and, hence, overall system performance. We describe and implement an approach to refine rules used in Internet-of-Things scenarios using knowledge representation and reasoning. The proposed solution uses ontological reasoning on the preconditions and postconditions of rules as it aims to reduce the total amount of rules in a system and simplify them.