diff --git a/GettingStarted.md b/GettingStarted.md index 1322efa5..245b10e8 100755 --- a/GettingStarted.md +++ b/GettingStarted.md @@ -57,7 +57,7 @@ - If you edit the font size you have to update both the font size and the corresponding font_size in Globals 3. Customize **Globals** -4. Update the **Custom Components** in the esphomeRemote/sharedRemoteConfig.yaml to match your config +4. Update the **Custom Components** in the esphomeRemote/sharedRemoteConfig.yaml to match your config, if you have difficulties looks at the [examples](sharedRemoteConfig-examples.md). 1. Every component is optional. If you don't want to include the component then remove it 2. Set your speaker media players under speaker_group_component 1. If you have a supported TV then update it otherwise remove the TV line diff --git a/esphomeRemote/esphomeRemotePlayer.h b/esphomeRemote/esphomeRemotePlayer.h index 5c9c02b4..bd3ff971 100644 --- a/esphomeRemote/esphomeRemotePlayer.h +++ b/esphomeRemote/esphomeRemotePlayer.h @@ -150,6 +150,9 @@ class BasePlayerComponent : public CustomAPIDevice, public Component { } else if (strcmp(state.c_str(), "standby") == 0) { playerState = PowerOffRemotePlayerState; clearMedia(); + } else if (strcmp(state.c_str(), "off") == 0) { + playerState = PowerOffRemotePlayerState; + clearMedia(); } else if (strcmp(state.c_str(), "home") == 0 || strcmp(state.c_str(), "Roku") == 0) { playerState = StoppedRemotePlayerState; clearMedia(); diff --git a/sharedRemoteConfig-examples.md b/sharedRemoteConfig-examples.md new file mode 100644 index 00000000..a08065e2 --- /dev/null +++ b/sharedRemoteConfig-examples.md @@ -0,0 +1,42 @@ +

ESPHome Remote: config Examples

+ +These are some configuration bits for common use cases that can be put in [sharedRemoteConfig.yaml](esphomeRemote/sharedRemoteConfig.yaml). It is C++-Code that is injected via the yml-File, so if you are not used to it pay attention to all the weird charackters (,{},"| spaces - they all do matter). + +You should be able to replace the entire section with the example given below and simply adjust the names of your entities. + +# without TV +to configure the remote without a TV but with smart speakers: + +``` + ## Home assistant tv and media player + - lambda: |- + SpeakerSetup soundBar = SpeakerSetup("media_player.beam", "Beam"); + std::vector tvSetup = {}; + std::vector speakerSetup = { + SpeakerSetup("media_player.kitchen", "Kitchen"), + SpeakerSetup("media_player.sofa", "Living room") + }; + speakerGroup = new SonosSpeakerGroupComponent(displayUpdate); + speakerGroup->setup(tvSetup, speakerSetup); + return {speakerGroup}; + id: speaker_group_component +``` + +# with TV but without soundbar +to configure the remote with a TV and with smart speakers but without a soundbar: + +``` + ## Home assistant tv and media player + - lambda: |- + std::vector tvSetup = { + TVSetup("media_player.your_smart_tv", "TV", NULL) + }; + std::vector speakerSetup = { + SpeakerSetup("media_player.kitchen", "Kitchen"), + SpeakerSetup("media_player.sofa", "Living room") + }; + speakerGroup = new SonosSpeakerGroupComponent(displayUpdate); + speakerGroup->setup(tvSetup, speakerSetup); + return {speakerGroup}; + id: speaker_group_component +```