Pironman in Home Assistance as add-on RGB light automation

Hello,
I have a setup of the Pironman case with Raspberry pi 4.
I followed the setup process for Pironman Add-On inside Home Assistance.
All works great and I’m able to change RGB color and the other options from the “Configuration” tab.

What I’m trying to achieve:
I’m trying to have a simple automation which will turn off the RGB at a certain hour and turn it on again in another hour.

What I’ve tried so far:

  • Since it’s an add-on, the configuration file isn’t accessible easily.
    I tried to change the config file from using “Portainer” add on - I can access Pironman container and also navigate to ./pironman where the config.txt file is located. I changed it using:
sed -ie "s/rgb_enable.*/rgb_enable = False/g" config.txt

When I restart the add on it didn’t work.
This is manually, just trying to figure out a way to do so.

  • I also tried commands like “pironman -rw off” , but still no luck.

  • Lastly, I also tried from a script, using hassio.addon_stdin, but still no luck

alias: Pironman - Turn Off Lights
sequence:
  - service: hassio.addon_stdin
    data:
      addon: 6fa7f6d2_pironman
      input: /bin/bash cd ..; cd pironman; sed -ie "s/rgb_enable.*/rgb_enable = False/g" config.txt;
  - service: hassio.addon_restart
    metadata: {}
    data:
      addon: 6fa7f6d2_pironman
mode: single
icon: mdi:lightbulb-off

What can I do to achieve the automation I want? I just need to understand the way to turn off the lights from Home Assistance from a script for example.

I would appreciate any help. Thanks!

1 Like

This issue is being fixed for testing. Please wait a little longer. Notify you with news updates.

1 Like

Thank you. Looking forward for some solution/workaround.

1 Like

We’re sorry, we’ve tried this and there is no way to automate RGB lighting at this time.

1 Like

Not even with some add-on?
Please shade some light on that subject.
Where is the configuration file from the UI actually saved? I’m sure there is a way to change it.

1 Like

Sorry, seem’s like currently, It can’t. Here’s the thing:
Home Assistant Addon config using bashio, and the actual config is save on Homeassistant. when the addon start, it will pass the config to run.sh and run the pironman command. See: GitHub - sunfounder/home-assistant-addon
and inside the addon container, changing the config will not work as it need a restart to read the configs. but the stop command of restart will kills the application, and addon watch that, and close the container. So this kind of method does not work.
So the only way to do it , it’s changing the configuration of addon, but we didn’t find it.

1 Like

If the config file is saved on the Homeassistant, then it should be even easier.
Restart the Pironman via a script is really easy using Homeassistant built in Scripts options…
So it’s only about finding where the config file is stored.

I know for a fact it’s not the config.txt which stored in the hassos-boot partition as mentioned here.
For example in the UI of the configuration for the add-on we have “RGB-color” and things which are not related to the config.txt at the hassos-boot partition.
It’s just a question of which file does the “Configuration UI” is changing?

1 Like

Yes, but at the moment we haven’t found where this configuration is. This is the development documentation about the addon’s configuration, you can refer to it: Add-On Configuration | Home Assistant Developer Docs

1 Like

Can you please take a look at the following last section in this page?

If you will enable such option, i.e to add a config file from the addon_configs, the automation I would like to achieve will be possible.
In general, it will open the door for users and customers of Pironman case which are using HA to do various automations.
I added a photo which shows the directory I’m talking about - I can see BTW configurations from various other Add-Ons inside.

I also want to add that I tried every other possible method to achieve it but without luck.
I thought even on creating somehow two separate containers in Portainer which will use different images (one with RGB light off and one with RGB light on), but that didn’t work…
In Portainer I can access the Pironman directory and run Pironman -re off, but the problem is that after the restart the original images loads back and revert it.
So it seems that the only option will be if you guys can add some config file which can be changed from the addon_configs directory.

Thanks for the suggestion, we will consider adding this configuration. But it’s not very easy to implement at the moment. Because Pironman doesn’t support setting up hot updates, you need to restart the service after changing the configuration file. When restarting the service, addon will shut down the container when it checks for service shutdown, and will not be able to restart it. In addition, adding a new Addon_config will lead to a conflict between the new configuration and the original configuration of the two configuration files. We need to figure out how to solve all these problems.

1 Like