Skip to content
Engineering standardExpertUpdated 2026-07-08

Programming Standard

Conventions for writing scenes, automations and gateway logic in a way that stays maintainable years later.

Executive summary

The essentials

  • One convention across every controller and gateway family
  • Every automation must be commented
  • Version-control mandatory for gateway configuration
  • Safe defaults for every actuator (fail-off, fail-closed)

Purpose

Make every Smart Citizens configuration understandable to any engineer on the team without tribal knowledge.

Scope

Applies to all scenes, automations, gateway rules, dashboards and touch-panel layouts delivered by Smart Citizens.

Design principles

Principle 1

Readable first — clarity over cleverness

Principle 2

Deterministic — same trigger, same outcome, every time

Principle 3

Fail-safe — actuators return to a defined state on error

Principle 4

Reversible — every automation can be disabled in one click

Engineering requirements

Engineering requirements

Mandatory requirements
  • Configuration stored in Smart Citizens Git repo per site
  • Semantic versioning on every gateway config bundle
  • Comments on every automation describing intent + owner
  • No hard-coded credentials; secrets injected at deploy time
  • Every scene has a documented rollback

    Best practices

    Naming

    Naming: Scenes use verb-noun ('Dim Living to 30%')

    Grouping

    Grouping: Automations grouped by subsystem, not room

    Testing

    Testing: Every automation gets a unit-style dry run

    Review

    Review: Every merge requires a second engineer review

    Installation workflow

    Installation workflow

    Delivery

    How it works

    1. 1. Repo bootstrap

      Clone the Smart Citizens site template and set project variables.

    2. 2. Base scenes

      Import the standard scene library and localise names.

    Configuration & programming workflow

    Configuration & programming workflow

    Delivery

    How it works

    1. 1. Author

      Write scenes and automations in the editor per naming rules.

    2. 2. Comment

      Add intent + owner + date to every automation header.

    3. 3. Peer review

      Second engineer reviews and approves the pull request.

    4. 4. Deploy

      Bundle is tagged, signed and deployed to the site controller.

    5. 5. Verify

      Verify checksum on the controller matches the tag.

    Commissioning steps

    Commissioning steps

    Delivery

    How it works

    1. 1. Dry run

      Trigger every new automation manually and confirm expected behaviour.

    2. 2. Idle observation

      Watch the system for 30 min for unintended triggers.

    3. 3. Rollback drill

      Roll back to previous tag and confirm state.

    Validation checklist

    Validation checklist

    Validation checklist (must do)
    • All configuration in version control
    • Every automation has a comment header
    • Rollback tag exists and is documented
    • No hard-coded secrets in the bundle
    Common mistakes
    • Un-commented automations
    • Configuration edited directly on the controller
    • Hard-coded API tokens
    • Merges without peer review

    Quality assurance checklist

    Naming audit

    Random 20% of scenes match the naming convention.

    Comment coverage

    100% of automations have a comment header.

    Rollback tested

    Rollback drill has been executed at least once.

    Acceptance criteria

    Acceptance criteria
    FeatureTargetVerification methodPriority
    Version-controlled bundle
    100%Git logHigh
    Peer review
    100% of mergesRepository review recordHigh
    Rollback rehearsed
    Once per siteCommissioning reportMedium
    Acceptance criteria

    Risk matrix

    Risk matrix
    FeatureLikelihoodImpactMitigation
    Un-reviewed hot fix
    MediumHighEmergency merge requires second engineer within 24 h
    Secret leaked in repo
    LowHighPre-commit secret scanning; secrets injected at deploy
    Risk matrix

    Common mistakes & troubleshooting

    Troubleshooting tips

    Delivery

    How it works

    1. Unexpected trigger

      Search the repo for automations bound to overlapping conditions.

    2. Rollback fails

      Verify the previous tag exists and controller has the target firmware.

    Documentation requirements

    Documentation requirements

    Documentation deliverables
    • Repository README per site
    • Scene catalogue
    • Automation index
    • Rollback runbook

      Maintenance timeline

      Maintenance timeline

      Delivery

      How it works

      1. Monthly

        Review automation trigger counts; deprecate unused rules.

      2. Quarterly

        Refresh secrets and rotate deploy keys.

      Version & change log

      Version 1.0

      Approval status: Approved · Effective date: 2026-01-15 · Last revision: 2026-07-08

      Author / Reviewer

      Author: Smart Citizens Engineering · Reviewer: Dr. Ashraf Nouri

      Change log

      v1.0 — 2026-07-08

      Initial published edition. (Smart Citizens Engineering)

      Frequently asked questions

      FAQ

      Frequently asked questions

      Which VCS do you use?

      Git, on the Smart Citizens engineering GitHub organisation, one private repo per site.

      How are secrets managed?

      Secrets are stored in the Smart Citizens vault and injected at deploy time; never committed to the repo.

      Official citation
      How to cite
      Suggested citation
      Smart Citizens Engineering. "Programming Standard." Smart Citizens, 2026-01-15. https://ai.smartcitizens.ae/standards/programming-standard.
      Smart Citizens Engineering (2026). Programming Standard. Smart Citizens. Retrieved 2026-07-23, from https://ai.smartcitizens.ae/standards/programming-standard
      CategoryEngineering Standard
      AuthorSmart Citizens Engineering
      PublisherSmart Citizens
      Published2026-01-15
      Last updated2026-07-08
      VersionPlaceholder-ready
      Language
      en
      LicenseCC BY-NC 4.0 (unless noted)
      DOIPlaceholder-ready

      Design your smart environment with Smart Citizens

      Talk to Smart Citizens engineers for a bespoke design, budget estimate, and rollout roadmap.