Like many harmony users, i am preparing for the day that my latest harmony remote or tge hub conk out.
I have a programmable universal remote that i can use with a esp32 + ir receiver to capture the codes sent and then have scripts to change those into the correct ir code for that activity. My sonoff ir blaster will do the rest.
The complications i am struggling with are around the following:
-
If an activity uses more than one piece of hardware, such as the tv, a roku box and the speaker system, harmony is smart enough to recognise you have pressed the activity button more than once and scroll through each device on/off action for each press until everything is started correctly. This allows for unexpected initial status for any device. I am trying to work out if this logic can be easily coded and reusable for x numbers of devices. So i could pass in 2 or 3 hardware device names and then call the correct on/off actions for each device. If the on/off actions were via an On script and Off script for devices, how could i code the initial algorithm for the attempts at turning devices on and off to complwte the start activity?
-
I would also need to be able to mimic individual remote buttons for a specific device rather than a universal activity e.g. i may need to change general tv settings such as network details and this is outside of activities such as Watch Netflix so would want my universal remote to act like the tv remote only. I know this one is a little vague but i guess i would need text helpers to hold current activity and current device, if one is selected. The latter would have priority if populated i guess? And be set to blank if an activity button is pressed again? Hoping someone has done this type of stuff before me.
Esphome for ir receiver and universal buttons:
esphome:
name: irreceiver
friendly_name: IRReceiver
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: VERBOSE
# Enable Home Assistant API
api:
encryption:
key: !secret irreceiver_api_key
ota:
password: !secret irreceiver_ota_password
wifi:
networks:
- ssid: !secret wholehome_wifi_ssid
password: !secret wholehome_wifi_password
- ssid: !secret wifi_ssid
password: !secret wifi_password
- ssid: !secret garden_wifi_ssid
password: !secret garden_wifi_password
manual_ip:
static_ip: !secret irreceiver_ip
gateway: !secret wifi_gateway
dns1: !secret wifi_dns
subnet: !secret wifi_subnet
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Irreceiver Fallback Hotspot"
password: !secret irreceiver_wifi_ap_password
captive_portal:
remote_receiver:
pin:
number: GPIO14
inverted: True
dump: pioneer
binary_sensor:
- platform: remote_receiver
name: "HomeApp TV"
pioneer:
rc_code_1: !secret universal1_homeapp_tv
- platform: remote_receiver
name: "Mute TV"
pioneer:
rc_code_1: !secret universal1_mute_tv
- platform: remote_receiver
name: "Power TV"
pioneer:
rc_code_1: !secret universal1_power_tv
- platform: remote_receiver
name: "1 TV"
pioneer:
rc_code_1: !secret universal1_1_tv
- platform: remote_receiver
name: "2 TV"
pioneer:
rc_code_1: !secret universal1_2_tv
- platform: remote_receiver
name: "3 TV"
pioneer:
rc_code_1: !secret universal1_3_tv
- platform: remote_receiver
name: "4 TV"
pioneer:
rc_code_1: !secret universal1_4_tv
- platform: remote_receiver
name: "5 TV"
pioneer:
rc_code_1: !secret universal1_5_tv
- platform: remote_receiver
name: "6 TV"
pioneer:
rc_code_1: !secret universal1_6_tv
- platform: remote_receiver
name: "7 TV"
pioneer:
rc_code_1: !secret universal1_7_tv
- platform: remote_receiver
name: "8 TV"
pioneer:
rc_code_1: !secret universal1_8_tv
- platform: remote_receiver
name: "9 TV"
pioneer:
rc_code_1: !secret universal1_9_tv
- platform: remote_receiver
name: "0 TV"
pioneer:
rc_code_1: !secret universal1_0_tv
- platform: remote_receiver
name: "ChList TV"
pioneer:
rc_code_1: !secret universal1_chlist_tv
- platform: remote_receiver
name: "Arrows TV"
pioneer:
rc_code_1: !secret universal1_arrows_tv
- platform: remote_receiver
name: "Menu TV"
pioneer:
rc_code_1: !secret universal1_menu_tv
- platform: remote_receiver
name: "Source TV"
pioneer:
rc_code_1: !secret universal1_source_tv
- platform: remote_receiver
name: "Up TV"
pioneer:
rc_code_1: !secret universal1_up_tv
- platform: remote_receiver
name: "Down TV"
pioneer:
rc_code_1: !secret universal1_down_tv
- platform: remote_receiver
name: "Left TV"
pioneer:
rc_code_1: !secret universal1_left_tv
- platform: remote_receiver
name: "Right TV"
pioneer:
rc_code_1: !secret universal1_right_tv
- platform: remote_receiver
name: "OK TV"
pioneer:
rc_code_1: !secret universal1_ok_tv
- platform: remote_receiver
name: "Exit TV"
pioneer:
rc_code_1: !secret universal1_exit_tv
- platform: remote_receiver
name: "Text TV"
pioneer:
rc_code_1: !secret universal1_text_tv
- platform: remote_receiver
name: "VolUp TV"
pioneer:
rc_code_1: !secret universal1_volup_tv
- platform: remote_receiver
name: "VolDown TV"
pioneer:
rc_code_1: !secret universal1_voldown_tv
- platform: remote_receiver
name: "YouTuTV TV"
pioneer:
rc_code_1: !secret universal1_yoututv_tv
- platform: remote_receiver
name: "NetTV TV"
pioneer:
rc_code_1: !secret universal1_nettv_tv
- platform: remote_receiver
name: "P ChUp TV"
pioneer:
rc_code_1: !secret universal1_pchup_tv
- platform: remote_receiver
name: "P ChDown TV"
pioneer:
rc_code_1: !secret universal1_pchdown_tv
- platform: remote_receiver
name: "Rewind TV"
pioneer:
rc_code_1: !secret universal1_rewind_tv
- platform: remote_receiver
name: "Pause Play TV"
pioneer:
rc_code_1: !secret universal1_pauseplay_tv
- platform: remote_receiver
name: "Prev TV"
pioneer:
rc_code_1: !secret universal1_prev_tv
- platform: remote_receiver
name: "Stop TV"
pioneer:
rc_code_1: !secret universal1_stop_tv
- platform: remote_receiver
name: "Next TV"
pioneer:
rc_code_1: !secret universal1_next_tv
- platform: remote_receiver
name: "Blue TV"
pioneer:
rc_code_1: !secret universal1_blue_tv
- platform: remote_receiver
name: "Green TV"
pioneer:
rc_code_1: !secret universal1_green_tv
- platform: remote_receiver
name: "Yellow TV"
pioneer:
rc_code_1: !secret universal1_yellow_tv
- platform: remote_receiver
name: "Blue TV"
pioneer:
rc_code_1: !secret universal1_blue_tv
- platform: remote_receiver
name: "Info LR TV"
pioneer:
rc_code_1: !secret universal1_infolr_tv
- platform: remote_receiver
name: "EPG 3D TV"
pioneer:
rc_code_1: !secret universal1_epg3d_tv
- platform: remote_receiver
name: "USB Fav TV"
pioneer:
rc_code_1: !secret universal1_usbfav_tv
- platform: remote_receiver
name: "PM Zoom TV"
pioneer:
rc_code_1: !secret universal1_pmzoom_tv
- platform: remote_receiver
name: "SM Setup TV"
pioneer:
rc_code_1: !secret universal1_smsetup_tv
- platform: remote_receiver
name: "Guide Sleep TV"
pioneer:
rc_code_1: !secret universal1_guidesleep_tv
- platform: remote_receiver
name: "HomeApp BOX"
pioneer:
rc_code_1: !secret universal1_homeapp_box
- platform: remote_receiver
name: "Mute BOX"
pioneer:
rc_code_1: !secret universal1_mute_box
- platform: remote_receiver
name: "Power BOX"
pioneer:
rc_code_1: !secret universal1_power_box
- platform: remote_receiver
name: "1 BOX"
pioneer:
rc_code_1: !secret universal1_1_box
- platform: remote_receiver
name: "2 BOX"
pioneer:
rc_code_1: !secret universal1_2_box
- platform: remote_receiver
name: "3 BOX"
pioneer:
rc_code_1: !secret universal1_3_box
- platform: remote_receiver
name: "4 BOX"
pioneer:
rc_code_1: !secret universal1_4_box
- platform: remote_receiver
name: "5 BOX"
pioneer:
rc_code_1: !secret universal1_5_box
- platform: remote_receiver
name: "6 BOX"
pioneer:
rc_code_1: !secret universal1_6_box
- platform: remote_receiver
name: "7 BOX"
pioneer:
rc_code_1: !secret universal1_7_box
- platform: remote_receiver
name: "8 BOX"
pioneer:
rc_code_1: !secret universal1_8_box
- platform: remote_receiver
name: "9 BOX"
pioneer:
rc_code_1: !secret universal1_9_box
- platform: remote_receiver
name: "0 BOX"
pioneer:
rc_code_1: !secret universal1_0_box
- platform: remote_receiver
name: "ChList BOX"
pioneer:
rc_code_1: !secret universal1_chlist_box
- platform: remote_receiver
name: "Arrows BOX"
pioneer:
rc_code_1: !secret universal1_arrows_box
- platform: remote_receiver
name: "Menu BOX"
pioneer:
rc_code_1: !secret universal1_menu_box
- platform: remote_receiver
name: "Source BOX"
pioneer:
rc_code_1: !secret universal1_source_box
- platform: remote_receiver
name: "Up BOX"
pioneer:
rc_code_1: !secret universal1_up_box
- platform: remote_receiver
name: "Down BOX"
pioneer:
rc_code_1: !secret universal1_down_box
- platform: remote_receiver
name: "Left BOX"
pioneer:
rc_code_1: !secret universal1_left_box
- platform: remote_receiver
name: "Right BOX"
pioneer:
rc_code_1: !secret universal1_right_box
- platform: remote_receiver
name: "OK BOX"
pioneer:
rc_code_1: !secret universal1_ok_box
- platform: remote_receiver
name: "Exit BOX"
pioneer:
rc_code_1: !secret universal1_exit_box
- platform: remote_receiver
name: "Text BOX"
pioneer:
rc_code_1: !secret universal1_text_box
- platform: remote_receiver
name: "VolUp BOX"
pioneer:
rc_code_1: !secret universal1_volup_box
- platform: remote_receiver
name: "VolDown BOX"
pioneer:
rc_code_1: !secret universal1_voldown_box
- platform: remote_receiver
name: "YouTuTV BOX"
pioneer:
rc_code_1: !secret universal1_yoututv_box
- platform: remote_receiver
name: "NetTV BOX"
pioneer:
rc_code_1: !secret universal1_nettv_box
- platform: remote_receiver
name: "P ChUp BOX"
pioneer:
rc_code_1: !secret universal1_pchup_box
- platform: remote_receiver
name: "P ChDown BOX"
pioneer:
rc_code_1: !secret universal1_pchdown_box
- platform: remote_receiver
name: "Rewind BOX"
pioneer:
rc_code_1: !secret universal1_rewind_box
- platform: remote_receiver
name: "Pause Play BOX"
pioneer:
rc_code_1: !secret universal1_pauseplay_box
- platform: remote_receiver
name: "Prev BOX"
pioneer:
rc_code_1: !secret universal1_prev_box
- platform: remote_receiver
name: "Stop BOX"
pioneer:
rc_code_1: !secret universal1_stop_box
- platform: remote_receiver
name: "Next BOX"
pioneer:
rc_code_1: !secret universal1_next_box
- platform: remote_receiver
name: "Blue BOX"
pioneer:
rc_code_1: !secret universal1_blue_box
- platform: remote_receiver
name: "Green BOX"
pioneer:
rc_code_1: !secret universal1_green_box
- platform: remote_receiver
name: "Yellow BOX"
pioneer:
rc_code_1: !secret universal1_yellow_box
- platform: remote_receiver
name: "Blue BOX"
pioneer:
rc_code_1: !secret universal1_blue_box
- platform: remote_receiver
name: "Info LR BOX"
pioneer:
rc_code_1: !secret universal1_infolr_box
- platform: remote_receiver
name: "EPG 3D BOX"
pioneer:
rc_code_1: !secret universal1_epg3d_box
- platform: remote_receiver
name: "USB Fav BOX"
pioneer:
rc_code_1: !secret universal1_usbfav_box
- platform: remote_receiver
name: "PM Zoom BOX"
pioneer:
rc_code_1: !secret universal1_pmzoom_box
- platform: remote_receiver
name: "SM Setup BOX"
pioneer:
rc_code_1: !secret universal1_smsetup_box
- platform: remote_receiver
name: "Guide Sleep BOX"
pioneer:
rc_code_1: !secret universal1_guidesleep_box
- platform: remote_receiver
name: "HomeApp Sub DVD"
pioneer:
rc_code_1: !secret universal1_homeapp_subdvd
- platform: remote_receiver
name: "Mute Sub DVD"
pioneer:
rc_code_1: !secret universal1_mute_subdvd
- platform: remote_receiver
name: "Power Sub DVD"
pioneer:
rc_code_1: !secret universal1_power_subdvd
- platform: remote_receiver
name: "1 Sub DVD"
pioneer:
rc_code_1: !secret universal1_1_subdvd
- platform: remote_receiver
name: "2 Sub DVD"
pioneer:
rc_code_1: !secret universal1_2_subdvd
- platform: remote_receiver
name: "3 Sub DVD"
pioneer:
rc_code_1: !secret universal1_3_subdvd
- platform: remote_receiver
name: "4 Sub DVD"
pioneer:
rc_code_1: !secret universal1_4_subdvd
- platform: remote_receiver
name: "5 Sub DVD"
pioneer:
rc_code_1: !secret universal1_5_subdvd
- platform: remote_receiver
name: "6 Sub DVD"
pioneer:
rc_code_1: !secret universal1_6_subdvd
- platform: remote_receiver
name: "7 Sub DVD"
pioneer:
rc_code_1: !secret universal1_7_subdvd
- platform: remote_receiver
name: "8 Sub DVD"
pioneer:
rc_code_1: !secret universal1_8_subdvd
- platform: remote_receiver
name: "9 Sub DVD"
pioneer:
rc_code_1: !secret universal1_9_subdvd
- platform: remote_receiver
name: "0 Sub DVD"
pioneer:
rc_code_1: !secret universal1_0_subdvd
- platform: remote_receiver
name: "ChList Sub DVD"
pioneer:
rc_code_1: !secret universal1_chlist_subdvd
- platform: remote_receiver
name: "Arrows Sub DVD"
pioneer:
rc_code_1: !secret universal1_arrows_subdvd
- platform: remote_receiver
name: "Menu Sub DVD"
pioneer:
rc_code_1: !secret universal1_menu_subdvd
- platform: remote_receiver
name: "Source Sub DVD"
pioneer:
rc_code_1: !secret universal1_source_subdvd
- platform: remote_receiver
name: "Up Sub DVD"
pioneer:
rc_code_1: !secret universal1_up_subdvd
- platform: remote_receiver
name: "Down Sub DVD"
pioneer:
rc_code_1: !secret universal1_down_subdvd
- platform: remote_receiver
name: "Left Sub DVD"
pioneer:
rc_code_1: !secret universal1_left_subdvd
- platform: remote_receiver
name: "Right Sub DVD"
pioneer:
rc_code_1: !secret universal1_right_subdvd
- platform: remote_receiver
name: "OK Sub DVD"
pioneer:
rc_code_1: !secret universal1_ok_subdvd
- platform: remote_receiver
name: "Exit Sub DVD"
pioneer:
rc_code_1: !secret universal1_exit_subdvd
- platform: remote_receiver
name: "Text Sub DVD"
pioneer:
rc_code_1: !secret universal1_text_subdvd
- platform: remote_receiver
name: "VolUp Sub DVD"
pioneer:
rc_code_1: !secret universal1_volup_subdvd
- platform: remote_receiver
name: "VolDown Sub DVD"
pioneer:
rc_code_1: !secret universal1_voldown_subdvd
- platform: remote_receiver
name: "YouTuTV Sub DVD"
pioneer:
rc_code_1: !secret universal1_yoututv_subdvd
- platform: remote_receiver
name: "NetTV Sub DVD"
pioneer:
rc_code_1: !secret universal1_nettv_subdvd
- platform: remote_receiver
name: "P ChUp Sub DVD"
pioneer:
rc_code_1: !secret universal1_pchup_subdvd
- platform: remote_receiver
name: "P ChDown Sub DVD"
pioneer:
rc_code_1: !secret universal1_pchdown_subdvd
- platform: remote_receiver
name: "Rewind Sub DVD"
pioneer:
rc_code_1: !secret universal1_rewind_subdvd
- platform: remote_receiver
name: "Pause Play Sub DVD"
pioneer:
rc_code_1: !secret universal1_pauseplay_subdvd
- platform: remote_receiver
name: "Prev Sub DVD"
pioneer:
rc_code_1: !secret universal1_prev_subdvd
- platform: remote_receiver
name: "Stop Sub DVD"
pioneer:
rc_code_1: !secret universal1_stop_subdvd
- platform: remote_receiver
name: "Next Sub DVD"
pioneer:
rc_code_1: !secret universal1_next_subdvd
- platform: remote_receiver
name: "Blue Sub DVD"
pioneer:
rc_code_1: !secret universal1_blue_subdvd
- platform: remote_receiver
name: "Green Sub DVD"
pioneer:
rc_code_1: !secret universal1_green_subdvd
- platform: remote_receiver
name: "Yellow Sub DVD"
pioneer:
rc_code_1: !secret universal1_yellow_subdvd
- platform: remote_receiver
name: "Blue Sub DVD"
pioneer:
rc_code_1: !secret universal1_blue_subdvd
- platform: remote_receiver
name: "Info LR Sub DVD"
pioneer:
rc_code_1: !secret universal1_infolr_subdvd
- platform: remote_receiver
name: "EPG 3D Sub DVD"
pioneer:
rc_code_1: !secret universal1_epg3d_subdvd
- platform: remote_receiver
name: "USB Fav Sub DVD"
pioneer:
rc_code_1: !secret universal1_usbfav_subdvd
- platform: remote_receiver
name: "PM Zoom Sub DVD"
pioneer:
rc_code_1: !secret universal1_pmzoom_subdvd
- platform: remote_receiver
name: "SM Setup Sub DVD"
pioneer:
rc_code_1: !secret universal1_smsetup_subdvd
- platform: remote_receiver
name: "Guide Sleep Sub DVD"
pioneer:
rc_code_1: !secret universal1_guidesleep_subdvd
- platform: remote_receiver
name: "Brightness Up Small"
pioneer:
rc_code_1: !secret universal2_brightness_up
- platform: remote_receiver
name: "Brightness Down Small"
pioneer:
rc_code_1: !secret universal2_brightness_down
- platform: remote_receiver
name: "Next Small"
pioneer:
rc_code_1: !secret universal2_next
- platform: remote_receiver
name: "Power Small"
pioneer:
rc_code_1: !secret universal2_power
- platform: remote_receiver
name: "Blue Column 1 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_1
- platform: remote_receiver
name: "Blue Column 2 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_2
- platform: remote_receiver
name: "Blue Column 3 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_3
- platform: remote_receiver
name: "Blue Column 4 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_4
- platform: remote_receiver
name: "Blue Column 5 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_5
- platform: remote_receiver
name: "Green Column 1 Small"
pioneer:
rc_code_1: !secret universal2_greencol_1
- platform: remote_receiver
name: "Green Column 2 Small"
pioneer:
rc_code_1: !secret universal2_greencol_2
- platform: remote_receiver
name: "Green Column 3 Small"
pioneer:
rc_code_1: !secret universal2_greencol_3
- platform: remote_receiver
name: "Green Column 4 Small"
pioneer:
rc_code_1: !secret universal2_greencol_4
- platform: remote_receiver
name: "Green Column 5 Small"
pioneer:
rc_code_1: !secret universal2_greencol_5
- platform: remote_receiver
name: "Blue Column 1 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_1
- platform: remote_receiver
name: "Blue Column 2 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_2
- platform: remote_receiver
name: "Blue Column 3 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_3
- platform: remote_receiver
name: "Blue Column 4 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_4
- platform: remote_receiver
name: "Blue Column 5 Small"
pioneer:
rc_code_1: !secret universal2_bluecol_5
- platform: remote_receiver
name: "White Column 1 Small"
pioneer:
rc_code_1: !secret universal2_whitecol_1
- platform: remote_receiver
name: "White Column 2 Small"
pioneer:
rc_code_1: !secret universal2_whitecol_2
- platform: remote_receiver
name: "White Column 3 Small"
pioneer:
rc_code_1: !secret universal2_whitecol_3
- platform: remote_receiver
name: "White Column 4 Small"
pioneer:
rc_code_1: !secret universal2_whitecol_4
- platform: remote_receiver
name: "White Column 5 Small"
pioneer:
rc_code_1: !secret universal2_whitecol_5
- platform: remote_receiver
name: "Blue Up Small"
pioneer:
rc_code_1: !secret universal2_blue_up
- platform: remote_receiver
name: "Blue Down Small"
pioneer:
rc_code_1: !secret universal2_blue_down
- platform: remote_receiver
name: "Green Up Small"
pioneer:
rc_code_1: !secret universal2_green_up
- platform: remote_receiver
name: "Green Down Small"
pioneer:
rc_code_1: !secret universal2_green_down
- platform: remote_receiver
name: "Blue Up Small"
pioneer:
rc_code_1: !secret universal2_blue_up
- platform: remote_receiver
name: "Blue Down Small"
pioneer:
rc_code_1: !secret universal2_blue_down
- platform: remote_receiver
name: "Quick Small"
pioneer:
rc_code_1: !secret universal2_quick
- platform: remote_receiver
name: "Slow Small"
pioneer:
rc_code_1: !secret universal2_slow
- platform: remote_receiver
name: "Auto Small"
pioneer:
rc_code_1: !secret universal2_auto
- platform: remote_receiver
name: "Flash Small"
pioneer:
rc_code_1: !secret universal2_flash
- platform: remote_receiver
name: "Jump 3 Small"
pioneer:
rc_code_1: !secret universal2_jump3
- platform: remote_receiver
name: "Jump 7 Small"
pioneer:
rc_code_1: !secret universal2_jump7
- platform: remote_receiver
name: "Fade 3 Small"
pioneer:
rc_code_1: !secret universal2_fade3
- platform: remote_receiver
name: "Fade 7 Small"
pioneer:
rc_code_1: !secret universal2_fade7
- platform: remote_receiver
name: "DIY 1"
pioneer:
rc_code_1: !secret universal2_diy1
- platform: remote_receiver
name: "DIY 2"
pioneer:
rc_code_1: !secret universal2_diy2
- platform: remote_receiver
name: "DIY 3"
pioneer:
rc_code_1: !secret universal2_diy3
- platform: remote_receiver
name: "DIY 4"
pioneer:
rc_code_1: !secret universal2_diy4
- platform: remote_receiver
name: "DIY 5"
pioneer:
rc_code_1: !secret universal2_diy5
- platform: remote_receiver
name: "DIY 6"
pioneer:
rc_code_1: !secret universal2_diy6
#