Remote/HA control help

  • This is the sketch I use on the nano. Just change the number of LEDs, and make sure the baudrate matches in hyperion settings.





    I started off using this video as a guide.

    Ok, I messed around with some stuff and I think I have gotten a more reliable setup, but still need to incorporate the arduino. I was able to get things working well by increasing the size of the wire i used to run from the media cabinet to the TV. I also increased my power supply to 20a and run the power for the raspberry pi and leds power from it using the larger wires. No cap, no resistor yet. Using this setup the HA integration. seems to work to let me toggle between a solid color and the USB capture card. So I am making some progress... Now if i can figure out how to make the default just white then i manually turn on the usb i would have at least accomplished the basic setup of what i was doing but in the hyperion ui doesn't let me set the solid color/effect at a lower priority # than the USB.


    Do I only need to run a wire from the pin 6 on the Arduino to the data wire on the leds then plug the arduino in via USB to the pi3?

  • Yes, after the sketch is loaded on the nano, it's D6 to LED data. You also need to change the Hyperion LED controller settings to match that screenshot, replacing the LED count and if need be, the output path.

    Since you have the Hyperion integration in HA already, we can use that. Make sure to click "options" on the integration and change the priority to something above 100, but lower than your grabber priority. For instance, my grabber is priority 110. So I'd change the Home Assistant integration priority to 101-109. I'd use an automation like this for start up, making sure to change the entity_id to match your own.


    To switch back to the grabber, you just need to call the Hyperion "V4L" effect. For instance, if I wanted the grabber to start on playback, I could use my Nvidia Shield play state. If didn't want it automated, or don't have your media player integrated into HA, you could use a button press on your harmony remote as a trigger to accomplish the same thing.


    If I wanted the solid color or effect to resume when playback is paused, stopped, or idle, I could use the following


    And finally, if I wanted Hyperion to turn off when the Shield turns off, I could use the following

    Code
    - alias: LED - Hyperion Off
      mode: single
      trigger:
      - platform: state
        entity_id: media_player.shield
        to: 'off'
      action:
      - service: light.turn_off
        target:
          entity_id: light.first_led_hardware_instance


    That last one may not be necessary depending on your setup, but hopefully, it's enough to get you on the right track.

  • Can I make white, V4L and off each a separate button in HA? My hope is that if so, I can link it to a SmartThings virtual switch and since ST integrates with Harmony remotes, I can just turn that button on and off with an activity and program it to a button.


    Where do I put this code? In the developer tools somewhere? Where do you find the info on how to call these functions from the individual integrations? I’m trying to read thru the instructions in the HA help but it’s not clear to me. I think once I’ve done one I’ll be able to do more.


    Thank you!!

  • You can edit automations.yaml and add that code manually, or you can use the gui and use that code as a guide. For instance, I've attached a screencap of what the Hyperion Playback automation would look like from the Home Assistant gui.


    I would suggest just adding your harmony remote to HA, which would allow you to use button presses on the remote as triggers for the automations. But, I'm not familiar with ST to tell you exactly how it would be best to integrate it with ST. If you just want an actionable button, you can set those up as scripts. Scripts are nearly identical to automations, but have no conditions and no triggers, just actions.

  • I am kind of there... I made a Boolean switch that I'm trying to make a simple toggle between White and V4L. If I hit run on the V4L one (Ambilight On) it works, but when I run the other one (to trigger for only white lights) it doesn't. Do these look right? Once these work, I can make another one that turns all lights off.


     


    *Edit... For some reason the V4L will no longer work. Not just the automation, but also from with the switch itself in HA. All the colors still work as so the effects. I can only get the V4L if I do it under the remote control section of Hyperion now.

  • I believe the effects are case-sensitive. Try Solid instead of solid.

    I noticed that too and changed it. I think one of the commands make have caused an issue with the Pi, but after rebooting, it seems to be working now. However, when I toggle the Boolean toggle, nothing happens, but when it does work when I manually trigger in the automation section. Can i use that Boolean toggle to switch between those to effects? It seemed like i could using the turn on for each instead if of a turn off, i just needed to make the To: sections different (On / Off).

  • I haven't really seen an input boolean used that way in an automation. It's possible that it could work. But I've only ever used them in conjunction with template switches. Which you could do if you converted those from automations to scripts. Where ambilight_on would turn on solid white LEDs, and ambilight_off would turn on the V4L effect. You may want to use a different naming scheme if you plan to make one that actually turns off Hyperion. I haven't tested this, but I think it would go something like this:


    edit: tested and should be working now.


    In configuration.yaml

    Einmal editiert, zuletzt von D34DC3N73R () aus folgendem Grund: corrected code after testing + added icon switching based on state

  • I haven't really seen an input boolean used that way in an automation. It's possible that it could work. But I've only ever used them in conjunction with template switches. Which you could do if you converted those from automations to scripts. Where ambilight_on would turn on solid white LEDs, and ambilight_off would turn on the V4L effect. You may want to use a different naming scheme if you plan to make one that actually turns off Hyperion. I haven't tested this, but I think it would go something like this:


    edit: tested and should be working now.


    In configuration.yaml

    I am not sure where to edit this. I see where scripts are in HA, but as i read up on HA i am seeing there are what appear to be different flavors? Hass.io and Home Assistant. I run HA in a docker on my Unraid box. I was trying to install the File Editor for HA but it said it was in the Add Ons Store and i don't have that. I am sure i can edit it using nano or something in the docker, but does it matter where I put this in the config file?

  • I also run HA in docker. Your configuration.yaml file will probably be in /mnt/user/appdata/home-assistant/configuration.yaml or something similar. It's wherever you store docker application data. You can check by clicking edit on the container and you'll see what path is mounted to /config. You could even edit using container console in which case it would be /config/configuration.yaml, although I don't believe nano is part of the home assistant container. Vi is installed in the container if you're familiar with that editor. It's probably easier to figure out where the application data is stored and just ssh into your unraid box and use nano /mnt/user/appdata/home-assistant/configuration.yaml


    Side note, if you do want a file editor for HA, it's entirely possible, you just have to run a separate container and integrate it manually. I use a VS Code container and it works great

  • I also run HA in docker. Your configuration.yaml file will probably be in /mnt/user/appdata/home-assistant/configuration.yaml or something similar. It's wherever you store docker application data. You can check by clicking edit on the container and you'll see what path is mounted to /config. You could even edit using container console in which case it would be /config/configuration.yaml, although I don't believe nano is part of the home assistant container. Vi is installed in the container if you're familiar with that editor. It's probably easier to figure out where the application data is stored and just ssh into your unraid box and use nano /mnt/user/appdata/home-assistant/configuration.yaml


    Side note, if you do want a file editor for HA, it's entirely possible, you just have to run a separate container and integrate it manually. I use a VS Code container and it works great

    I found a configuration editor, but there wasn't much in my configuration.yaml file. What was originally in there was in the red dotted square and then i added what sent me below. Is that correct? I didn't see any section for Booleans already outlined, etc.


  • Yes that's correct assuming you made the scripts 'ambilight_on' and 'ambilight_off'. Just save and restart HA. Any edits to configuration.yaml require a restart to take effect. Also, make sure to disable the previous automations you made with input_boolean.ambilight so there isn't conflicting actions.

    • Hilfreichste Antwort

    Ok, so rather than drag out this thread with a lot of back and forth, D34DC3N73R and I PM'd and he was gracious enough to spend about 2 hours with me helping to get this working as I wanted. For those of you who've found this thread, here is what we ended up doing. He wrote a script for my (in this thread) that toggle between the Ambilight (V4L) and just white lights (on is the screen match off is the white lights). This also created a switch within HA that I control via and automation. We found out that the Home Assistant/SmartThings native integration keeps the switches in sync between the 2 systems already. So I created a virtual device in ST's that shows up in HA because of that integration then i use an automation that triggers the Ambilight switch based on the virtual switch state. I did it this way because i wanted to assign the Home Control buttons on the Harmony Elite to allow me to toggle between Ambilight and White lights as well as turn those lights on and off with an activity. I use 2 virtual switches to do this. One simply turns on and off with an activity (this is setup within the Harmony activity and uses ST). This give me the lights on/lights off control. Next i assigned the virtual switch to the Home Control buttons on the remote. After that I set up an automation that is triggered by those 2 virtual switch and tells HA to turn on and off the Hyperion lights and toggle between the 2 desired effects. Hyperion has a native integration with HA but not ST's so this is why I had to do it this way.


    Hope this helps someone in the future. A HUGE thank you to D34DC3N73R for his help on this for not only Hyperion but also HA. If anyone finds this is needs help I am happy to try to pay it forward and answer any question about this.


    Thanks!

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!