#Custom component not including automations.yaml
1 messages · Page 1 of 1 (latest)
Why would you have automations.yaml in custom_components?
It belongs in your config directory and needs to be included from configuration.yaml. It has nothing to do with custom components
I am most likely doing it wrong. My componet manages a swarm of esphome devices. I want the component to be able to control various aspects of the devices. Automations look like the way to go. I wanted to keep everything compartmentalized in my custom component so it is self contained.
Sample Automation:
trigger:
- platform: event
event_type: light_turn_on_event
action:
- service: system_log.write
data:
message: "Event data: {{ trigger.event.data }}"
level: info
- service: light.turn_on
target:
entity_id: "{{ trigger.event.data.target }}"
data:
brightness_pct: "{{ trigger.event.data.brightness }}"
rgb_color: "{{ trigger.event.data.rgb_color }}"
effect: "fill_solid"```
Here is what I have added to the main configuration.yaml:
automation connected_button: !include custom_components/connected_button/automations.yaml```
Have you actually written a custom integration for HA?
I think so... init.py and all the other files that go with it?
It shows up with the configured dashboard
Ok. I wouldn't suggest putting automation.yaml in there because it has nothing to do with it
Automations seems like the easiest way to set the values on my led segments
Ok
The api exists because when I click the name of a led segment, I can see brightness, color and effect
What is the best way to get/set those values?
Seems like you could do everything in your integration
I am trying to use as much existing functionality as possible.
What other mechanism do you suggest?
This is my 1st deep dive into ha
You've written an integration in Python and can do anything there
Right, but lets say I have my esphome devices. Each has button_leds and body_leds among other things. How should my component get and set brightness, color and effect on those two light segments?
Is it just as easy as light.entity_name.rgbColor = [0,0,0]
cause that would be amazing
No, you call services
services 🤔
Is there a way to discover what services are available for a device or entity?
Please go to channels & roles and select the developer option
There are developer channels
Thanks for the info!
Lots of tutorials and 30 years of coding experience