nindtendo / homeassistant_gradual_volume_control Goto Github PK
View Code? Open in Web Editor NEWHome Assistant integration providing a service to gradually change the volume of media_players over a given timespan.
Home Assistant integration providing a service to gradually change the volume of media_players over a given timespan.
Hi,
First of all I'd like to say "thank you" for this useful component! I had a workaround with several "volume_set" and "delay" commands in a sequence which I can ditch now in favour of this component.
Nevertheless I remarked that the component throws an exception when I try to apply grad_vol.set_volume
to a media player in status "off" (since it does not hold an attribute volume_level
I suppose)...
Would be nice if the component could catch this exception and just ignore media players w/o volume_level.
Cheers,
Tim
websocket_api script: Error executing script. Unexpected error for call_service at pos 1: float() argument must be a string or a real number, not 'NoneType'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 468, in _async_step
await getattr(self, handler)()
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 704, in _async_call_service_step
response_data = await self._async_run_long_action(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 666, in _async_run_long_action
return long_task.result()
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 1969, in async_call
response_data = await coro
^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/core.py", line 2013, in _execute_service
return await self._hass.async_add_executor_job(target, service_call)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/grad_vol/init.py", line 13, in handle_set_volume
volume = round(float(hass.states.get(entity_id).attributes.get('volume_level')),2)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: float() argument must be a string or a real number, not 'NoneType'
gradually change volume of a speaker over a given time
repo:homeassistant_gradual_volume_control
When I try to call service in Node-RED I get an API error.
debug log:
sent data : msg :
object
domain: "grad_vol"
service: "set_volume"
data: object
volume: 0.5
duration: 10
entity_id: "media_player.whole_house"
Is there a way to use "grad_vol" via Node-RED?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.