Hi,
It is probably simple, but I can’t find the way how to display broadlink switches at the Frontend?
I can receive and send packet via Services page, but can’t display at frontend.
Regards
Robert
Check here:https://home-assistant.io/components/switch.broadlink/
switch:
- platform: broadlink
host: 10.0.0.200
mac: 'xx:xx:xx:xx:xx:xx'
switches:
table_lamps:
friendly_name: Table Lamps
command_on: 'sgCWAQogCiAeDAogCiAeDB4MHgwKIB4MCSEKIB4MHgwJIR4MCiAJIR4MHgwJIQkhCSEeDAkhHgweDAkhCZ8JIQkhHgwJIQkhHgweDB4MCSEeDAkhCSEeDB4MCSEeDAkhCSEeDB4MCSEJIQkhHgwJIR4MHgwJIQmfCSEJIR4MCSEJIR4MHgweDAkhHgwJIQkhHgweDAkhHgsKIAogHwweDAkhCSEJIR4MCSEeDB4MCSAKngogCiAfCwogCiEdDB8MHgwJIR0MCiEJIR4MHgsKIB4MCiAKIB4MHgwKIAogCiAeDQkgHgweDAogCZ8JIQkhHgwKIAogHwseDB4MCiAeDAogCiAeDB4MCiAeDAkhCiAeDB4MCiAKIAogHgwKIB4MHgwKIAmfCSEJIR4MCSEJIR4MHgweDAkhHgwJIQkhHgweDAkhHgwJIQkhHgweDAogCSEJIR4MCSEeDB4MCSAKnwkhCSEeDAkhCSEeDB4MHgwJIR4MCSEJIR4MHgwJIR4MCSEJIR0NHgwJIQkhCSEdDQkhHgweDAkABdwAAA=='
command_off: 'sgBGAgqfCSEJIR4MCSEJIR4LHwwJIB8MCSAfDB4MHgwJIR4MCSEeDAkgCiEJIAogHwwJIQkgHwsfDB4LCiAKnwkhCSAfCwogCiEeCx4NCSAfCwogHwweCx8MCSAfCwogHgwKIAogCiAKIB8LCiAKIB8LHgweDAogCp4KIAogHwsKIAogHgweDAogHgwKIB8LHgwfCwogHgwKIB8LCiAKIAogCiAeDAogCSEfCx4MHgwKIAmfCSEKIB4MCSEKIB4MHgwKIB4MCiAeDB4MHgwKIB4MCiAeDAogCSEKIAkhHgwKIAkhHgweDB4MCSAKnwkhCSEeDAogCSEeD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fCx8LHwsLHx8LHwsfCx8LHwsfCx8LCiAfCx8LHwsfCwsfCiAfAAXcAAAAAA=='
command_off: 'sgCIAQkhCSEeDAkhHgweDB4MCSAfDB4MHgsKIQkgCiEJIAogCiAfCx8LCiAfCwqeCiAKIB4MCiAKIB4MCiAKIAogHgwKIB8LHgweDAogHgweDB4MCiAKIAogCiAJIQogHgweDAogHgsKnwkhCSEeDAkhCSEeDAkgCiEJIR4MCSEeDB4MHgwJIR4MHgsfDAkhCSEJIAogCiAKIB8LHwsKIB8LCp4KIAogHgwKIAogHgwKIAogCSEeDAogHgweDB4MCiAeDB4MHgwKIAogCiAKIAkhCiAeDB4MCiAeCwqfCSEKIB4MCSAKIR4MCSAKIAogHwwJIB8LHgwfCwogHwweCx8LCiAKIAogCiAKIAogHgwfCwogHgwKngogCiAfCwogCiAeDAogCiAJIR4MCiAeDB4MHgwKIB4MHgweDAkhCiAJIQkhCSEJIR4LHwwJIR4LCp8JIQkhHgwJIAogHwwJIAogCiAfCwohHgsfCx4MCiAfCx8LHwsKIAogCiAKIAogCiAeDB4MCiAeAAXc'
tv_bedroom:
friendly_name: TV Bedroom
command_on: 'sgD0AAgKCQoILQgtCAsILQgLCC0ICwgKCC0ICwgtCAoJLQgsCQoILQgLCC0ICwgtCAoJLQgKCQoILQgtCAsICggtCSwJCggtCAsILQgLCC0ICwgKCC0ICwgtCC0ICgkKCC0JCQktCAoILggKCC0IAAFdCFwJCQktCC0ICgkKCC0JLAgLCC0ICgksCQoICwgtCC0ICwgtCAoJLQgKCAsILQgKCS0ICggtCC0ICwgtCAsILAkKCS0ICggtCAsICgktCCwJCggLCC0ILQgLCCwJCggtCAsJLAkKCAoJLQgKCSwJLAgLCAoILQkKCSwJCggtCAoJLAkABdwAAAAA'
command_off: 'sgB6AQgLCAoJLQgsCQsILQgKCC0ICwgKCS0HCwgtCAsILQgtCAoJLQgKCC0ICwgtCAsILQgKCQoILQgtCAsICggtCSwJCggtCAsILQgLCC0ICgkKCC0ICgktCAoILQgLCC0ICgktCAoILggKCC0IAAFdCFwICgguCC0HCwkKCC0ILQgKCSwJCggtCAsICggtCSwICwgtCQoILQgKCQoJLAkKCC0ICgguCC0ICggtCAsILQgLCC0ICwgtCAoICwgtCC0ICgkKCC0ILQgLCC0ICgguCAoJLAkKCAsILQgKCC4ICggtCAsILQgKCC0ICwgtCAoJLQcAAV0JXAgKCC0JLAkKCAoILQktCAoILQgLCC0ICgkKCC0ILQgLCC0ICwgtCAoJCQktCAoILggKCC0ILQgLCC0ICwgtBwsJLQcLCS0HCwgKCC4HLggKCAoJLQgtCAoILQkKCC0ICwgtCAsICgksCQoILQgKCS0ICggtCAsILQgKCS0ICggtCAAF3AAAAAAAAAAAAAAAAAAA'
fan_bedroom:
friendly_name: Bedroom Fan
command_on: 'sgAGAQosCAoJCggtCSwJCgksCQkJLAkKCQkJLQksCQoJLAkKCSwICgkKCSwJCggtCQkJLAksCQoJLAkKCSwJCgksCQoJLAgKCQoJLAksCQoJCQksCSwJCgksCQoJLAkKCSwJCggKCSwJCggtCSwJCQoJCSwJCgksCSwJCgkJCSwJAAFdCVsICgktCSsJCgkKCC0JLAkJCiwJCQksCQoJCQktCSwICwksCQoJLAgKCQoJLAkJCS0JCQksCSwJCgksCQoJLAkKCSwJCgkrCgkJCgksCSwJCgkJCSwJLAkKCSwJCggtCQoJLAkJCgkJLQgKCSwJLAkKCAoJLAkKCSwJLAkKCQkJLAkABdwAAA=='
command_off: 'sgGEAwksCQoJCQktCQkJLQgKCSwJLQgKCSwJCgksCQoJLAkKCSwJCgkJCSwJLQgKCQoJLAksCQoJLAkKCSsKCgksCQkJCgksCQoJLAkKCSwJCQktCQkJLQksCQkJCgksCQABXQlbCQoILQksCQoJCQksCS0ICgktCAoJLAkKCQoILQgtCQoJLAkKCC0JCgkJCSwJCgksCQoILQksCQoILQkKCCwKCgksCQoJKwoKCAoJLAksCQoJCQktCSwICwgsCQoJLAkLCC0JCQkKCSwJCgksCQkJLQgKCSwJCgksCSwJ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gBgAAABKZIUERMRFRAUEhMRFBEUERQQFTYTNhQ1FTYTNhQ2FDYTNhM3FBETEhQQFRATExM2EzYVERM2FDYUNhM2FDYUERQREwAFHAABJ0oTAAxOAAEnShMADE4AASlIFAANBQAAAAAAAAAA'
Thanks,
The problem is not how to write the configuration entry, which I did, but why I can’t see switch at the frontend.
Also, There is no entry at the States page.
Do you have any errors in your log? If the configuration entry is there, it should show in the front-end.
Yes I have error in log:
2017-05-31 20:32:36 ERROR (MainThread) [homeassistant.components.switch] Error while setting up platform broadlink
Traceback (most recent call last):
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/helpers/entity_component.py”, line 155, in _async_setup_platform
entity_platform.schedule_add_entities, discovery_info
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/components/switch/broadlink.py”, line 135, in setup_platform
device_config.get(CONF_COMMAND_OFF)
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/homeassistant/components/switch/broadlink.py”, line 161, in init
self._command_on = b64decode(command_on) if command_on else None
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/base64.py”, line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding
can you share your config?
Do you think, that problem is with config, not component?
Broadlink switches are currently working for me. My command_on and command_off fields get turned into switches on my home assistant dashboard (albiet it is a bit messy)
switch:
#Smart in-wall lightswitch
- platform: tplink
host: 192.168.1.13
name: "Porch Light"
#Magic Packet WOL for HTPC
- platform: wake_on_lan
name: 'Wake TV PC'
mac_address: "(removed for forum privacy)"
host: 192.168.1.4
#Broadlink "RM mini 3" IR Transciever
- platform: broadlink
# type: rm_mini
timeout: 15
host: 192.168.1.12
mac: '(removed for forum privacy)'
switches:
ac_power:
friendly_name: "AC Power"
command_on: 'JgBoAAABJJQSNxETEhMRExITERMSExE4ERMSNxI3EhMRExI3EjgRExE4EhMRExITERMSExETEjcSExE4ETgROBE4ETgROBITEQAFZgABI0sRAAxAAAEjSxEADD8AASRKEgAMPwABI0sRAA0F'
command_off: 'JgBoAAABJJQSNxETEhMRExITERMSExE4ERMSNxI3EhMRExI3EjgRExE4EhMRExITERMSExETEjcSExE4ETgROBE4ETgROBITEQAFZgABI0sRAAxAAAEjSxEADD8AASRKEgAMPwABI0sRAA0F'
ac_temp_up:
friendly_name: "AC Temp Up"
command_on: 'JgBYAAABJpEUNRQRFBAUERQRExEUERM2ExEUNRQ1FBETERQ1FDUUERM2FBAUNRQRFBAUERQREzYTERQ1FBETNhM2EzYTNhMRFAAFZAABJUkTAAw9AAEmSBQADQU='
ac_temp_down:
friendly_name: "AC Temp Down"
command_on: 'JgBQAAABJZIUNRQRExEUERMRFBETERQ1FBETNhQ1FBETERQ1FDUUERMRFDUUERM2ExEUERMRFDUUNhMRFDUUERM2EzYTNhMRFAAFZAABJUkTAA0FAAAAAAAAAAA='
ac_fan_speed:
#Cycles through three available fan speeds when pressed repeatedly
friendly_name: "AC Fan Speed"
command_on: 'JgBQAAABJZIUNRQRExEUERMRFBEUERM2ExEUNRQ1FBETERQ1FDUUERM2ExEUERQ1FDUUERMRFDUUERM2EzYTERQREzYTNhMRFAAFZAABJUkTAA0FAAAAAAAAAAA='
ac_mode:
friendly_name: "AC Mode"
command_on: 'JgCAAAABJpEUNhMRFBETERQRExEUERM2ExEUNRQ1FBETERQ1FDYTERQ1FDUUERM2EzYTERQREzYTERQREzYTEhMREzYTNhMSEwAFYwABJkkUAAw9AAElSRMADD4AASVJEwAMPgABJUkTAAw9AAEmSRMADD0AASZIFAAMPQABJkgUAA0FAAAAAAAAAAA='
ac_timer:
#Timer goes up to 24 when pressed repeatedly
friendly_name: "AC Timer"
command_on: 'JgB4AAABJZEUNhMRFBETERQRExEUERM2ExEUNRQ1FBETEhM2EzYTERQ1FDUUNRQ1FDUUERMRFDUUERQRExEUERMRFDUUNRQREwAFZQABJUgUAAw8AAEmSRMADD0AASZJEwAMPQABJkgUAAw9AAElSRMADD4AASVIFAANBQ=='
livingroom_stereo_power:
friendly_name: "Livingroom Stereo Power"
command_on: 'JgCoAFASKBIWESkRFhEpEhUSFhEWERYRFhIVEigAA0tQEikRFhIoEhUSKREVEhUTFRIVEhUSFRMnAANMTxMoEhUSKBIVEygSFRIVEhUTFBMVEhUSKAADTE8TJxMVEigSFRIoExQTFRIVEhUSFRMVEigAA0tPEygSFRMoEhUSKREWERYSFRIWERYRFhEpAANLUBIoEhYRKREWEigSFhEWERYRFhIVEhYRKQANBQ=='
command_off: 'JgCoAFASKBIWESkRFhEpEhUSFhEWERYRFhIVEigAA0tQEikRFhIoEhUSKREVEhUTFRIVEhUSFRMnAANMTxMoEhUSKBIVEygSFRIVEhUTFBMVEhUSKAADTE8TJxMVEigSFRIoExQTFRIVEhUSFRMVEigAA0tPEygSFRMoEhUSKREWERYSFRIWERYRFhEpAANLUBIoEhYRKREWEigSFhEWERYRFhIVEhYRKQANBQ=='
livingroom_stereo_vol_up:
friendly_name: "Livingroom Stereo Vol Up"
command_on: 'JgCMAE8TFRIoEhUSFRMoEhUSFRIVExQTFRIVEigAA19PEhUTKBIVEhUSKBMUExUSFRIVEhUTFBMoAANeTxMVEigTFBMVEigSFRIVExQTFRIVEhUSKAADX08TFBMoEhQTFRMnExQTFRIUExQUFBMUEygAA19PEhUTJxMVEhUSKBIVExQTFRIVEhUTFBMnAA0FAAAAAAAAAAAAAAAA'
livingroom_stereo_vol_down:
friendly_name: "Livingroom Stereo Vol Down"
command_on: 'JgCMAFASKBMoEhUSFRIoEhUTFBMVEhUSFRIVEygAA0tPEygSKBIVExUSKBIVEhUSFRMVEhUSFRIoAANMTxMoEigSFRIVEigTFRIVEhUSFRMUExUSKAADS1ASKBMnExUSFRIoEhUTFBMVEhUSFRIUFCgAA0tPEygSKBIVExUSKBIVEhUSFRMVEhUSFRIoAA0FAAAAAAAAAAAAAAAA'
livingroom_stereo_bass:
friendly_name: "Livingroom Stereo Bass Boost"
command_on: 'JgCqAE8TKBIVEigTJxMVEhUSKBIVExQTFRIVEigSFRMVEigAArBPEygSFRIoEigSFRMUEygSFRIVEhUTFRIoEhUSFRMnAAKwUBIoExQTKBIoEhUSFRMnExUSFRIVEhUTKBIVEhUSKAACsE8TKBIVEigTJxMVEhUSKBIVExQTFRIVEigSFRMVEigAArBPEygSFRIoEigSFRMVEigSFRIVEhUTFRIoEhUSFRMnAA0FAAAAAAAAAAAAAAAAAAA='
Here my config
- platform: broadlink
host: 192.168.1.8
mac: 'xxxxxxxx'
name: 'bedroom'
timeout: 200
switches:
led_red:
friendly_name: "Red LED"
command_on: 'JgBQAAABJ5QSExEUERQRFBIUERMSFBEUETgROBI4ETgRFBE4EjgROBEUERQSNxIUERQRFBEUERQROBI4ERQROBE4EjgROBE4EgAFQgABJkoSAA0FAAAAAAAAAAA='
command_off: 'JgBYAAABJ5QUERMSEhQSExITEhMSExMSEzcSNxI3EjgRFBI3EzcSNxITEjgRFBEUERQSExITExISOBITETgTNxE4EjcTNxE4EgAFQgABJ0oSAAxQAAEmShIADQU='
blue_led:
friendly_name: "Blue Led"
command_on: 'JgBQAAABJ5QTExITERQSExITERQSExMSEzcROBE4EzcSExE4EzYTNxEUEjcSOBEUEhMSExITERQSNxIUERQSNxI3EjgSNxI3EgAFQgABKEkSAA0FAAAAAAAAAAA='
command_off: 'JgBQAAABJ5QTExITERQSExITERQSExMSEzcROBE4EzcSExE4EzYTNxEUEjcSOBEUEhMSExITERQSNxIUERQSNxI3EjgSNxI3EgAFQgABKEkSAA0FAAAAAAAAAAA='
green_led:
friendly_name: "Green LED"
command_on: 'JgBYAAABJ5USExITEhMSExMSEhQRFBEUEjcTNxI3EjcTExE4EjcTNxI3EhMSNxMTERQRFBITEhMSExI4EhMSNxM3EjcSNxM3EQAFQwABJ0oSAAxQAAEnShIADQU='
command_off: 'JgBQAAABJJMSEhISETgSEhITEBMSEhMSETcSNxMREjcSNxI3EjcSOBETERITNhM2EhITERM2EzcRNxI3ExISEhI3EjcRExETEgAFLQABJEoRAA0FAAAAAAAAAAA='
light1_livingroom:
friendly_name: "Livingroom Down Lights"
command_on: 'slA0AA0iDSINIg0iDSIkCw0iJAsNIg0iDSINIg0iDSINIiQLDSINIg0iJAsNIiQLDSIkCw0AAUUAAAAA='
command_off: 'sjc0AA0iDSINIg0iDCMkCw0iJAsNIg0iDSINIg0iDSINIiMLDSINIg0iJAsNIiQLDSINIg0AAUUAAAAA='
livingroom_led_power:
friendly_name: "Livingroom LED Power"
command_on: 'slE0AA0jDCINIw0jDSIkDA0iJAwNIyQMDSINIg0iDSINIiQMDCMNIw0iJAwNIyQMDSIkDAwAAUQAAAAA='
command_off: 'sk00AAwjDSMNIwwjDCMjDAwjIwwMIyMMDCMMIwwjDCMMIyMMDCMNIwwjIwwNIyQMDCMMIwwAAUUAAAAA='
kitchen_led_power:
friendly_name: "Kitchen LED Power"
command_on: 'slE0AA0iDSINIg0iDSIkCw0iJAwNIw0iDSMkCw0jDSMNIiQMDSMNIg0iJAsNIiQLDSIkDA0AAUUAAAAA='
command_off: 'sjs0AAwjDCMNIw0jDCMkDA0jIwwMIwwjDCMjDAwjDCMMIyMMDCMMIwwjIwwMIyMMDCMMIwwAAUUAAAAA='
This is my config. I had same problem all i did was add = <- Equals symbol to end of each command on and command off and then the switches would show up in my frontend.
I was organizing my IR buttons into scripts so that they wouldn’t be switches and I realized you might be able to bypass the whole “switches not showing up” thing if you ran scripts using the “send_packet” command example from the broadlink component page.
script:
tv_select_source:
sequence:
- service: broadlink.send_packet_192_168_0_107
data:
packet:
- "JgCMAJSSFDYUNhQ2FBEUERQRFBEUERQ2FDYUNhQRFBEUERQRFBEUERQRFDYUERQRFBEUERQRFDYUNhQRFDYUNhQ2FDYUNhQABfWUkhQ2FDYUNhQRFBEUERQRFBEUNhQ2FDYUERQRFBEUERQRFBEUERQ2FBEUERQRFBEUERQ2FDYUERQ2FDYUNhQ2FDYUAA0FAAAAAAAAAAAAAAAA"
I wanted to clean up my IR blaster HASS dashboard buttons anyway by making scripts to trigger the switches, since I think it looks nicer. If you want to try that, read on – if not, no worries I just got excited and wanted to post my setup below:
=======================================
Making broadlink switches into grouped scripts:
Code for my switches (re-posted with new variable names):
switch:
#Broadlink "RM mini 3" IR Transciever
- platform: broadlink
# type: rm_mini
timeout: 15
host: 192.168.1.12
mac: '34:EA:34:B2:F0:E5'
switches:
ac_power:
friendly_name: "AC Power"
command_on: 'JgBoAAABJJQSNxETEhMRExITERMSExE4ERMSNxI3EhMRExI3EjgRExE4EhMRExITERMSExETEjcSExE4ETgROBE4ETgROBITEQAFZgABI0sRAAxAAAEjSxEADD8AASRKEgAMPwABI0sRAA0F'
command_off: 'JgBoAAABJJQSNxETEhMRExITERMSExE4ERMSNxI3EhMRExI3EjgRExE4EhMRExITERMSExETEjcSExE4ETgROBE4ETgROBITEQAFZgABI0sRAAxAAAEjSxEADD8AASRKEgAMPwABI0sRAA0F'
ac_temp_up:
friendly_name: "AC Temp Up"
command_on: 'JgBYAAABJpEUNRQRFBAUERQRExEUERM2ExEUNRQ1FBETERQ1FDUUERM2FBAUNRQRFBAUERQREzYTERQ1FBETNhM2EzYTNhMRFAAFZAABJUkTAAw9AAEmSBQADQU='
ac_temp_down:
friendly_name: "AC Temp Down"
command_on: 'JgBQAAABJZIUNRQRExEUERMRFBETERQ1FBETNhQ1FBETERQ1FDUUERMRFDUUERM2ExEUERMRFDUUNhMRFDUUERM2EzYTNhMRFAAFZAABJUkTAA0FAAAAAAAAAAA='
ac_fan_speed:
#Cycles through three available fan speeds when pressed repeatedly
friendly_name: "AC Fan Speed"
command_on: 'JgBQAAABJZIUNRQRExEUERMRFBEUERM2ExEUNRQ1FBETERQ1FDUUERM2ExEUERQ1FDUUERMRFDUUERM2EzYTERQREzYTNhMRFAAFZAABJUkTAA0FAAAAAAAAAAA='
ac_mode:
friendly_name: "AC Mode"
command_on: 'JgCAAAABJpEUNhMRFBETERQRExEUERM2ExEUNRQ1FBETERQ1FDYTERQ1FDUUERM2EzYTERQREzYTERQREzYTEhMREzYTNhMSEwAFYwABJkkUAAw9AAElSRMADD4AASVJEwAMPgABJUkTAAw9AAEmSRMADD0AASZIFAAMPQABJkgUAA0FAAAAAAAAAAA='
ac_timer:
#Timer goes up to 24 when pressed repeatedly
friendly_name: "AC Timer"
command_on: 'JgB4AAABJZEUNhMRFBETERQRExEUERM2ExEUNRQ1FBETEhM2EzYTERQ1FDUUNRQ1FDUUERMRFDUUERQRExEUERMRFDUUNRQREwAFZQABJUgUAAw8AAEmSRMADD0AASZJEwAMPQABJkgUAAw9AAElSRMADD4AASVIFAANBQ=='
livingroom_amp_power:
friendly_name: "Livingroom Amp Power"
command_on: 'JgCoAFASKBIWESkRFhEpEhUSFhEWERYRFhIVEigAA0tQEikRFhIoEhUSKREVEhUTFRIVEhUSFRMnAANMTxMoEhUSKBIVEygSFRIVEhUTFBMVEhUSKAADTE8TJxMVEigSFRIoExQTFRIVEhUSFRMVEigAA0tPEygSFRMoEhUSKREWERYSFRIWERYRFhEpAANLUBIoEhYRKREWEigSFhEWERYRFhIVEhYRKQANBQ=='
command_off: 'JgCoAFASKBIWESkRFhEpEhUSFhEWERYRFhIVEigAA0tQEikRFhIoEhUSKREVEhUTFRIVEhUSFRMnAANMTxMoEhUSKBIVEygSFRIVEhUTFBMVEhUSKAADTE8TJxMVEigSFRIoExQTFRIVEhUSFRMVEigAA0tPEygSFRMoEhUSKREWERYSFRIWERYRFhEpAANLUBIoEhYRKREWEigSFhEWERYRFhIVEhYRKQANBQ=='
livingroom_amp_vol_up:
friendly_name: "Livingroom Amp Vol Up"
command_on: 'JgCMAE8TFRIoEhUSFRMoEhUSFRIVExQTFRIVEigAA19PEhUTKBIVEhUSKBMUExUSFRIVEhUTFBMoAANeTxMVEigTFBMVEigSFRIVExQTFRIVEhUSKAADX08TFBMoEhQTFRMnExQTFRIUExQUFBMUEygAA19PEhUTJxMVEhUSKBIVExQTFRIVEhUTFBMnAA0FAAAAAAAAAAAAAAAA'
livingroom_amp_vol_down:
friendly_name: "Livingroom Amp Vol Down"
command_on: 'JgCMAFASKBMoEhUSFRIoEhUTFBMVEhUSFRIVEygAA0tPEygSKBIVExUSKBIVEhUSFRMVEhUSFRIoAANMTxMoEigSFRIVEigTFRIVEhUSFRMUExUSKAADS1ASKBMnExUSFRIoEhUTFBMVEhUSFRIUFCgAA0tPEygSKBIVExUSKBIVEhUSFRMVEhUSFRIoAA0FAAAAAAAAAAAAAAAA'
livingroom_amp_bass_boost_eq:
friendly_name: "Livingroom Amp Bass Boost EQ"
command_on: 'JgCqAE8TKBIVEigTJxMVEhUSKBIVExQTFRIVEigSFRMVEigAArBPEygSFRIoEigSFRMUEygSFRIVEhUTFRIoEhUSFRMnAAKwUBIoExQTKBIoEhUSFRMnExUSFRIVEhUTKBIVEhUSKAACsE8TKBIVEigTJxMVEhUSKBIVExQTFRIVEigSFRMVEigAArBPEygSFRIoEigSFRMVEigSFRIVEhUTFRIoEhUSFRMnAA0FAAAAAAAAAAAAAAAAAAA='
I made scripts to trigger my switches, so that there’s an “activate” button instead of toggles or on/off buttons. You could just do the send_packet thing here instead.
script:
#These IR scripts are written so that HASS dashboard will display a one-shot "activate" button for these 'dumbfire' IR blasts (instead of a displaying a toggle for a smartdevice, which would falsely imply a known state of on/off for each action)
ac_temp_up:
sequence:
- service: switch.turn_on
entity_id: switch.ac_temp_up
ac_temp_down:
sequence:
- service: switch.turn_on
entity_id: switch.ac_temp_down
ac_fan_speed:
sequence:
- service: switch.turn_on
entity_id: switch.ac_fan_speed
ac_mode:
sequence:
- service: switch.turn_on
entity_id: switch.ac_mode
ac_timer:
sequence:
- service: switch.turn_on
entity_id: switch.ac_timer
livingroom_amp_vol_up:
sequence:
- service: switch.turn_on
entity_id: switch.livingroom_amp_vol_up
livingroom_amp_vol_down:
sequence:
- service: switch.turn_on
entity_id: switch.livingroom_amp_vol_down
livingroom_amp_bass_boost_eq:
sequence:
- service: switch.turn_on
entity_id: switch.livingroom_amp_bass_boost_eq
Bonus round: Customize icons + hide any extra unused switches:
customize:
switch.ac_power:
friendly_name: "Power"
icon: mdi:power
assumed_state: false
script.ac_temp_up:
friendly_name: "Temp up"
icon: mdi:thermometer-lines
script.ac_temp_down:
friendly_name: "Temp down"
icon: mdi:snowflake
script.ac_fan_speed:
friendly_name: "Fan speed"
icon: mdi:fan
script.ac_mode:
friendly_name: "Mode"
icon: mdi:settings-box
script.ac_timer:
friendly_name: "Timer"
icon: mdi:av-timer
switch.livingroom_amp_power:
friendly_name: "Power"
icon: mdi:power
assumed_state: false
script.livingroom_amp_vol_up:
friendly_name: "Vol up"
icon: mdi:volume-plus
script.livingroom_amp_vol_down:
friendly_name: "Vol down"
icon: mdi:volume-minus
script.livingroom_amp_bass_boost_eq:
friendly_name: "Bass boost EQ"
icon: mdi:speaker-wireless
#Hidden items
switch.ac_temp_up:
icon: mdi:thermometer-lines
assumed_state: false
hidden: true
switch.ac_temp_down:
icon: mdi:snowflake
assumed_state: false
hidden: true
switch.ac_fan_speed:
icon: mdi:fan
assumed_state: false
hidden: true
switch.ac_mode:
icon: mdi:settings-box
assumed_state: false
hidden: true
switch.ac_timer:
icon: mdi:av-timer
assumed_state: false
hidden: true
switch.livingroom_amp_vol_up:
icon: mdi:volume-plus
assumed_state: false
hidden: true
switch.livingroom_amp_vol_down:
icon: mdi:volume-minus
assumed_state: false
hidden: true
switch.livingroom_amp_bass_boost_eq:
icon: mdi:speaker-wireless
assumed_state: false
hidden: true
[quote=“robertpe, post:5, topic:18895”]
File “/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/base64.py”, line 87, in b64decode
return binascii.a2b_base64(s)
binascii.Error: Incorrect padding[/quote]
[quote=“aimwarlock, post:9, topic:18895”]
I had same problem all i did was add = … Equals symbol to end of each command on and command off and then the switches would show up in my frontend.[/quote]
I may have gotten carried away. I re-read your post and it sounds like there could be a problem with the formatting of your capture code? Try capturing some new codes and ensure they’re in base64 ? (you already mentioned you found the capture service via: HomeAssistant > Developer Tools > Services > “Domain:” broadlink , “Service:” learn_command_192_168_1_xx , but just making sure you’re using that one).
Another thing it could be: I learned by accident that variables cannot have capital letters in them. Maybe try changing “thing”/“item”/“variable” names, like CONF_COMMAND_OFF, to lowercase.
I’d like to see your code too
How did you get your A/C power & livingroom speaker amp power controls to be toggles instead of the default lightning bolts?
I don’t see any icon customizations for those.
It’s all here…
RTFM as they say
Good question!
Hm, I can’t remember, but here’s all my code including groups and views if that helps (see All IR Blaster Code: below). I forgot to post the groups and views code above, so maybe the fact that I’ve grouped them makes HASS do this slider action instead of lightning bolts? It may also be by action of the assumed_state: false
setting under each switch’s homeassistant: customize:
custom display field.
A note on making single-shot “ACTIVATE” buttons though (I accidentally wrote this paragraph and then realized you probably meant those jelly bean sliders, not the activate buttons, and I also realized I already wrote about this haha, but I’m just gonna post this info anyway since this time I wrote a cleaner post): Since the broadlink creates a switch for every IR command (one command is the “on” switch, another command or the same command can be the “off” side of the switch), I created separate scripts that trigger the “on” of each Broadlink-made switch. It’s redundant code, and cumbersome to implement. I wish the Broadlink component had an easier workaround for this (I know you can just create scripts that fire IR codes, but I like to see all variable collected under the Broadlink component in my YAML, so I still use the switches).
.
Sample code for one-shot buttons that say “ACTIVATE”:
homeassistant:
customize:
script.ac_temp_up:
friendly_name: "Temp up"
switch:
- platform: broadlink
# type: rm_mini
timeout: 15
host: 192.168.1.12
mac: 'xx:xx:xx:xx:xx:xx'
switches:
ac_temp_up:
friendly_name: "AC Temp Up"
command_on: 'JgBYAAABJpEUNRQRFBAUERQRExEUERM2ExEUNRQ1FBETERQ1FDUUERM2FBAUNRQRFBAUERQREzYTERQ1FBETNhM2EzYTNhMRFAAFZAABJUkTAAw9AAEmSBQADQU====='
script:
ac_temp_up:
sequence:
- service: switch.turn_on
entity_id: switch.ac_temp_up
group:
ac_remote:
name: "Air Conditioner"
control: hidden
entities:
- switch.ac_power
- script.ac_temp_up
- script.ac_temp_down
- script.ac_fan_speed
- script.ac_mode
- script.ac_timer
.
All IR Blaster Code:
homeassistant:
customize:
#AC Unit button names & icons
switch.ac_power:
friendly_name: "Power"
icon: mdi:power
assumed_state: false
script.ac_temp_up:
friendly_name: "Temp up"
icon: mdi:thermometer-lines
script.ac_temp_down:
friendly_name: "Temp down"
icon: mdi:snowflake
script.ac_fan_speed:
friendly_name: "Fan speed"
icon: mdi:fan
script.ac_mode:
friendly_name: "Mode"
icon: mdi:settings-box
script.ac_timer:
friendly_name: "Timer"
icon: mdi:av-timer
#Livingroom Stereo Amp button names & icons
switch.livingroom_amp_power:
friendly_name: "Power"
icon: mdi:power
assumed_state: false
script.livingroom_amp_vol_up:
friendly_name: "Vol up"
icon: mdi:volume-plus
script.livingroom_amp_vol_down:
friendly_name: "Vol down"
icon: mdi:volume-minus
script.livingroom_amp_bass_boost_eq:
friendly_name: "Bass boost EQ"
icon: mdi:speaker-wireless
#Hidden items
switch.wakeup_the_broadlink:
hidden: true
switch.ac_temp_up:
icon: mdi:thermometer-lines
assumed_state: false
hidden: true
switch.ac_temp_down:
icon: mdi:snowflake
assumed_state: false
hidden: true
switch.ac_fan_speed:
icon: mdi:fan
assumed_state: false
hidden: true
switch.ac_mode:
icon: mdi:settings-box
assumed_state: false
hidden: true
switch.ac_timer:
icon: mdi:av-timer
assumed_state: false
hidden: true
switch.livingroom_amp_vol_up:
icon: mdi:volume-plus
assumed_state: false
hidden: true
switch.livingroom_amp_vol_down:
icon: mdi:volume-minus
assumed_state: false
hidden: true
switch.livingroom_amp_bass_boost_eq:
icon: mdi:speaker-wireless
assumed_state: false
hidden: true
script.ac_poweroff:
hidden: true
script.ac_poweron:
hidden: true
script.livingroom_amp_poweroff:
hidden: true
switch:
#Broadlink "RM mini 3" IR Transciever
- platform: broadlink
# type: rm_mini
timeout: 15
host: 192.168.1.12
mac: 'xx:xx:xx:xx:xx:xx'
switches:
wakeup_the_broadlink:
#Fire 0x00 as a dummy code. This will wake up the broadlink device if it hasn't been used in a six-ish or so hours. Otherwise codes do not seem to fire properly when waking up the house???
friendly_name: "Wakeup the Broadlink"
command_on: '================'
command_off: '================'
ac_power:
friendly_name: "AC Power"
command_on: 'JgBoAAABJJQSNxETEhMRExITERMSExE4ERMSNxI3EhMRExI3EjgRExE4EhMRExITERMSExETEjcSExE4ETgROBE4ETgROBITEQAFZgABI0sRAAxAAAEjSxEADD8AASRKEgAMPwABI0sRAA0F'
command_off: 'JgBoAAABJJQSNxETEhMRExITERMSExE4ERMSNxI3EhMRExI3EjgRExE4EhMRExITERMSExETEjcSExE4ETgROBE4ETgROBITEQAFZgABI0sRAAxAAAEjSxEADD8AASRKEgAMPwABI0sRAA0F'
ac_temp_up:
friendly_name: "AC Temp Up"
command_on: 'JgBYAAABJpEUNRQRFBAUERQRExEUERM2ExEUNRQ1FBETERQ1FDUUERM2FBAUNRQRFBAUERQREzYTERQ1FBETNhM2EzYTNhMRFAAFZAABJUkTAAw9AAEmSBQADQU====='
ac_temp_down:
friendly_name: "AC Temp Down"
command_on: 'JgBYAAABJpEUNRQRFBAUERQRExEUERM2ExEUNRQ1FBETERQ1FDUUERM2FBAUNRQRFBAUERQREzYTERQ1FBETNhM2EzYTNhMRFAAFZAABJUkTAAw9AAEmSBQADQU====='
ac_fan_speed:
#Cycles through three available fan speeds when pressed repeatedly
friendly_name: "AC Fan Speed"
command_on: 'JgBQAAABJZIUNRQRExEUERMRFBEUERM2ExEUNRQ1FBETERQ1FDUUERM2ExEUERQ1FDUUERMRFDUUERM2EzYTERQREzYTNhMRFAAFZAABJUkTAA0FAAAAAAAAAAA====='
ac_mode:
friendly_name: "AC Mode"
command_on: 'JgCAAAABJpEUNhMRFBETERQRExEUERM2ExEUNRQ1FBETERQ1FDYTERQ1FDUUERM2EzYTERQREzYTERQREzYTEhMREzYTNhMSEwAFYwABJkkUAAw9AAElSRMADD4AASVJEwAMPgABJUkTAAw9AAEmSRMADD0AASZIFAAMPQABJkgUAA0FAAAAAAAAAAA====='
ac_timer:
#Timer goes up to 24 when pressed repeatedly
friendly_name: "AC Timer"
command_on: 'JgB4AAABJZEUNhMRFBETERQRExEUERM2ExEUNRQ1FBETEhM2EzYTERQ1FDUUNRQ1FDUUERMRFDUUERQRExEUERMRFDUUNRQREwAFZQABJUgUAAw8AAEmSRMADD0AASZJEwAMPQABJkgUAAw9AAElSRMADD4AASVIFAANBQ=========='
livingroom_amp_power:
friendly_name: "Livingroom Amp Power"
command_on: 'JgCoAFASKBIWESkRFhEpEhUSFhEWERYRFhIVEigAA0tQEikRFhIoEhUSKREVEhUTFRIVEhUSFRMnAANMTxMoEhUSKBIVEygSFRIVEhUTFBMVEhUSKAADTE8TJxMVEigSFRIoExQTFRIVEhUSFRMVEigAA0tPEygSFRMoEhUSKREWERYSFRIWERYRFhEpAANLUBIoEhYRKREWEigSFhEWERYRFhIVEhYRKQANBQ=========='
command_off: 'JgCoAFASKBIWESkRFhEpEhUSFhEWERYRFhIVEigAA0tQEikRFhIoEhUSKREVEhUTFRIVEhUSFRMnAANMTxMoEhUSKBIVEygSFRIVEhUTFBMVEhUSKAADTE8TJxMVEigSFRIoExQTFRIVEhUSFRMVEigAA0tPEygSFRMoEhUSKREWERYSFRIWERYRFhEpAANLUBIoEhYRKREWEigSFhEWERYRFhIVEhYRKQANBQ=========='
livingroom_amp_vol_up:
friendly_name: "Livingroom Amp Vol Up"
command_on: 'JgCMAE8TFRIoEhUSFRMoEhUSFRIVExQTFRIVEigAA19PEhUTKBIVEhUSKBMUExUSFRIVEhUTFBMoAANeTxMVEigTFBMVEigSFRIVExQTFRIVEhUSKAADX08TFBMoEhQTFRMnExQTFRIUExQUFBMUEygAA19PEhUTJxMVEhUSKBIVExQTFRIVEhUTFBMnAA0FAAAAAAAAAAAAAAAA'
livingroom_amp_vol_down:
friendly_name: "Livingroom Amp Vol Down"
command_on: 'JgCMAFASKBMoEhUSFRIoEhUTFBMVEhUSFRIVEygAA0tPEygSKBIVExUSKBIVEhUSFRMVEhUSFRIoAANMTxMoEigSFRIVEigTFRIVEhUSFRMUExUSKAADS1ASKBMnExUSFRIoEhUTFBMVEhUSFRIUFCgAA0tPEygSKBIVExUSKBIVEhUSFRMVEhUSFRIoAA0FAAAAAAAAAAAAAAAA'
livingroom_amp_bass_boost_eq:
friendly_name: "Livingroom Amp Bass Boost EQ"
command_on: 'JgCqAE8TKBIVEigTJxMVEhUSKBIVExQTFRIVEigSFRMVEigAArBPEygSFRIoEigSFRMUEygSFRIVEhUTFRIoEhUSFRMnAAKwUBIoExQTKBIoEhUSFRMnExUSFRIVEhUTKBIVEhUSKAACsE8TKBIVEigTJxMVEhUSKBIVExQTFRIVEigSFRMVEigAArBPEygSFRIoEigSFRMVEigSFRIVEhUTFRIoEhUSFRMnAA0FAAAAAAAAAAAAAAAAAAA====='
script:
#These scripts are here so that HASS dashboard will display a one-shot "activate" button for these 'dumbfire' IR blasts (instead of a displaying a toggle for a smartdevice, which would falsely imply a known state of on/off for each action)
ac_temp_up:
sequence:
- service: switch.turn_on
entity_id: switch.ac_temp_up
ac_temp_down:
sequence:
- service: switch.turn_on
entity_id: switch.ac_temp_down
ac_fan_speed:
sequence:
- service: switch.turn_on
entity_id: switch.ac_fan_speed
ac_mode:
sequence:
- service: switch.turn_on
entity_id: switch.ac_mode
ac_timer:
sequence:
- service: switch.turn_on
entity_id: switch.ac_timer
livingroom_amp_vol_up:
sequence:
- service: switch.turn_on
entity_id: switch.livingroom_amp_vol_up
livingroom_amp_vol_down:
sequence:
- service: switch.turn_on
entity_id: switch.livingroom_amp_vol_down
livingroom_amp_bass_boost_eq:
sequence:
- service: switch.turn_on
entity_id: switch.livingroom_amp_bass_boost_eq
#These scripts are kludges for IR blasters since they will fire twice if "off" switch is triggered twice.
#This is a problem if the on/off signal are the same IR signal
ac_poweroff:
sequence:
#activate turn_off only if switch.ac_power is 'on'
- condition: template
value_template: >
{% if is_state('switch.ac_power', 'on') %}
true
{% elif is_state('switch.ac_power', 'off') %}
false
{% else %}
false
{% endif %}
- service: switch.turn_off
entity_id: switch.ac_power
ac_poweron:
sequence:
#activate turn_off only if switch.ac_power is 'on'
- condition: template
value_template: >
{% if is_state('switch.ac_power', 'off') %}
true
{% elif is_state('switch.ac_power', 'on') %}
false
{% else %}
false
{% endif %}
- service: switch.turn_on
entity_id: switch.ac_power
- service: switch.turn_on
entity_id: switch.ac_mode
livingroom_amp_poweroff:
sequence:
#activate turn_off only if switch.livingroom_amp_power is 'on'
- condition: template
value_template: >
{% if is_state('switch.livingroom_amp_power', 'on') %}
true
{% elif is_state('switch.livingroom_amp_power', 'off') %}
false
{% else %}
false
{% endif %}
- service: switch.turn_off
entity_id: switch.livingroom_amp_power
group:
ac_remote:
name: "Air Conditioner"
control: hidden
entities:
- switch.ac_power
- script.ac_temp_up
- script.ac_temp_down
- script.ac_fan_speed
- script.ac_mode
- script.ac_timer
#Air conditioner tab
hvac_view:
view: yes
name: AC
#name: T
entities:
- sensor.indoor_temp
- sensor.pws_temp_f
- sensor.pws_weather
- group.thermostat
- group.ac_remote
- group.sensor_node_1_card
- group.sensor_node_2_card
#Audio tab
audio_view:
view: yes
name: AUD
#name: Hz
entities:
- group.residence_radio
- group.livingroom_amp_remote
- switch.kitchen_speaker_amp
- switch.bathroom_speaker_amp
- group.chromecast_controls
Yes, it was the assumed_state: false that sets the display to the toggle. (thanks, @Bobby_Nobble)
But…
I ran into a situation (that I created another thread about) in which I set all the broadlink entities to assumed_state: false and all but one of them displayed the toggle afterwards. I’m not sure where the assumed_state: true was being set but it was listed in the entity attributes as true. I could force it to false there and the display changed to a toggle but as soon as I restarted HA it went right back to the two buttons again.
Someone suggested I put the assumed_state: false in the customize_glob: section for the desired switches and so far that has seemed to make it stick.
Still not sure why/where it was being set to true when none of the others were, tho.
Hi Wheezy,
really like your script and would like to learn more on creating group tab etc,
If you dont mind could you share the complete code? I just need to learn how to do some stuff… very nubie, however I manage to change to button thanks to your detail code.
TIA…
Hey, I’m glad it helped. I think you’re wondering how to create new tabs for your main HASS dashboard? Those tabs are called “Views”. “Groups” are basically cards on the dashboard. The “group:” area in your configuration.yaml file defines both groups and views.
I remember this being a difficult thing to learn when I was just starting too, since the terminology is so confusing. BRUH Automation’s YouTube channel helped me a lot. I recommend checking out Ben’s video here to get your started https://www.youtube.com/watch?v=EsBtyF5tZQ4&feature=youtu.be&t=8m11s
I’ll also copy-paste part the “group:” part of my configuration.yaml file below along with some images. Please let me know if that doesn’t answer the question though. (I’ve added some devices since I last posted my code, but the above code is also still implemented in my setup).
#####################################################################
# GROUPS & VIEWS #
#####################################################################
#Views are pages, selectable at the top of HASS dashboard. Groups are
# "display cards" that put many switches into the same box in a page
# of HASS dashboard.
####GROUPS
#group: !include groups.yaml
group:
zones:
name: Zones
entities:
- sensor.template_last_motion
- binary_sensor.floorplan
chromecast_controls:
name: Chromecast Controls
entities:
- media_player.all_home_speakers
- media_player.livingroom_speakers
- media_player.bedroom_speakers
- media_player.kitchen_speakers
- media_player.bathroom_speakers
livingroom_lights:
name: Livingroom
entities:
- light.livingroom_1
- light.livingroom_2
- light.livingroom_3
- light.livingroom_4
kitchen_lights:
name: Kitchen
entities:
- light.kitchen_1
- light.kitchen_2
kitchen_table_lights:
name: Kitchen Table
entities:
- light.kitchen_table_1
- light.kitchen_table_2
bedroom_lights:
name: Bedroom
entities:
- light.bedroom_1
- light.bedroom_2
bathroom_lights:
name: Bathroom
entities:
- light.bathroom_1
- light.bathroom_2
- light.bathroom_3
- light.bathroom_4
color_temperature:
name: Brightness / Temperature
entities:
- group.livingroom_lights
- group.kitchen_lights
- group.kitchen_table_lights
- light.hallway
- group.bathroom_lights
- group.bedroom_lights
tradfri_lights:
name: Lights
entities:
- light.livingroom
- light.kitchen
- light.bedroom
- light.bathroom
####VIEWS
#Default tab: If this is enabled, ONLY things defined here will show up in HASS main view!!!
default_view:
view: yes
entities:
#Dashboard gauges
- device_tracker.xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- sensor.indoor_temp
#- sensor.pws_temp_f
- sensor.dark_sky_temperature
- sensor.pollen_level
- sensor.pws_weather
#Things
- script.eggs_and_bakey
- script.bedtime
- automation.kodi_movie_mode_while_playing_media
- automation.kodi_house_mode_when_media_stops
- automation.powerup_on_arrival
- automation.powerdown_on_departure
- automation.porch_lit_on_arrival
- media_player.tv_pc
- media_player.ps4
- switch.scented_wax_warmer
#- switch.wake_tv_pc
- group.alarm
#Audio tab
audio_view:
view: yes
name: AUD
#name: Hz
entities:
- group.residence_radio
- group.livingroom_amp_remote
- group.bedroom_amp_remote
- switch.kitchen_speaker_amp
- switch.bathroom_speaker_amp
- group.chromecast_controls
- group.music_spotify
# Spotify media player only displays artwork of currently playing songs.
# It leaves the artwork up after Spotify is off. Also, no controls work (play/pause/stop/forward/back).
# Chromecast Audio works for displaying the same artwork and stopping play.
# - media_player.spotify
- switch.sound_machine
#Air conditioner tab
hvac_view:
view: yes
name: AC
#name: T
entities:
- sensor.livingroom_temp
- sensor.bedroom_temp
#- sensor.pws_temp_f
- sensor.dark_sky_temperature
- sensor.pws_weather
- group.thermostat
- group.ac_remote
- group.heater_remote
- group.sensor_node_1_card
- group.sensor_node_2_card
lights_view:
view: yes
name: LUX
#name: hν
entities:
- switch.fluxer
- switch.porch_light
- group.color_temperature
- group.tradfri_lights
Edit: Code error above … (the post is too old to edit at this point, but one IR command should be the following instead)
ac_temp_down:
friendly_name: "AC Temp Down"
command_on: 'JgBQAAABI5QSNxITERQRExITERMSExE4ERMSNxI3EhMRExI3EjcSExETEjcSExE4EhMRExITETgROBETEjcSExE4ETgSNxETEgAFZgABI0sRAA0FAAAAAAAAAAA====='
Thank you sooo much… you have been a great help…
Hi Wheezy!
First of all, I want to thank you for your help. The second is that I have a problem with the power switch, once it is in the ‘on’ state and restart home assistant, it returns to false status. I have tried many things but nothing. Does anything have to do with the recorder? I do not understand the scripts either ac_poweroff and ac_poweron.
I do not give with the key… thank you in advance!