{"id":24221602,"url":"https://github.com/michdo93/openhab-virtual-alarm-clock","last_synced_at":"2026-02-23T04:14:31.479Z","repository":{"id":135031828,"uuid":"529401708","full_name":"Michdo93/openHAB-virtual-alarm-clock","owner":"Michdo93","description":"An virtual alarm clock with openHAB.","archived":false,"fork":false,"pushed_at":"2022-08-26T21:10:46.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T01:34:27.636Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Michdo93.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-26T20:51:55.000Z","updated_at":"2022-08-26T20:51:55.000Z","dependencies_parsed_at":null,"dependency_job_id":"cf77b42f-237f-40f0-9ae6-3de9f8ef6a3d","html_url":"https://github.com/Michdo93/openHAB-virtual-alarm-clock","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Michdo93/openHAB-virtual-alarm-clock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2FopenHAB-virtual-alarm-clock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2FopenHAB-virtual-alarm-clock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2FopenHAB-virtual-alarm-clock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2FopenHAB-virtual-alarm-clock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Michdo93","download_url":"https://codeload.github.com/Michdo93/openHAB-virtual-alarm-clock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Michdo93%2FopenHAB-virtual-alarm-clock/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29737234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T02:24:00.660Z","status":"ssl_error","status_checked_at":"2026-02-23T02:22:56.087Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-14T06:19:41.959Z","updated_at":"2026-02-23T04:14:31.451Z","avatar_url":"https://github.com/Michdo93.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# openHAB-virtual-alarm-clock\nAn virtual alarm clock with openHAB.\n\n## Items\n\nYou need:\n\n* a switch item for activating the alarm clock\n* a number item for setting the hours\n* a number item for setting the minutes\n\n```\nGroup gVirtualAlarmClock \"Virtual Alarm Clock\" \u003ctime\u003e\n\nSwitch virtual_alarm_clock \"Alarm Clock\" \u003cclock\u003e (gVirtualAlarmClock)\nNumber virtual_alarm_clock_H \"Alarm Clock Hour [%s]\" \u003ccalendar\u003e (gVirtualAlarmClock)\nNumber virtual_alarm_clock_M \"Alarm Clock Minute [%s]\" \u003ccalendar\u003e (gVirtualAlarmClock)\n```\n\n## Rules\n\nThe rule is cron based and will trigger if the switch is enabled:\n\n```\nvar Timer alarm_clock = null\n\nrule \"alarm clock\"\n    when\n        Time cron \"0 * * * * ?\"\n    then\n        if (virtual_alarm_clock.state == ON) {\n                var target_minute = (virtual_alarm_clock_M.state as DecimalType).intValue\n                var target_hour = (virtual_alarm_clock_H.state as DecimalType).intValue\n\n                var time_now = now()\n\n                if (target_minute == time_now.getMinute() \u0026\u0026 target_hour == time_now.getHour()) {\n                    \u003cplay_music_item\u003e.sendCommand(\"\u003cfile\u003e.mp3\")\n                    \u003cvolume_item\u003e.sendCommand(30)\n                    alarm_clock = createTimer(now.plusMinutes(3)) [|\n                        \u003cstop_music_item\u003e.sendCommand(ON);\n            ]\n                }\n        }\nend\n\n\n\nrule \"alarm clock off\"\nwhen\n        Item virtual_alarm_clock changed to OFF\nthen\n        \u003cstop_music_item\u003e.sendCommand(ON);\nend\n```\n\nYou need:\n\n* an `\u003cplay_music_item\u003e`. For me this is a item for a Sonos speaker which can play a `URI` using the [Sonos Binding](https://www.openhab.org/addons/bindings/sonos/).\n* a `\u003cfile\u003e.mp3`. This is the `URI` my Sonos speaker will play.\n* an `\u003cvolume_item\u003e`. This is an item which will control the volume of my Sonos speaker.\n* an `\u003cstop_music_item\u003e`. This is an item which will stop the Sonos speaker playing the `URI` file.\n\n## Sitemaps\n\nInside your sitemap you have to add:\n\n```\nText label=\"virtual alarm clock\" icon=\"time\" {\n    Switch item=virtual_alarm_clock mappings=[ON=\"Alarm clock on\", OFF=\"Alarm clock off\"]\n    Setpoint item=virtual_alarm_clock_H minValue=0 maxValue=23 step=1\n    Setpoint item=virtual_alarm_clock_M minValue=0 maxValue=59 step=1\n}\n```\n\nThis will give you the possibility to\n\n* activate the alarm clock.\n* deactivate the alarm clock.\n* manually deactivate the alarm.\n* set the hours for the alarm clock.\n* set the minutes for the alarm clock.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichdo93%2Fopenhab-virtual-alarm-clock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichdo93%2Fopenhab-virtual-alarm-clock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichdo93%2Fopenhab-virtual-alarm-clock/lists"}