{"id":13907,"date":"2025-03-27T14:05:42","date_gmt":"2025-03-27T14:05:42","guid":{"rendered":"https:\/\/www.rjt.org.uk\/home\/?post_type=home_assistant_tip&#038;p=13907"},"modified":"2025-03-27T14:09:25","modified_gmt":"2025-03-27T14:09:25","slug":"simple-sunrise-light","status":"publish","type":"home_assistant_tip","link":"https:\/\/www.rjt.org.uk\/home\/archives\/home-assistant-tip\/simple-sunrise-light\/","title":{"rendered":"Simple Sunrise Light"},"content":{"rendered":"\n<p>Before the Alarm goes off in the morning and it is before sunrise, the dimmable light in the bedroom will gently brighten.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">alias: bedroom sunrise light\nsequence:\n  - if:\n      - condition: device\n        type: is_off\n        device_id: a7701bed7a2665599bfc7f73b66589a2\n        entity_id: light.bedroom_1_main_light\n        domain: light\n      - condition: state\n        entity_id: input_boolean.need_lights\n        state: \"on\"\n    then:\n      - data:\n          brightness_pct: 5\n        target:\n          device_id: a7701bed7a2665599bfc7f73b66589a2\n        action: light.turn_on\n      - repeat:\n          count: \"50\"\n          sequence:\n            - delay:\n                hours: 0\n                minutes: 0\n                seconds: 2\n                milliseconds: 0\n            - if:\n                - condition: state\n                  entity_id: light.bedroom_1_main_light\n                  state: \"off\"\n              then:\n                - stop: Some one turned the light off\n            - target:\n                device_id: a7701bed7a2665599bfc7f73b66589a2\n              data:\n                brightness_step_pct: 1\n              action: light.turn_on\nmode: single\n<\/pre>\n\n\n\n<p>The script above is called by our alarm script which also uses the following to turn on the radio at the correct time increasing the volume slowly.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"yaml\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">alias: Radio 2 (Bedroom)\nsequence:\n  - target:\n      entity_id:\n        - media_player.bedroom_sonos\n    data:\n      source: Radio 2\n    action: media_player.select_source\n  - metadata: {}\n    data:\n      volume_level: 0\n    target:\n      entity_id: media_player.bedroom_sonos\n    action: media_player.volume_set\n  - target:\n      entity_id:\n        - media_player.bedroom_sonos\n    data: {}\n    action: media_player.media_play\n  - data:\n      target_volume: 0.32\n      duration: 15\n      curve: logarithmic\n      target_player: media_player.bedroom_sonos\n    action: script.fade_the_volume_of_a_media_player\nmode: single\nicon: mdi:music\ndescription: \"\"<\/pre>\n\n\n\n<p>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"template":"","class_list":["post-13907","home_assistant_tip","type-home_assistant_tip","status-publish","hentry","comments-off"],"_links":{"self":[{"href":"https:\/\/www.rjt.org.uk\/home\/wp-json\/wp\/v2\/home_assistant_tip\/13907","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rjt.org.uk\/home\/wp-json\/wp\/v2\/home_assistant_tip"}],"about":[{"href":"https:\/\/www.rjt.org.uk\/home\/wp-json\/wp\/v2\/types\/home_assistant_tip"}],"wp:attachment":[{"href":"https:\/\/www.rjt.org.uk\/home\/wp-json\/wp\/v2\/media?parent=13907"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}