I tried using your rotate code but got the following error:
2018-02-22 07:52:54 ERROR (MainThread) [homeassistant.core] Invalid service data for media_player.volume_set: value must be at least 0 for dictionary value @ data[‘volume_level’]. Got ‘-0.05’
2018-02-22 07:52:56 ERROR (MainThread) [homeassistant.core] Invalid service data for media_player.volume_set: value must be at least 0 for dictionary value @ data[‘volume_level’]. Got ‘-0.05’
what I think I need is to generate a volume_up command on a clockwise rotation and a volume_down on an anticlockwise rotation but I dont know how to do this. Would love some help please.
The + = clockwise and the - = anticlockwise in other words the cube generates a +ve number for clockwise and a -ve number for anticlockwise. So as it stands because the check is for > 0 then it’s generating a vol up for clockwise and vice versa. You may find that you need to change it to +/- 0.1 rather than 0.05, depends what the state table says, mine goes from 0 to 100% in steps of 10 but in HA it goes from 0.0 to 1 therefore I step it in 0.1 incements.
so would there be a way I can extract the >0 / <0 data from the cube to send a volume up / volume down command, rather than an increment to the volume attribute?
in the broadlink switch setup there is just switch.amp_volume which gets turned on for volume up and off for volume down… I suppose I could modify it to have two entities with only an ON command
The broadlink component doesnt have separate volume up and volume down commands though. It works likie switches with vol up being on and vol down being off. here is my .ini file for the amp
I cant seem to get the radio player to work. I have put everything in a package as per below. It shows up in the frontend and seems to fire the command if I hit activate, but nothing happens. no errors in the log. any ideas?
chromecast_radio.yaml (inside packages folder)
group:
radio:
name: Radio
entities:
- input_select.radio_station
- input_select.chromecast_radio
- script.radio
- input_number.volume_radio
input_select:
radio_station:
name: 'Select Radio Station:'
options:
- Hit 92-9
- Nova 93-7
- Mix 94-5
- 96FM
- 80's
- OldSkool Hits
- Raw FM (dance)
- 181FM Power (Todays Hits)
- 181FM 90's Dance
- 181FM Star 90's
- 181FM The Breeze
- Heat Radio (RnB)
- Fresh 92-7
- DI Chill & Tropical House
- DI Disco House
- DI Liquid D&B
initial: Raw FM (dance)
icon: mdi:radio
chromecast_radio:
name: 'Select Speakers:'
options:
- Lounge
- Bedroom
- House
initial: Lounge
icon: mdi:speaker-wireless
input_number:
volume_radio:
name: Volume
icon: mdi:volume-high
min: 0
max: 1
step: 0.05
automation:
- alias: Listen Radio
hide_entity: True
trigger:
- platform: state
entity_id: input_select.radio_station
action:
- service: script.radio
- alias: Set Chromecast Radio Volume
trigger:
platform: state
entity_id: input_number.volume_radio
action:
service: media_player.volume_set
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Lounge") %} media_player.lounge
{% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.bedroom
{% elif is_state("input_select.chromecast_radio", "House") %} media_player.house_group
{% endif %}
volume_level: '{{ states.input_number.volume_radio.state }}'
script:
radio:
alias: Play Radio on Chromecast Audio
sequence:
- service: media_player.volume_set
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Lounge") %} media_player.lounge
{% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.bedroom
{% elif is_state("input_select.chromecast_radio", "House") %} media_player.house_group
{% endif %}
volume_level: '{{ states.input_number.volume_radio.state }}'
- service: media_player.play_media
data_template:
entity_id: >
{% if is_state("input_select.chromecast_radio", "Lounge") %} media_player.lounge
{% elif is_state("input_select.chromecast_radio", "Bedroom") %} media_player.bedroom
{% elif is_state("input_select.chromecast_radio", "House") %} media_player.house_group
{% endif %}
media_content_id: >
{% if is_state("input_select.radio_station", "Hit 92-9") %} http://sc01.scahw.com.au/6ppm_32
{% elif is_state("input_select.radio_station", "Nova 93-7") %} http://streaming.novaentertainment.com.au/nova937
{% elif is_state("input_select.radio_station", "Mix 94-5") %} http://sc01.scahw.com.au/6mix_32
{% elif is_state("input_select.radio_station", "96FM") %} https://icy.ihrcast.arn.com.au/au_012_icy
{% elif is_state("input_select.radio_station", "80's") %} http://streaming.the80s.com.au/;stream/1
{% elif is_state("input_select.radio_station", "OldSkool Hits") %} http://sc01.scahw.com.au/loveland_32
{% elif is_state("input_select.radio_station", "Raw FM (dance)") %} http://stream.rawfm.com.au:8000/;stream.nsv
{% elif is_state("input_select.radio_station", "181FM Power (Todays Hits)") %} http://listen.181fm.com/181-power_128k.mp3?
{% elif is_state("input_select.radio_station", "181FM 90's Dance") %} http://listen.181fm.com/181-90sdance_128k.mp3
{% elif is_state("input_select.radio_station", "181FM Star 90's") %} http://listen.181fm.com/181-star90s_128k.mp3
{% elif is_state("input_select.radio_station", "181FM The Breeze") %} http://listen.181fm.com/181-breeze_128k.mp3
{% elif is_state("input_select.radio_station", "Heat Radio (RnB)") %} http://174.37.159.206:8106/stream
{% elif is_state("input_select.radio_station", "Fresh 92-7") %} http://live.fresh927.com.au/freshmp3
{% elif is_state("input_select.radio_station", "DI Chill & Tropical House") %} http://pub1.diforfree.org:8000/di_chillntropicalhouse_hi
{% elif is_state("input_select.radio_station", "DI Disco House") %} http://pub1.diforfree.org:8000/di_discohouse_hi
{% elif is_state("input_select.radio_station", "DI Liquid D&B") %} http://pub1.diforfree.org:8000/di_liquiddnb_hi
{% endif %}
media_content_type: 'audio/mp4'
You can check if you are using the right link by opening it in your browser, it should start playing immediately without having to press a play button.