Example SmartApp Integrated With Rules API

Hello, I’m just putting this out here for the community.

It combines several of the Samsung Community GitHub examples with some Rules API info from the community and puts together a functional SmartApp, typed pretty completely with TypeScript.

Link To GitHub Branch

I set aside a static branch here, while the ‘main’ branch will be my continued development of a much more complicated multi-smartapp environment (so be sure to follow that link above to the specific branch for the isolated example).

I also tried to be very explicit, with screenshots and steps in setup and configuration.

I was satisfied enough with the current state to think it may provide some good example data for others.

Hope it helps someone. I don’t have intentions to make continued updates and formal ‘RELEASE’, but people are welcome to fork and clone.

As a short summary…

After selecting a motion sensor, some sets of switches (lights) in your home and some time ranges, it…

  • sets up a rule to run during configured daylight hours based on motion of the sensor(s) detected
  • sets up a rule to run during configured nighttime hours based on motion of the sensor(s) detected
  • sets up an ‘idle’ rule to turn off the selected device(s) after an amount of idle time
  • sets up a ‘transition’ rule to change day–>night if devices are active
  • allows configuration of delays, customized time ranges, disabling of specific rules and describes the configured rules current configuration on open of the smart-app

By installing multiple of these ‘SmartApps’ in your home you can configure several rooms/areas independently. To be fair, it’s also what met my needs…

5 Likes