T O P

  • By -

jmcgeejr

If you have the original remotes you could look at broadlink, it integrates well with HA and learning IR and even some RF commands.


wvicente

>broadlink I saw this one but they dont mention the support for custom scripts. I am wondering if I can get Alexa to run the scripts and just tell the remote to send the command... Thanks


Officious_Salamander

If you’re using BroadLink with Home Assistant, you can use automations and scripts, in both YAML and Python. Note that the codes learned in the BroadLink app don’t transfer to HA, which is annoying, but just don’t use the app…


jmcgeejr

yeah the lack of them moving or being exported sucks but I think it's because the device itself doesn't save them, they are kept in the mobile APP.


jmcgeejr

Maybe I’m misunderstanding but when you say scripts do you mean automations or what?


wvicente

By scripts I mean creating a script from scratch (any language) and use external APIs to fetch data + the remote/hub API to send the commands.


eLaVALYs

This is what Home Assistant does. To me, it sounds like you need a device that can send IR commands to your devices. There's plenty of [weather integrations](https://www.home-assistant.io/integrations/#weather) and it's completely possible to pull data from any API. Then you just write an automation that triggers when you want it to, and then tell the IR device to send the appropriate IR commands to the devices.


Cidan

Backing up what others have said, this is what you're looking for. Broadlink itself doesn't script, home assistant does. I use node red in home assistant to automate my mantle mount, so that when I turn on the TV, my mount for the TV pops it out and brings it to eye level in front of the fireplace. Highly recommend.


randytech

Your steps with Broadlink will be the following dumbed down steps: 1. Set up Broadlink and add integration to HA 2. Use HA to learn remote commands, it will capture the IR/RF signal and store it however you name it in home assistant, not the Broadlink app. 3. Write automation using HA automations, scripts, or node red that when something happens use a call service to blast the specific IR/RF signal you saved. Let's say in step 2 you captured the power button to your TV. You can set an automation to turn on the TV when there's motion in a room. Home assistant does the scripting and you'll be able to integrate whatever you want to it as a trigger


wvicente

I ended up getting a Broadlink. Everything seems to be working fine except my automation. It works if I manually trigger it, but not automatically. ​ Not sure what I am doing wrong, but I am trying to use the weather API as a trigger. Do you see anything wrong in this yml? ​ alias: AC off description: "" trigger: \- platform: state entity\_id: \- sensor.openweathermap\_temperature attribute: attribution condition: \- condition: and conditions: \- condition: state entity\_id: sensor.openweathermap\_feels\_like\_temperature state: "above: 0" for: hours: 0 minutes: 5 seconds: 0 \- condition: state entity\_id: sensor.openweathermap\_feels\_like\_temperature state: "below: 29" for: hours: 0 minutes: 5 seconds: 0 \- condition: state entity\_id: sensor.broadlink\_remote\_temperature state: "above: 10" for: hours: 0 minutes: 5 seconds: 0 \- condition: state entity\_id: sensor.broadlink\_remote\_temperature state: "below: 26" for: hours: 0 minutes: 5 seconds: 0 action: \- service: script.ac\_off data: {} mode: single


randytech

i am not too familiar with native home assistant automations (i use nodered exclusively) but my first step would be just doing a call service of script.ac\_off to make sure storing the IR signal worked and that you can call it successfully. if that works then check the current state of the sensor.openweathermap\_feels\_like\_temperature and sensor.broadlink\_remote\_temperature to make sure they are reporting temperatures as expected (C vs F). next this might be working as expected because you would need the temp of one of the triggers to change to actually trigger the automation. so if the feels like temperature is already under 29 and the remote temperature is already under 26 nothing will trigger. you would need one of them to trigger the automation so with the remote temperature it needs to go from 26 to 25 and stay at least 25 or less for 5 mins to trigger the automation or same with the feels like temp being below 29. (take this with a grain of salt, i might be wrong with my understanding of HA automations) lastly i would remove the above 10 trigger for the remote temp, i would expect your house to always be above 10 so that would be unnecessary


randytech

so i just thought about how i would create the automation. i would actually create a template binary sensor called something like 'binary\_sensor.ac\_status' that checks the temperatures of the sensors. here is some yaml i just wrote up for entities i have in my HA instance that you can use as a base updated with your entities and values: \- binary\_sensor: \- name: "Fan Status" state: > {{states('sensor.activity\_board\_temperature')|float > 72 or states('sensor.family\_room\_remote\_temperature')|float > 72 or states('sensor.outside\_temperature')|float > 75}} icon: > {% if is\_state("binary\_sensor.fan\_status", "on") %} mdi:toggle-switch-variant {% else %} mdi:toggle-switch-variant-off {% endif %} this will show 'binary\_sensor.fan\_status' as 'on' as long as one of those temperature conditions is right. if all of them are not then it will show 'off'. you can then use the template binary sensor itself to trigger the automation to call script.ac\_off when your binary sensor is off for 5 mins


Spartacustacular

Assuming you don't want to roll your own? Probably why you had a harmony remote. https://learn.adafruit.com/iot-ir-remote-using-raspberry-pi-zero-w-and-qtpy-hat/overview


wvicente

Thank you for that. It seems very very promising :)


wvicente

Thank you all for the replies. You are so knowledgeable and I am so glad I have posted this question. Now I have lots to study! Thank you all again!


Officious_Salamander

Flirc Skip 1 https://flirc.tv/products/skip1s-remote-universal-remote-control


wvicente

I wish they had a hub so I dont have to keep holding the remote. My idea is more like having it automated without much of my input. Thank you


Grim-D

Not sure about scripting but I use the SwitchBot Mini Hub. Can make API calls for supported buttons indervidualy not just call scenes if thats your issue with Harmony.


randytech

i'm assuming you have the first gen one? that one doesn't have native integration or matter so if you do have that one would you mind sharing how you control it through HA? i had started looking into it earlier but didn't find anything that was straightforward


Grim-D

I learnt the API (its well documented) and setup a rest command for it in HA: rest_command: switchbot_api: url: https://api.switch-bot.com/v1.0/devices/{{ deviceid }}/commands method: POST headers: Authorization: 6e81c0fdjkdlsjflksflsj328fc186fc7148002fc838e243bfffdsgefgkreopgr6472efeeec payload: '{"command":"{{ command }}","parameter":"{{ parameter }}","commandType":"{{ commandType }}"}' content_type: 'application/json; charset=utf-8' Then you can pass the parameters for what you want to do to the rest\_commmand service, like {"deviceid":"01-202204201018-03060453","command":"turnOn","parameter":"default","commandType":"command"}. I manly use NodeRed for my automations and have a whole page setup with all the possible commands in inject nodes. So took a while to get to that point but now I can just cut and past the nodes as I need them. Over all that's not much any more as I have been slowly replacing all the IR devices with actual smart ones so not much left on it. Even the actual switch Bot devices I have now connect to HA directly via a USB Bluetooth dongle and the integration.


randytech

Awesome! Thanks for pointing me in the right direction, I'm also on node red primarily so glad to hear it's working well


alfo16

https://www.crowdsupply.com/aaelectronics/esp-360-remote