{"id":13351,"date":"2021-12-11T08:41:48","date_gmt":"2021-12-11T08:41:48","guid":{"rendered":"https:\/\/www.rjt.org.uk\/home\/?post_type=home_assistant_tip&#038;p=13351"},"modified":"2021-12-11T08:41:49","modified_gmt":"2021-12-11T08:41:49","slug":"controlling-switchbot-curtains-via-alexa","status":"publish","type":"home_assistant_tip","link":"https:\/\/www.rjt.org.uk\/home\/archives\/home-assistant-tip\/controlling-switchbot-curtains-via-alexa\/","title":{"rendered":"Controlling Switchbot Curtains via Alexa"},"content":{"rendered":"\n<p>Although there is a switchbot integration for Home assistant, I could not get it to work easily.  So I set up an input boolean for my living room curtains and then set up two routines on Alexa to open and close the curtains.  The routines toogle the input boolean when run so the states say in sync  even if the curtains are opened or closed via Alexa.<\/p>\n\n\n\n<p><\/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: Control Living Room Curtains\ndescription: ''\ntrigger:\n  - platform: state\n    entity_id: input_boolean.living_room_curtains\n    id: open\n    to: 'on'\n  - platform: state\n    entity_id: input_boolean.living_room_curtains\n    id: close\n    to: 'off'\ncondition: []\naction:\n  - choose:\n      - conditions:\n          - condition: trigger\n            id: open\n        sequence:\n          - service: media_player.play_media\n            data:\n              media_content_id: open curtains\n              media_content_type: custom\n            target:\n              entity_id: media_player.kitchen_sonos\n      - conditions:\n          - condition: trigger\n            id: close\n        sequence:\n          - service: media_player.play_media\n            data:\n              media_content_id: close curtains\n              media_content_type: custom\n            target:\n              entity_id: media_player.kitchen_sonos\n    default: []\n  - service: media_player.play_media\n    data:\n      media_content_id: open curtains\n      media_content_type: custom\n    target:\n      entity_id: media_player.kitchen_sonos\nmode: single\n<\/pre>\n","protected":false},"template":"","class_list":["post-13351","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\/13351","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=13351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}