Coder Social home page Coder Social logo

Comments (7)

nagyrobi avatar nagyrobi commented on July 19, 2024

I don't have any devices at my hand which can be "turned off" thus I can't test this scenario myself. Can you please test these two commands when the speaker is off and, respectively is on, and post back the results?

http://spe.ak.er.ip/httpapi.asp?command=getStatusEx
http://spe.ak.er.ip/httpapi.asp?command=getPlayerStatus

Also, if you unplug the power cable and power it back up, does it start truned off or on?

Also, when you run from dev tools the service linkplay.snapshot only, does the speaker turn on by itself?

from home-assistant-custom-components-linkplay.

AThomsen avatar AThomsen commented on July 19, 2024

There doesn't seem to be any difference in the response that's usable for detecting if the thing is on.
json.zip

Please also note that if the player is turned on and not playing the output is exactly similar. When the player is on and not playing, it'll turn off if within a few minutes.

snapshot does not turn on the player. I've played around with httpapi.asp?command=IOSimuRead:x to see if it is controlled by GPIO but not come to any conclusion :-(

Best I've come up with is the script below.

announce_linkplay:
  sequence:
   - service: linkplay.snapshot
     data_template:
       entity_id: "{{ entity_id }}"
   - choose:
     - conditions:
       - condition: template
         value_template: "{{ is_state(entity_id, 'idle') }}"
       sequence:
       - service: media_player.play_media
         data_template:
           entity_id: "{{ entity_id }}"
           media_content_id: 'https://raw.githubusercontent.com/anars/blank-audio/master/1-second-of-silence.mp3'
           media_content_type: url
       - delay: '00:00:05'

   - service: media_player.volume_set
     data_template:
       entity_id: "{{ entity_id }}"
       volume_level: "{{ volume }}"
   - service: tts.google_cloud_say
     data_template:
       entity_id: "{{ entity_id }}"
       message: "{{ message }}"
   - delay: "{{ delay }}"
   - service: linkplay.restore
     data_template:
       entity_id: "{{ entity_id }}"

from home-assistant-custom-components-linkplay.

nagyrobi avatar nagyrobi commented on July 19, 2024

Please grab the component from the testing branch and see if it fixes your problem.

from home-assistant-custom-components-linkplay.

AThomsen avatar AThomsen commented on July 19, 2024

Doesn't seem to make any difference. I guess you tried to make it power on when calling snapshot?

from home-assistant-custom-components-linkplay.

nagyrobi avatar nagyrobi commented on July 19, 2024

Yes there's a similar situation when you're on a Line-In source, it takes time for the speaker to switch to network stream source (which TTS is) and you get first part of audio cut off in that case. It fades out and in etc. Needs some fiddling with delays to properly handle this.

Unfortunately I don't have such a device at hand, which is able to turn off by itself and needs wake up, so I can't do thorough tests.

I was about to suggest to play a silence file first but I see that you already thought about that. I could suggest to store your 1-second-of-silence.mp3 on hass server itself, so that the player doesn't need to reach outside on the internet just for that.

from home-assistant-custom-components-linkplay.

AThomsen avatar AThomsen commented on July 19, 2024

Yes, it was just to make a POC.

Let's close this for now. I'll let you know if I figure something out.

from home-assistant-custom-components-linkplay.

ant0nwax avatar ant0nwax commented on July 19, 2024

I am happy to help testing on my speakers DOSS Cloufox A1, FW 3.6 who do not appear on the wifi router if they are turned off, i guess there is no Wake On WiFi possible here?

from home-assistant-custom-components-linkplay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.