#light decrease by 1% instead of 10%
1 messages ยท Page 1 of 1 (latest)
To format your text as code, enter three backticks on the first line, press Shift+Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.
You want https://www.home-assistant.io/integrations/light#service-lightturn_on and the brightness_step_pct option
light.outputmosfet_outputmosfet.default,x,y,0 in the /config/light_profiles.csv what is x,y for?
description: ""
trigger:
- platform: time_pattern
seconds: /10
condition:
- condition: numeric_state
entity_id: sensor.strom_dg_aktuell
below: -20
action:
- service: light.turn_off
target:
entity_id: light.outputmosfet_outputmosfet
data:
brightness_step_pct: -1```
like this?
Two comma-separated floats that represent the color in XY
okey thx
no need for color
i only want to change the "brightness" of the mosfet
so can i leave x,y in the header?
it seems to be working ๐ thx again
Ignore that file
You only want to edit that file if you want to set defaults
I will say that your automation is horrible ๐
Every 10 seconds step it down 1%.... until it turns off?
If it doesn't turn off it'll keep calling the service every 10 seconds, trying to set it from 1% to 0%
i use two automations to level out the consumption between 0 and -20 Watts
the timing is still a bit off
i have to test a bit more so the ouputmosfet reacts fast but does not overshoot ๐
i think it will never go to 0%
do you understand what kind of automation i want to create?
do you have a better idea?
I do understand, and I'd probably trigger based on it going below -20, and use a repeat in the action
i tried that one, but the esp32 with esphome had quiet a had time with so many inputs and crashed ๐
hard
alias: Einspeisung reduzieren
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.strom_dg_aktuell
below: -20
condition:
- condition: state
entity_id: light.outputmosfet_outputmosfet
state: 'on'
action:
- repeat:
while:
- condition: state
entity_id: light.outputmosfet_outputmosfet
state: "on"
- condition: numeric_state
entity_id: sensor.strom_dg_aktuell
below: -20
sequence:
- service: light.turn_on
target:
entity_id: light.outputmosfet_outputmosfet
data:
brightness_step_pct: -1
- delay: '00:10:00'
That's going to be gentler on the ESP than what you wrote
alias: Einspeisung reduzieren
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.strom_dg_aktuell
below: -20
- platform: state
entity_id: light.outputmosfet_outputmosfet
to: 'on'
condition:
- condition: state
entity_id: light.outputmosfet_outputmosfet
state: 'on'
- condition: numeric_state
entity_id: sensor.strom_dg_aktuell
below: -20
action:
- repeat:
while:
- condition: state
entity_id: light.outputmosfet_outputmosfet
state: "on"
- condition: numeric_state
entity_id: sensor.strom_dg_aktuell
below: -20
sequence:
- service: light.turn_on
target:
entity_id: light.outputmosfet_outputmosfet
data:
brightness_step_pct: -1
- delay: '00:10:00'
``` optional robustness edit
thx that is more info that i expected ๐ I will try that ๐
That'll run when the sensor falls below -20 and the light is on, and will stop running if the sensor goes above -20 or the light turns off
You could add another condition to stop it at 1% brightness
i see what you are doing there ๐ quiet elegant
Sometimes brute force is the only way, but ... not always
if i try your idea, can i remove the delay, so it is faster ?
do I run into a problem if it goes down to 0% ?
The delay is the same "delay" you had in yours
You can test it and see if it turns off when it goes from 1% to 0%
okey thx i will test now ๐
the esp32 cant handle no delay ๐
i had to reset it and the automation wont start again because 0% means off...
ยดยดยด trigger:
- platform: numeric_state
entity_id: sensor.strom_dg_aktuell
below: -20 - platform: state
entity_id: light.outputmosfet_outputmosfet
to: 'on' ยดยดยด
the wrong ones
I assume you've turned it on?
''' trigger:
- platform: numeric_state
entity_id: sensor.strom_dg_aktuell
below: -20 - platform: state
entity_id: light.outputmosfet_outputmosfet
to: 'on' '''
does this trigger turn the mosfet on or does it only check if its on?
Still the wrong ones
There are three sections to an automation:
trigger: When any one of these becomes true the automation starts processing. Only one trigger is ever responsible for starting an automation, if you make aconditionthat checks for more than one having started the automation then the condition can never be true.condition: These are checked after atriggerstarts the processing, and must be true for the automation to continue.action: This is the part that does something, and can also include further conditions.
๐
okey so i put another action into it
If you want it to do anything, yes
it is not working becaus the trigger and condition will block it currently
What are you trying to do?
If you want the light turned on do it manually, or write another automation to handle that
I want the automation to work all the time even when i turn it of accidently
Then you want another automation that turns it on if it's turned off
or i just remove `
ยดยดยด - condition: state
entity_id: light.outputmosfet_outputmosfet
state: "on" ยดยดยด
One day ... one day you'll find the right quotes
๐
entity_id: light.outputmosfet_outputmosfet
state: "on" ```
๐
is it possible to generate the steps variable ?
"steps variable"?
let me make an example
If you want to change the size of the step change you'll need #templates-archived
so i turn on a light an the consumption increase by 100W I want to go in 10% steps but if i plug in a phone (=5w
)
i want to increase by 1%
depending on the gap between current and new consumption
Yup, so you need #templates-archived