Hi there!
I’m starting to make some automation to control some part of my A/V receiver.
One particular command is not working.
The ‘Get Cinema Subwoofer Level’ but ‘Set Cinema Subwoofer Level’ isn’t working.
However, when I hit manually the rest command after changing the value of the input select, it’s working.
I guess it should be a problem with the condition in my automation but I can’t get it.
Can someone help??
Automation:
- alias: 'Set Cinema Subwoofer Level'
trigger:
- platform: state
entity_id: input_number.cinema_amp_sub_level
condition:
- condition: template
value_template: "{{ states('input_number.cinema_subwoofer_level') != states('sensor.cinema_amp_sub_level') }}"
- condition: template
value_template: "{{ states('input_number.cinema_subwoofer_level') not in ['unknown', 'None', 'unavailable'] }}"
action:
- service: rest_command.set_cinema_subwoofer_level
- alias: 'Get Cinema Subwoofer Level'
trigger:
- platform: state
entity_id: sensor.cinema_amp_sub_level
- platform: state
entity_id: media_player.salon_main
- platform: state
entity_id: sensor.cinema_amp
condition:
- condition: template
value_template: "{{ states('sensor.cinema_amp_sub_level') != states('input_number.cinema_subwoofer_level') }}"
- condition: template
value_template: "{{ states('sensor.cinema_amp_sub_level') not in ['unknown', 'None', 'unavailable'] }}"
action:
- service: input_number.set_value
data:
entity_id: input_number.cinema_subwoofer_level
value: "{{ states('sensor.cinema_amp_sub_level')|float }}"
Sensor:
- platform: rest
name: Cinema Amp Sub level
resource: http://IP-RECEIVER/YamahaRemoteControl/ctrl
method: POST
payload: '<YAMAHA_AV cmd="GET"><Main_Zone><Basic_Status>GetParam</Basic_Status></Main_Zone></YAMAHA_AV>'
value_template: "{{ (value_json.YAMAHA_AV.Main_Zone.Basic_Status.Volume.Subwoofer_Trim.Val|float) / 10 }}"
scan_interval: 10
Input_number:
cinema_subwoofer_level:
name: Subwoofer Level
min: -6
max: 6
step: 0.5
unit_of_measurement: "dB"
icon: mdi:smoke-detector
rest_command:
set_cinema_subwoofer_level:
url: "http://IP-RECEIVER/YamahaRemoteControl/ctrl"
method: POST
payload: '<YAMAHA_AV cmd="PUT"><Main_Zone><Volume><Subwoofer_Trim><Val>{{ (states("input_number.cinema_subwoofer_level")|float * 10 )|int }}</Val><Exp>1</Exp><Unit>dB</Unit></Subwoofer_Trim></Volume></Main_Zone></YAMAHA_AV>'
1 post - 1 participant
Read full topic